search for: btrfs_disk_key

Displaying 20 results from an estimated 23 matches for "btrfs_disk_key".

2015 Dec 24
4
[PATCH] btrfs: Fix logical to physical block address mapping
...ruct btrfs_info * const bfs = fs->fs_info; struct btrfs_chunk_map *chunk_map = &bfs->chunk_map; @@ -113,6 +114,22 @@ static void insert_map(struct fs_info *fs, struct btrfs_chunk_map_item *item) chunk_map->cur_length++; } +static inline void insert_map(struct fs_info *fs, struct btrfs_disk_key *key, + struct btrfs_chunk *chunk) +{ + struct btrfs_stripe *stripe = &chunk->stripe; + struct btrfs_stripe *stripe_end = &chunk->stripe + chunk->num_stripes; + struct btrfs_chunk_map_item item; + + item.logical = key->offset; + item.length = chunk->length; + for ( ;...
2013 Aug 29
23
[PATCH] Btrfs: optimize key searches in btrfs_search_slot
...tic int key_search(struct extent_buffer *b, struct btrfs_key *key, + int level, int *prev_cmp, int *slot) +{ + unsigned long eb_offset = 0; + unsigned long len_left = b->len; + char *kaddr = NULL; + unsigned long map_start = 0; + unsigned long map_len = 0; + unsigned long offset; + struct btrfs_disk_key *k = NULL; + struct btrfs_disk_key unaligned; + + if (*prev_cmp != 0) { + *prev_cmp = bin_search(b, key, level, slot); + return *prev_cmp; + } + + if (level == 0) + offset = offsetof(struct btrfs_leaf, items); + else + offset = offsetof(struct btrfs_node, ptrs); + + /* + * Map the entire exten...
2015 Dec 24
0
[PATCH v2] btrfs: Fix logical to physical block address mapping
...ruct btrfs_info * const bfs = fs->fs_info; struct btrfs_chunk_map *chunk_map = &bfs->chunk_map; @@ -113,6 +114,22 @@ static void insert_map(struct fs_info *fs, struct btrfs_chunk_map_item *item) chunk_map->cur_length++; } +static inline void insert_map(struct fs_info *fs, struct btrfs_disk_key *key, + struct btrfs_chunk *chunk) +{ + struct btrfs_stripe *stripe = &chunk->stripe; + struct btrfs_stripe *stripe_end = &chunk->stripe + chunk->num_stripes; + struct btrfs_chunk_map_item item; + + item.logical = key->offset; + item.length = chunk->length; + for ( ;...
2015 Dec 27
0
[PATCH v3] btrfs: Fix logical to physical block address mapping
...ruct btrfs_info * const bfs = fs->fs_info; struct btrfs_chunk_map *chunk_map = &bfs->chunk_map; @@ -113,6 +114,22 @@ static void insert_map(struct fs_info *fs, struct btrfs_chunk_map_item *item) chunk_map->cur_length++; } +static inline void insert_map(struct fs_info *fs, struct btrfs_disk_key *key, + struct btrfs_chunk *chunk) +{ + struct btrfs_stripe *stripe = &chunk->stripe; + struct btrfs_stripe *stripe_end = stripe + chunk->num_stripes; + struct btrfs_chunk_map_item item; + + item.logical = key->offset; + item.length = chunk->length; + for ( ; stripe < str...
2012 May 27
0
[RFC PATCH] Decrease Metadata Fragment Using A Caterpillar Band Method
...eader_cater, struct btrfs_header, + cater_index_factor, 8); static inline int btrfs_header_flag(struct extent_buffer *eb, u64 flag) { @@ -2445,6 +2462,19 @@ struct extent_buffer *btrfs_alloc_free_b struct btrfs_root *root, u32 blocksize, u64 parent, u64 root_objectid, struct btrfs_disk_key *key, int level, + u64 hint, u64 empty_size, int for_cow); +int btrfs_cater_blocks_free(struct btrfs_root *root, u64 start, u64 len, + u8 factor, u8 index); +struct extent_buffer *btrfs_grab_cater_block(struct btrfs_trans_handle *trans, + struct btrfs_root *root, struct extent_buffer *b...
2011 Jan 28
0
[PATCH] ctree code cleanups
...a tree block, it returns -1, but continues - * fixing up the blocks in ram so the tree is consistent. */ -static int fixup_low_keys(struct btrfs_trans_handle *trans, +static void fixup_low_keys(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_disk_key *key, int level) { int i; - int ret = 0; struct extent_buffer *t; for (i = level; i < BTRFS_MAX_LEVEL; i++) { @@ -1910,7 +1891,6 @@ static int fixup_low_keys(struct btrfs_trans_handle *trans, if (tslot != 0) break; } - return ret; } /* @@ -2567,7 +2547,6 @@ static noinline in...
2013 May 07
2
[PATCH] Btrfs: fix passing wrong arg gfp_t to decide the correct allocation mode
...{ int ret; ret = tree_mod_log_insert_root(root->fs_info, root->node, - new_root_node, GFP_NOFS, log_removal); + new_root_node, log_removal); BUG_ON(ret < 0); } @@ -1886,7 +1885,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, struct btrfs_disk_key right_key; btrfs_node_key(right, &right_key, 0); tree_mod_log_set_node_key(root->fs_info, parent, - pslot + 1, 0); + pslot + 1); btrfs_set_node_key(parent, &right_key, pslot + 1); btrfs_mark_buffer_dirty(parent); } @@ -1931,7 +1930,7 @@ static noinline in...
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
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...gs-unstable/ctree.c btrfs-progs-2/ctree.c --- btrfs-progs-unstable/ctree.c 2009-01-08 08:30:09.752081135 +0800 +++ btrfs-progs-2/ctree.c 2009-05-01 14:07:13.000000000 +0800 @@ -85,6 +85,7 @@ int btrfs_copy_root(struct btrfs_trans_h int ret = 0; int level; struct btrfs_root *new_root; + struct btrfs_disk_key disk_key; new_root = kmalloc(sizeof(*new_root), GFP_NOFS); if (!new_root) @@ -98,8 +99,12 @@ int btrfs_copy_root(struct btrfs_trans_h WARN_ON(root->ref_cows && trans->transid != root->last_trans); level = btrfs_header_level(buf); - cow = btrfs_alloc_free_block(trans, ne...
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...44 +#define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL +#define BTRFS_DIR_ITEM_KEY 84 + +/* + * * this is used for both forward and backward root refs + * */ +struct btrfs_root_ref { + __le64 dirid; + __le64 sequence; + __le16 name_len; +} __attribute__ ((__packed__)); + +struct btrfs_disk_key { + __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__));...
2009 Dec 17
0
[PATCH] Btrfs: set a incompat flag when setting default subvol
...re to find diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 81d8378..9070b86 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1563,6 +1563,8 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) struct btrfs_path *path; struct btrfs_key location; struct btrfs_disk_key disk_key; + struct 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...
2013 Jun 04
3
[PATCH] Btrfs: fix broken nocow after balance
Balance will create reloc_root for each fs root, and it''s going to record last_snapshot to filter shared blocks. The side effect of setting last_snapshot is to break nocow attributes of files. So it turns out that checking last_snapshot does not always ensure that a node/leaf/file_extent is shared. That''s why shared node/leaf needs to search extent tree for number of
2014 Sep 16
0
3.14.18 btrfs_set_item_key_safe BUG
On 3.14.18 with a BTRFS partition mounted noatime,autodefrag,compress=lzo, I see the second assertion in btrfs_set_item_key_safe() trip: void btrfs_set_item_key_safe(struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *new_key) { struct btrfs_disk_key disk_key; struct extent_buffer *eb; int slot; eb = path->nodes[0]; slot = path->slots[0]; if (slot > 0) { btrfs_item_key(eb, &disk_key, slot - 1); BUG_ON(comp_keys(&disk_key, new_key) >= 0); }...
2012 Jul 24
1
[PATCH v4] Btrfs: Check INCOMPAT flags on remount and add helper function
...s_set_super_incompat_flags(disk_super, features); + btrfs_set_fs_incompat(root->fs_info, COMPRESS_LZO); } ret = defrag_count; @@ -2761,8 +2756,6 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) struct btrfs_path *path; struct btrfs_key location; struct btrfs_disk_key disk_key; - struct btrfs_super_block *disk_super; - u64 features; u64 objectid = 0; u64 dir_id; @@ -2813,12 +2806,7 @@ 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->...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...btrfs/ctree.h --- 3/fs/btrfs/ctree.h 2008-10-27 16:31:51.000000000 +0800 +++ 4/fs/btrfs/ctree.h 2008-10-27 16:34:27.000000000 +0800 @@ -445,6 +445,7 @@ struct btrfs_root_item { __le64 bytenr; __le64 byte_limit; __le64 bytes_used; + __le64 last_snapshot; __le32 flags; __le32 refs; struct btrfs_disk_key drop_progress; @@ -1375,6 +1376,8 @@ BTRFS_SETGET_STACK_FUNCS(root_refs, stru BTRFS_SETGET_STACK_FUNCS(root_flags, struct 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_li...
2011 Oct 04
68
[patch 00/65] Error handling patchset v3
Hi all - Here''s my current error handling patchset, against 3.1-rc8. Almost all of this patchset is preparing for actual error handling. Before we start in on that work, I''m trying to reduce the surface we need to worry about. It turns out that there is a ton of code that returns an error code but never actually reports an error. The patchset has grown to 65 patches. 46 of them
2012 Aug 01
17
[PATCH] add crtime to the snapshot list
From: Anand <anand.jain@oracle.com> This patch adds creation-time to the snapshot list display, which would help user to better manage the snapshots when number of snapshots grow substantially. This patch is developed and on top of the send/receive btrfs and btrfs-progs repo at git://github.com/ablock84/linux-btrfs.git (send-v2) git://github.com/ablock84/btrfs-progs.git (send-v2)
2013 Apr 03
0
[PATCH] Btrfs-progs: add a free space cache checker to fsck
...{ /* additional stripes go here */ } __attribute__ ((__packed__)); +#define BTRFS_FREE_SPACE_EXTENT 1 +#define BTRFS_FREE_SPACE_BITMAP 2 + +struct btrfs_free_space_entry { + __le64 offset; + __le64 bytes; + u8 type; +} __attribute__ ((__packed__)); + struct btrfs_free_space_header { struct btrfs_disk_key location; __le64 generation; @@ -866,6 +876,7 @@ struct btrfs_block_group_cache { struct btrfs_key key; struct btrfs_block_group_item item; struct btrfs_space_info *space_info; + struct btrfs_free_space_ctl *free_space_ctl; u64 pinned; u64 flags; int cached; @@ -2055,6 +2066,9 @@ int...
2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
...f (root == root->fs_info->tree_root || !index) { ret = 0; goto out; } @@ -179,6 +179,87 @@ out: if (ret2) return ret2; return 0; +} + +int btrfs_insert_orphan_dir_item(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + struct btrfs_key *location) +{ + struct btrfs_disk_key disk_key; + struct btrfs_dir_item *dir_item; + struct btrfs_path *path; + struct btrfs_key key; + struct extent_buffer *leaf; + unsigned long name_ptr; + const char *name = ".orphandir"; + int name_len = strlen(name); + int ret = 0; + u32 data_size; + + key.objectid = root->inode->i...
2013 Nov 12
0
[PATCH] Btrfs: incompatible format change to remove hole extents V4
...fs_root *root, * This may release the path, and so you may lose any locks held at the * time you call it. */ -static int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_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 <&l...