Displaying 20 results from an estimated 25 matches for "super_copy".
2013 Apr 11
2
[PATCH 2/2] Btrfs: use a lock to protect incompat/compat flag of the super block
...* Because we do not clear the flags for ever, so we needn''t use
+ * the lock on the read side.
+ *
+ * We also needn''t use the lock when we mount the fs, because
+ * there is no other task which will update the flag.
+ */
+ spinlock_t super_lock;
struct btrfs_super_block *super_copy;
struct btrfs_super_block *super_for_commit;
struct block_device *__bdev;
@@ -3663,8 +3674,15 @@ static inline void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info,
disk_super = fs_info->super_copy;
features = btrfs_super_incompat_flags(disk_super);
if (!(features & flag)) {...
2012 Jul 24
1
[PATCH v4] Btrfs: Check INCOMPAT flags on remount and add helper function
...define btrfs_set_fs_incompat(__fs_info, opt) \
+ __btrfs_set_fs_incompat((__fs_info), BTRFS_FEATURE_INCOMPAT_##opt)
+
+static inline void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info,
+ u64 flag)
+{
+ struct btrfs_super_block *disk_super;
+ u64 features;
+
+ disk_super = fs_info->super_copy;
+ features = btrfs_super_incompat_flags(disk_super);
+ if (!(features & flag)) {
+ features |= flag;
+ btrfs_set_super_incompat_flags(disk_super, features);
+ }
+}
+
#define btrfs_abort_transaction(trans, root, errno) \
do { \
__btrfs_abort_transaction(trans, root, __func__, \
di...
2008 Jan 07
1
[PATCH]Add rollback support for the converter
...id;
@@ -1017,12 +1047,13 @@ struct btrfs_root *create_subvol(struct
if (ret)
goto fail;
location.offset = (u64)-1;
- ret = btrfs_insert_dir_item(trans, tree_root, name, namelen,
+ ret = btrfs_insert_dir_item(trans, tree_root, name, strlen(name),
btrfs_super_root_dir(&fs_info->super_copy),
&location, BTRFS_FT_DIR);
if (ret)
goto fail;
- ret = btrfs_insert_inode_ref(trans, tree_root, name, namelen, objectid,
+ ret = btrfs_insert_inode_ref(trans, tree_root, name, strlen(name),
+ objectid,
btrfs_super_root_dir(&fs_info->super_copy));
if (re...
2013 May 16
0
[PATCH] btrfs-progs: mkfs: add -O option to specify fs features
...(1);
+ }
+ free(orig);
+ if (features & BTRFS_FEATURE_LIST_ALL) {
+ list_all_fs_features();
+ exit(0);
+ }
+ break;
+ }
case ''s'':
sectorsize = parse_size(optarg);
break;
@@ -1521,21 +1624,22 @@ raid_groups:
super = root->fs_info->super_copy;
flags = btrfs_super_incompat_flags(super);
+ /*
+ * FS features that can be set by other means than -O
+ * just set the bit here
+ */
if (mixed)
- flags |= BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS;
-
- btrfs_set_super_incompat_flags(super, flags);
+ features |= BTRFS_FEATURE_INCOMPAT_MIXED_G...
2008 Mar 15
1
btrfs-0.13 breaks boot on reiserfs-3.6
Hi,
I recompiled my kernel today, and when the btrfs-0.13 option is
enabled (CONFIG_BTR_FS=y) I cannot boot on my reiserfs-3.6 partition
any more. The kernel says that is cannot mount /dev/sdc6. I can boot
the kernel when I recompile it with the same options and
CONFIG_BTR_FS=n, and with the same boot options as well. Everything is
amd64 on my system (kernel + programs).
Here is a screenshot of
2011 Nov 09
6
[PATCH 0/5] Btrfs: mount error handling fixes
A bunch of fixes (memory leaks, NULL pointer dereferences and devices
hanging in busy state) to sanitize error handling during mount sequence.
This is on top of for-linus + slyfox''s double-free fix.
Thanks,
Ilya
Ilya Dryomov (5):
Btrfs: fix memory leak in btrfs_parse_early_options()
Btrfs: fix subvol_name leak on error in btrfs_mount()
Btrfs: avoid null dereference and leaks
2009 Dec 17
0
[PATCH] Btrfs: set a incompat flag when setting default subvol
...ct btrfs_super_block *disk_super;
+ u64 features;
u64 objectid = 0;
u64 dir_id;
@@ -1610,6 +1612,12 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
btrfs_mark_buffer_dirty(path->nodes[0]);
btrfs_free_path(path);
+ disk_super = &root->fs_info->super_copy;
+ features = btrfs_super_incompat_flags(disk_super);
+ if (!(features & BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL)) {
+ features |= BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL;
+ btrfs_set_super_incompat_flags(disk_super, features);
+ }
btrfs_end_transaction(trans, root);
return 0;
--
1.5.4.3...
2010 Dec 12
0
[PATCH] Btrfs: pick the correct metadata allocation size on small devices
...1,8 +3253,9 @@ static int should_alloc_chunk(struct btrfs_root *root,
alloc_bytes < div_factor(num_bytes, 8))
return 0;
+ max_chunk_size = min(256 * 1024 * 1024, div_factor(total_rw_bytes, 1));
thresh = btrfs_super_total_bytes(&root->fs_info->super_copy);
- thresh = max_t(u64, 256 * 1024 * 1024, div_factor_fine(thresh, 5));
+ thresh = max_t(u64, max_chunk_size, div_factor_fine(thresh, 5));
if (num_bytes > thresh && sinfo->bytes_used < div_factor(num_bytes, 3))
return 0;
--
Itaru Kitayama &l...
2011 Nov 01
0
[PATCH] Btrfs-progs: change the way mkfs picks raid profiles
...ct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 data_profile,
- u64 metadata_profile, int mixed)
+ int data_profile_opt, u64 metadata_profile,
+ int metadata_profile_opt, int mixed)
{
u64 num_devices = btrfs_super_num_devices(&root->fs_info->super_copy);
u64 allowed;
int ret;
+ /*
+ * Set default profiles according to number of added devices.
+ * For mixed groups defaults are single/single.
+ */
+ if (!metadata_profile_opt && !mixed) {
+ metadata_profile = (num_devices > 1) ?
+ BTRFS_BLOCK_GROUP_RAID1 : BTRFS_BLOCK_GROUP_DU...
2011 Apr 20
4
[PATCH 1/5] Btrfs: fix bh leak on __btrfs_open_devices path
''bh'' is forgot to release if no error is detected
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
fs/btrfs/volumes.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 8b9fb8c..69fc902 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -631,6 +631,7 @@ static int
2013 Mar 26
15
Kernel bug on mismatching generation_v2 in inode.c:835
Dear list members,
In my previous thread at
http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg23333.html
there was a space_cache kernel bug/panic on kernel 3.8. I could
successfully "fix" that with rebuilding the cache. But some files were
missing/corrupted. So I booted a rescue CD with kernel 3.7 and ran
btrfsck --repair, which repaired quite a few things.
After a reboot I
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...s_mod_ref(trans, root, buf, record_parent, 0);
}
static int write_one_cache_group(struct btrfs_trans_handle *trans,
@@ -1224,6 +1346,22 @@ static int update_block_group(struct btr
u64 start;
u64 end;
+ /* block accounting for super block */
+ old_val = btrfs_super_bytes_used(&info->super_copy);
+ if (alloc)
+ old_val += num_bytes;
+ else
+ old_val -= num_bytes;
+ btrfs_set_super_bytes_used(&info->super_copy, old_val);
+
+ /* block accounting for root item */
+ old_val = btrfs_root_used(&root->root_item);
+ if (alloc)
+ old_val += num_bytes;
+ else
+ old_val -= num_byte...
2013 Mar 15
0
[PATCH] Btrfs-progs: add skinny metadata support to progs V3
...c
+++ b/btrfstune.c
@@ -81,11 +81,28 @@ int enable_extrefs_flag(struct btrfs_root *root)
return 0;
}
+int enable_skinny_metadata(struct btrfs_root *root)
+{
+ struct btrfs_trans_handle *trans;
+ struct btrfs_super_block *disk_super;
+ u64 super_flags;
+
+ disk_super = &root->fs_info->super_copy;
+ super_flags = btrfs_super_incompat_flags(disk_super);
+ super_flags |= BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA;
+ trans = btrfs_start_transaction(root, 1);
+ btrfs_set_super_incompat_flags(disk_super, super_flags);
+ btrfs_commit_transaction(trans, root);
+
+ return 0;
+}
+
static void print_usa...
2008 Oct 10
1
[PATCH] fix enospc when there is plenty of space
...needed */
+ if (ins->objectid) {
+ if (!(data & BTRFS_BLOCK_GROUP_DATA))
+ trans->block_group = block_group;
- ins->offset = num_bytes;
- if (last_ptr) {
- *last_ptr = ins->objectid + ins->offset;
- if (*last_ptr ==
- btrfs_super_total_bytes(&root->fs_info->super_copy))
- *last_ptr = 0;
+ if (last_ptr)
+ *last_ptr = ins->objectid + ins->offset;
+ ret = 0;
+ } else if (!ret) {
+ ret = -ENOSPC;
}
- ret = 0;
-error:
+ up_read(&space_info->groups_sem);
return ret;
}
@@ -2397,7 +2337,7 @@ static void dump_space_info(struct btrfs_space_inf...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...(inode)->extent_tree;
+ struct extent_map *em;
struct btrfs_key found_key;
+ u64 cow_start;
+ u64 cur_offset;
+ u64 extent_end;
+ u64 disk_bytenr;
+ int extent_type;
+ int ret;
+ int type;
+ int nocow;
+ int check_prev = 1;
- total_fs_bytes = btrfs_super_total_bytes(&root->fs_info->super_copy);
path = btrfs_alloc_path();
BUG_ON(!path);
trans = btrfs_join_transaction(root, 1);
BUG_ON(!trans);
-again:
- ret = btrfs_lookup_file_extent(NULL, root, path,
- inode->i_ino, start, 0);
- if (ret < 0) {
- err = ret;
- goto out;
- }
-
- if (ret != 0) {
- if (path->slot...
2013 Apr 03
0
[PATCH] Btrfs-progs: add a free space cache checker to fsck
...0]++;
+ }
+
+ btrfs_free_path(path);
+
+ return ret;
+}
+
+static int check_space_cache(struct btrfs_root *root)
+{
+ struct btrfs_block_group_cache *cache;
+ u64 start = BTRFS_SUPER_INFO_OFFSET + BTRFS_SUPER_INFO_SIZE;
+ int ret;
+ int error = 0;
+
+ if (btrfs_super_generation(root->fs_info->super_copy) !=
+ btrfs_super_cache_generation(root->fs_info->super_copy)) {
+ printf("cache and super generation don''t match, space cache "
+ "will be invalidated\n");
+ return 0;
+ }
+
+ while (1) {
+ cache = btrfs_lookup_first_block_group(root->fs_info, s...
2010 Apr 19
0
[PATCH 08/12] Btrfs: Introduce global metadata reservation
...sired value is sum of space used by extent tree,
+ * checksum tree and root tree
+ */
+static u64 calc_global_metadata_size(struct btrfs_fs_info *fs_info)
+{
+ struct btrfs_space_info *sinfo;
+ u64 num_bytes;
+ u64 meta_used;
+ u64 data_used;
+ int csum_size = btrfs_super_csum_size(&fs_info->super_copy);
+#if 0
+ /*
+ * per tree used space accounting can be inaccuracy, so we
+ * can''t rely on it.
+ */
+ spin_lock(&fs_info->extent_root->accounting_lock);
+ num_bytes = btrfs_root_used(&fs_info->extent_root->root_item);
+ spin_unlock(&fs_info->extent_root->a...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
..._callback);
}
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 0e92e57..1718afb 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2786,7 +2786,7 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
}
dir_id = btrfs_super_root_dir(root->fs_info->super_copy);
- di = btrfs_lookup_dir_item(trans, root->fs_info->tree_root, path,
+ di = btrfs_lookup_dir_item(trans, root->fs_info->tree_root, NULL, path,
dir_id, "default", 7, 1);
if (IS_ERR_OR_NULL(di)) {
btrfs_free_path(path);
diff --git a/fs/btrfs/relocation.c b/fs/btrfs...
2010 Mar 22
5
[PATCH 0/5] asynchronous commit, snapshot ponies
Hi everyone,
This patchset is the latest approach I''m using for the Ceph storage daemon to
keep track of which data has safely committed to disk. The basic idea is to
not use the (problematic) user transaction ioctls at all. Instead, the daemon
quiesces its own write requests, initiates an async snapshot, and then
continues.
The snapshot approach is nice because it provides rollback.
2010 Oct 25
14
[PATCH 0/6] Btrfs commit fixes, async subvol operations
Hi Chris,
This is the extent of my current queue of Btrfs snapshot/subvol/commit
stuff. Most of these were posted several months ago. Can be sent
upstream during this merge window? Not having this functionality is
becoming a bit of a roadblock for our efforts to keep the Ceph data in a
consistent state.
These patches are also available from