search for: btrfs_file_extent_item

Displaying 20 results from an estimated 25 matches for "btrfs_file_extent_item".

2009 Nov 12
0
[PATCH 03/12] Btrfs: Rewrite btrfs_drop_extents
...t drop_cache) { - u64 extent_end = 0; - u64 search_start = start; - u64 ram_bytes = 0; - u64 disk_bytenr = 0; - u64 orig_locked_end = locked_end; - u8 compression; - u8 encryption; - u16 other_encoding = 0; + struct btrfs_root *root = BTRFS_I(inode)->root; struct extent_buffer *leaf; - struct btrfs_file_extent_item *extent; + struct btrfs_file_extent_item *fi; struct btrfs_path *path; struct btrfs_key key; - struct btrfs_file_extent_item old; - int keep; - int slot; - int bookend; - int found_type = 0; - int found_extent; - int found_inline; + struct btrfs_key new_key; + u64 search_start = start; + u64 di...
2011 Jan 06
3
Offline Deduplication for Btrfs V2
Just a quick update, I''ve dropped the hashing stuff in favor of doing a memcmp in the kernel to make sure the data is still the same. The thing that takes a while is reading the data up from disk, so doing a memcmp of the entire buffer isn''t that big of a deal, not to mention there''s a possiblity for malicious users if there is a problem with the hashing algorithms we
2013 Aug 02
2
[PATCH] Btrfs: allow compressed extents to be merged during defragment
...s(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 55dda87..a7aeecc 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2229,7 +2229,7 @@ static noinline bool record_extent_backrefs(struct btrfs_path *path, static int relink_is_mergable(struct extent_buffer *leaf, struct btrfs_file_extent_item *fi, - u64 disk_bytenr) + u64 disk_bytenr, u8 compress) { if (btrfs_file_extent_disk_bytenr(leaf, fi) != disk_bytenr) return 0; @@ -2237,8 +2237,10 @@ static int relink_is_mergable(struct extent_buffer *leaf, if (btrfs_file_extent_type(leaf, fi) != BTRFS_FILE_EXTENT_REG)...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...ret = 0; -out: - btrfs_free_path(path); - return ret; -} - -int btrfs_cross_ref_exists(struct btrfs_trans_handle *trans, - struct btrfs_root *root, - struct btrfs_key *key, u64 bytenr) -{ - struct btrfs_root *old_root; - struct btrfs_path *path = NULL; - struct extent_buffer *eb; - struct btrfs_file_extent_item *item; - u64 ref_generation; - u64 min_generation; - u64 extent_start; - u32 ref_count; - int level; - int ret; - - BUG_ON(trans == NULL); - BUG_ON(key->type != BTRFS_EXTENT_DATA_KEY); - ret = get_reference_status(root, bytenr, 0, key->objectid, - &min_generation, &ref_count); -...
2013 Nov 12
0
[PATCH] Btrfs: incompatible format change to remove hole extents V4
..._or_clone(struct send_ctx *sctx, struct btrfs_path *path, struct btrfs_key *key, @@ -4003,6 +4048,84 @@ out: return ret; } +static int get_last_extent(struct send_ctx *sctx, u64 offset) +{ + struct btrfs_path *path; + struct btrfs_root *root = sctx->send_root; + struct btrfs_file_extent_item *fi; + struct btrfs_key key; + u64 extent_end; + u8 type; + int ret; + + path = alloc_path_for_send(); + if (!path) + return -ENOMEM; + + sctx->cur_inode_last_extent = 0; + + key.objectid = sctx->cur_ino; + key.type = BTRFS_EXTENT_DATA_KEY; + key.offset = offset; + ret = btrfs_search_slot_fo...
2012 Sep 17
13
[PATCH 1/2 v3] Btrfs: use flag EXTENT_DEFRAG for snapshot-aware defrag
We''re going to use this flag EXTENT_DEFRAG to indicate which range belongs to defragment so that we can implement snapshow-aware defrag: We set the EXTENT_DEFRAG flag when dirtying the extents that need defragmented, so later on writeback thread can differentiate between normal writeback and writeback started by defragmentation. This patch is used for the latter one. Originally patch
2010 Dec 11
1
[RFC] Improve btrfs subvolume find-new command
...d, sh->objectid, + &cache_get_full_path_dirid, + &cache_get_full_path_dir_name); + cache_get_full_path_full_name = name; + cache_get_full_path_ino = sh->objectid; + } + + return name; +} + +static int print_one_extent(struct btrfs_ioctl_search_header *sh, struct btrfs_file_extent_item *item, - u64 found_gen, u64 *cache_dirid, - char **cache_dir_name, u64 *cache_ino, - char **cache_full_name) + u64 found_gen) { u64 len = 0; u64 disk_start = 0; @@ -669,22 +701,6 @@ static int print_one_extent(int fd, struct btrfs_ioctl_search_header *sh, u8 type;...
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 Jul 26
6
[PATCH] Btrfs: compressed file size ioctl
...+ } + leaf = path->nodes[0]; + slot = path->slots[0]; + + btrfs_item_key_to_cpu(leaf, &key, slot); + if (btrfs_key_type(&key) > BTRFS_EXTENT_DATA_KEY || + key.objectid != inode->i_ino) + break; + + if (btrfs_key_type(&key) == BTRFS_EXTENT_DATA_KEY) { + struct btrfs_file_extent_item *extent; + int type; + u64 datal = 0; + + extent = btrfs_item_ptr(leaf, slot, + struct btrfs_file_extent_item); + type = btrfs_file_extent_type(leaf, extent); + if (type == BTRFS_FILE_EXTENT_REG) { + datal = btrfs_file_extent_num_bytes(leaf, + extent); + compressed_s...
2012 Oct 01
1
[RFC] [PATCH] Btrfs: rework can_nocow_odirect
..._handle *trans, - struct inode *inode, u64 offset, u64 len) + struct inode *inode, + struct extent_map *em, u64 offset, + u64 len) { - struct btrfs_path *path; - int ret; - struct extent_buffer *leaf; struct btrfs_root *root = BTRFS_I(inode)->root; - struct btrfs_file_extent_item *fi; - struct btrfs_key key; u64 disk_bytenr; u64 backref_offset; u64 extent_end; u64 num_bytes; - int slot; - int found_type; - - path = btrfs_alloc_path(); - if (!path) - return -ENOMEM; - - ret = btrfs_lookup_file_extent(trans, root, path, btrfs_ino(inode), - offset, 0); - if...
2011 Jun 21
19
[GIT PULL v3] Btrfs: improve write ahead log with sub transaction
I''ve been working to try to improve the write-ahead log''s performance, and I found that the bottleneck addresses in the checksum items, especially when we want to make a random write on a large file, e.g a 4G file. Then a idea for this suggested by Chris is to use sub transaction ids and just to log the part of inode that had changed since either the last log commit or the last
2008 Jan 07
1
[PATCH]Add rollback support for the converter
...1, EXTENT_DIRTY, 0)) @@ -167,7 +172,7 @@ struct dir_iterate_data { struct btrfs_root *root; struct btrfs_inode_item *inode; u64 objectid; - u32 parent; + u64 parent; int errcode; }; @@ -281,10 +286,9 @@ fail: } /* - * record a single file extent. do all required works: - * 1. insert a btrfs_file_extent_item into fs tree. - * 2. compute checksum and insert btrfs_csum_item into fs tree. - * 3. insert extent item and extent backref into extent tree. + * Record a file extent. Do all the required works, such as inserting + * file extent item, inserting extent item and backref item into extent + * tree and...
2009 Jan 21
0
[PATCH] Progs: update convert for uninitialized block groups
...t = (num_refs > 0) ? -1 : 0; @@ -2537,6 +2559,7 @@ int do_rollback(const char *devname, int { int fd; int ret; + int i; struct btrfs_root *root; struct btrfs_root *ext2_root; struct btrfs_root *chunk_root; @@ -2654,6 +2677,10 @@ int do_rollback(const char *devname, int struct btrfs_file_extent_item); if (btrfs_file_extent_type(leaf, fi) != BTRFS_FILE_EXTENT_REG) break; + if (btrfs_file_extent_compression(leaf, fi) || + btrfs_file_extent_encryption(leaf, fi) || + btrfs_file_extent_other_encoding(leaf, fi)) + break; bytenr = btrfs_file_extent_disk_bytenr(leaf, fi); /...
2013 Oct 16
0
[PATCH] Btrfs: add tests for btrfs_get_extent V2
...+ } + if (root->node) + free_extent_buffer(root->node); + kfree(root); +} + +static void insert_extent(struct btrfs_root *root, u64 start, u64 len, + u64 ram_bytes, u64 offset, u64 disk_bytenr, + u64 disk_len, u32 type, u8 compression, int slot) +{ + struct btrfs_path path; + struct btrfs_file_extent_item *fi; + struct extent_buffer *leaf = root->node; + struct btrfs_key key; + u32 value_len = sizeof(struct btrfs_file_extent_item); + + if (type == BTRFS_FILE_EXTENT_INLINE) + value_len += len; + memset(&path, 0, sizeof(path)); + + path.nodes[0] = leaf; + path.slots[0] = slot; + + key.objectid...
2012 Apr 12
2
Details about compression and extents
Hello, I''m currently trying to understand how compression in btrfs works. I could not find any detailed description about it. So here are my questions. 1. How is decided what to compress and what not? After a fast test with a 2g image file, I''ve looked into the extents of that file with find-new and it turned out that only some of the first extents were compressed. The file was
2008 Sep 25
0
[PATCH 2/4] Add shared reference cache
...xtent-tree.c Thu Sep 25 16:00:36 2008 +0800 +++ b/extent-tree.c Thu Sep 25 16:02:11 2008 +0800 @@ -1091,15 +1091,25 @@ int btrfs_cache_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *buf, u32 nr_extents) { - u32 nritems; struct btrfs_key key; struct btrfs_file_extent_item *fi; - int i; - int level; - int ret = 0; + u64 root_gen; + u32 nritems; + int i; + int level; + int ret = 0; + int shared = 0; if (!root->ref_cows) return 0; + + if (root->root_key.objectid != BTRFS_TREE_RELOC_OBJECTID) { + shared = 0; + root_gen = root->root_key.offset; + } else...
2011 Jan 05
52
Offline Deduplication for Btrfs
Here are patches to do offline deduplication for Btrfs. It works well for the cases it''s expected to, I''m looking for feedback on the ioctl interface and such, I''m well aware there are missing features for the userspace app (like being able to set a different blocksize). If this interface is acceptable I will flesh out the userspace app a little more, but I believe the
2011 Sep 18
5
Inefficient storing of ISO images with compress=lzo
I''ve noticed that: - with x86-64 Fedora 15 DVD install images: - du -sh <ROOT VOLUME> was 36 GB - btrfs df | grep -i data have shown over 40 GB used - without - du -sh <ROOT VOLUME> is 34 GB - btrfs df | grep -i data have shown less then 34 GB used It seems that iso files are considered compressable while they may not be (and penalty is severe - 3x). Regards
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...struct btrfs_root *root, + struct extent_buffer *buf, + int record_parent, int inc) { u64 bytenr; + u64 num_bytes; + u64 parent; u64 ref_root; - u64 orig_root; - u64 ref_generation; - u64 orig_generation; u32 nritems; - u32 nr_file_extents = 0; struct btrfs_key key; struct btrfs_file_extent_item *fi; int i; int level; int ret = 0; int faili = 0; - int (*process_func)(struct btrfs_trans_handle *, struct btrfs_root *, - u64, u64, u64, u64, u64, u64, u64, u64); + int (*process_func)(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + u64, u64, u64, u64, u6...
2013 Apr 03
0
[PATCH] Btrfs-progs: add a free space cache checker to fsck
...set(io_ctl->cur, 0, CACHE_SECTORSIZE); +} + +static void io_ctl_drop_pages(struct io_ctl *io_ctl) +{ + io_ctl_unmap_page(io_ctl); +} + +static int io_ctl_prepare_pages(struct io_ctl *io_ctl, struct btrfs_root *root, + struct btrfs_path *path, u64 ino) +{ + struct extent_buffer *leaf; + struct btrfs_file_extent_item *fi; + struct btrfs_key key; + u64 bytenr, len; + u64 total_read = 0; + int ret = 0; + + key.objectid = ino; + key.type = BTRFS_EXTENT_DATA_KEY; + key.offset = 0; + + ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); + if (ret) { + printf("Couldn''t find file extent item for...