search for: btrfs_super_block

Displaying 20 results from an estimated 33 matches for "btrfs_super_block".

2010 Aug 13
1
[PATCH] btrfs: avoid duplications by moving the static int array from header to c file
...2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index c3df14c..3a89207 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -24,6 +24,15 @@ #include "print-tree.h" #include "locking.h" +int btrfs_super_csum_size(struct btrfs_super_block *s) +{ + static const int btrfs_csum_sizes[] = { 4, 0 }; + + int t = btrfs_super_csum_type(s); + BUG_ON(t >= ARRAY_SIZE(btrfs_csum_sizes)); + return btrfs_csum_sizes[t]; +} + static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, int l...
2012 Mar 20
13
[PATCH 0 of 3 v2] PV-GRUB: add support for ext4 and btrfs
Hi, The following patches add support for ext4 and btrfs to PV-GRUB. These patches are taken nearly verbatim from those provided by Fedora and Gentoo. We''ve been using these patches for the PV-GRUB images available in EC2 for some time now with no problems. Changes from v1: - Makefile has been changed to check the exit code from patch - The btrfs patch has been rebased to apply
2010 Apr 03
1
[PATCH] btrfs support
...TRFS_FS_H + +/* Extracted from fs/btrfs/ctree.h and shortened a bit */ + +#define BTRFS_MAGIC "_BHRfS_M" + +#define BTRFS_CSUM_SIZE 32 +#define BTRFS_FSID_SIZE 16 + +/* + * the super block basically lists the main trees of the FS + * it currently lacks any block count etc etc + */ +struct btrfs_super_block { + __u8 csum[BTRFS_CSUM_SIZE]; + /* the first 4 fields must match struct btrfs_header */ + __u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */ + __le64 bytenr; /* this block number */ + __le64 flags; + + /* allowed to be different from the btrfs_header f...
2012 Jul 24
1
[PATCH v4] Btrfs: Check INCOMPAT flags on remount and add helper function
...*root, const char *function, unsigned int line, int errno); +#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) \...
2009 Dec 17
0
[PATCH] Btrfs: set a incompat flag when setting default subvol
...<josef@redhat.com> --- fs/btrfs/ctree.h | 4 +++- fs/btrfs/ioctl.c | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 917211b..8c57180 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -370,11 +370,13 @@ struct btrfs_super_block { * ones specified below then we will fail to mount */ #define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0) +#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (2ULL << 0) #define BTRFS_FEATURE_COMPAT_SUPP 0ULL #define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL #define BTRFS_FEATURE_I...
2013 Oct 22
0
[PATCH] Btrfs-progs: add support for the no holes incompat flag
...fs_incompat(root->fs_info, + BTRFS_FEATURE_INCOMPAT_NO_HOLES); fprintf(stderr, "checking fs roots\n"); ret = check_fs_roots(root, &root_cache); if (ret) diff --git a/ctree.h b/ctree.h index 2117374..761987a 100644 --- a/ctree.h +++ b/ctree.h @@ -470,7 +470,7 @@ struct btrfs_super_block { #define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) - +#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) #define BTRFS_FEATURE_COMPAT_SUPP 0ULL #de...
2013 Feb 23
4
Changing node & leaf size on live partition.
Hi, Question is pretty simple: "How to change node size and leaf size on previously created partition?" Now, I know what most people will say: "you should''ve be smarter while typing mkfs.btrfs". Well, I''m intending to convert in place ext4 partition but there seems to be no option for leaf and node size in this tool. If it''s not possible I guess
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
2013 Apr 11
2
[PATCH 2/2] Btrfs: use a lock to protect incompat/compat flag of the super block
...are updated. + * + * 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 &am...
2013 Jun 25
3
[PATCH] btrfs-progs: avoid memory leak in btrfs_close_devices
Three kind of structures need to be freed on close: * All struct btrfs_device managed by fs_devices * The name field for each struct btrfs_device * The above items for seed_devices Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com> --- volumes.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/volumes.c b/volumes.c index
2013 Mar 15
0
[PATCH] Btrfs-progs: add skinny metadata support to progs V3
...ots[0], diff --git a/btrfstune.c b/btrfstune.c index 6e68bda..74ee8eb 100644 --- a/btrfstune.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_flag...
2010 Nov 16
2
[Btrfs-Progs] Update for lzo support
...ress) + if (compress_type) { range.flags |= BTRFS_DEFRAG_RANGE_COMPRESS; + range.compress_type = compress_type; + } if (flush) range.flags |= BTRFS_DEFRAG_RANGE_START_IO; diff --git a/ctree.h b/ctree.h index b79e238..4ad7f7d 100644 --- a/ctree.h +++ b/ctree.h @@ -350,13 +350,15 @@ struct btrfs_super_block { * ones specified below then we will fail to mount */ #define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0) -#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (2ULL << 0) +#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1) +#define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (...
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
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...__le64 objectid; + u8 type; + __le64 offset; +} __attribute__ ((__packed__)); + +struct btrfs_dir_item { + struct btrfs_disk_key location; + __le64 transid; + __le16 data_len; + __le16 name_len; + u8 type; +} __attribute__ ((__packed__)); + struct btrfs_super_block { unsigned char csum[BTRFS_CSUM_SIZE]; /* the first 3 fields must match struct btrfs_header */ @@ -19,4 +56,72 @@ struct btrfs_super_block { u64 magic; } __attribute__ ((__packed__)); + +#define BTRFS_IOCTL_MAGIC 0x94 +#define BTRFS_VOL_NAME_MAX 255 +#define BTRFS_PATH_NAME_MAX 4087 + +str...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...truct btrfs_root_item, flags, 32); BTRFS_SETGET_STACK_FUNCS(root_used, struct btrfs_root_item, bytes_used, 64); BTRFS_SETGET_STACK_FUNCS(root_limit, struct btrfs_root_item, byte_limit, 64); +BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item, + last_snapshot, 64); /* struct btrfs_super_block */ BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64); @@ -1504,9 +1507,8 @@ int btrfs_update_pinned_extents(struct b u64 bytenr, u64 num, int pin); int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *leaf); -...
2011 Aug 23
40
[PATCH 00/21] [RFC] Btrfs: restriper
Hello, This patch series adds an initial implementation of restriper (it''s a clever name for relocation framework that allows to do selective profile changing and selective balancing with some goodies like pausing/resuming and reporting progress to the user. Profile changing is global (per-FS) so far, per-subvolume profiles require some discussion and can be implemented in future.
2013 May 16
0
[PATCH] btrfs-progs: mkfs: add -O option to specify fs features
...e bit here + */ if (mixed) - flags |= BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS; - - btrfs_set_super_incompat_flags(super, flags); + features |= BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS; if ((data_profile | metadata_profile) & (BTRFS_BLOCK_GROUP_RAID5 | BTRFS_BLOCK_GROUP_RAID6)) { - struct btrfs_super_block *super = root->fs_info->super_copy; - u64 flags = btrfs_super_incompat_flags(super); - - flags |= BTRFS_FEATURE_INCOMPAT_RAID56; - btrfs_set_super_incompat_flags(super, flags); - printf("Setting RAID5/6 feature flag\n"); + features |= BTRFS_FEATURE_INCOMPAT_RAID56; } + proc...
2013 Nov 12
0
[PATCH] Btrfs: incompatible format change to remove hole extents V4
...fs_path *path) +int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path) { struct btrfs_key key; struct btrfs_disk_key found_key; diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 9f5e1cf..0484a31 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -521,6 +521,7 @@ struct btrfs_super_block { #define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) +#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) #define BTRFS_FEATURE_COMPAT_SUPP 0ULL #defi...
2008 Jan 07
1
[PATCH]Add rollback support for the converter
...1); - if (ret) - goto fail; - ret = btrfs_commit_transaction(trans, root); - free_extent_buffer(old_eb); - BUG_ON(ret); +static int migrate_super_block(int fd, u64 old_bytenr, u32 sectorsize) +{ + int ret; + char *buf; + u64 bytenr; + u32 crc = ~(u32)0; + u32 len = 512 - BTRFS_CSUM_SIZE; + struct btrfs_super_block *super; + + ret = fsync(fd); + if (ret) + goto fail; + + BUG_ON(sectorsize < sizeof(super)); + buf = malloc(sectorsize); + if (!buf) + return -ENOMEM; + ret = pread(fd, buf, sectorsize, old_bytenr); + if (ret != sectorsize) + goto fail; + + super = (struct btrfs_super_block *)buf; + BUG_ON(bt...
2011 Jun 30
9
btrfs-progs: integration branch updated
After a reorganisation of patches, and sending a bunch of them to Chris, I''ve also updated the integration branch to match that. It''s available from: http://git.darksatanic.net/repo/btrfs-progs-unstable.git/ integration-20110630 The shortlog of 17 patches in this branch beyond the ones I''ve sent to Chris is below. Hugo. Andreas Philipp (1): print parent