diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-18 19:50:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-18 19:50:55 -0400 |
commit | 441f4058a04b2943685ff94e0f5f1992b0b3649e (patch) | |
tree | 80a61f6dddcf7d5831a8bd3771ffa2b430af3935 /fs/btrfs/disk-io.c | |
parent | 7c34691abe23741bfc7d2514efd5a39f0e0ecb06 (diff) | |
parent | 8ad6fcab564c5bc956bdc3dfa440ab152b6e780f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (30 commits)
Btrfs: fix the inode ref searches done by btrfs_search_path_in_tree
Btrfs: allow treeid==0 in the inode lookup ioctl
Btrfs: return keys for large items to the search ioctl
Btrfs: fix key checks and advance in the search ioctl
Btrfs: buffer results in the space_info ioctl
Btrfs: use __u64 types in ioctl.h
Btrfs: fix search_ioctl key advance
Btrfs: fix gfp flags masking in the compression code
Btrfs: don't look at bio flags after submit_bio
btrfs: using btrfs_stack_device_id() get devid
btrfs: use memparse
Btrfs: add a "df" ioctl for btrfs
Btrfs: cache the extent state everywhere we possibly can V2
Btrfs: cache ordered extent when completing io
Btrfs: cache extent state in find_delalloc_range
Btrfs: change the ordered tree to use a spinlock instead of a mutex
Btrfs: finish read pages in the order they are submitted
btrfs: fix btrfs_mkdir goto for no free objectids
Btrfs: flush data on snapshot creation
Btrfs: make df be a little bit more understandable
...
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0427183e3e05..11d0ad30e203 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -263,13 +263,15 @@ static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf, | |||
263 | static int verify_parent_transid(struct extent_io_tree *io_tree, | 263 | static int verify_parent_transid(struct extent_io_tree *io_tree, |
264 | struct extent_buffer *eb, u64 parent_transid) | 264 | struct extent_buffer *eb, u64 parent_transid) |
265 | { | 265 | { |
266 | struct extent_state *cached_state = NULL; | ||
266 | int ret; | 267 | int ret; |
267 | 268 | ||
268 | if (!parent_transid || btrfs_header_generation(eb) == parent_transid) | 269 | if (!parent_transid || btrfs_header_generation(eb) == parent_transid) |
269 | return 0; | 270 | return 0; |
270 | 271 | ||
271 | lock_extent(io_tree, eb->start, eb->start + eb->len - 1, GFP_NOFS); | 272 | lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1, |
272 | if (extent_buffer_uptodate(io_tree, eb) && | 273 | 0, &cached_state, GFP_NOFS); |
274 | if (extent_buffer_uptodate(io_tree, eb, cached_state) && | ||
273 | btrfs_header_generation(eb) == parent_transid) { | 275 | btrfs_header_generation(eb) == parent_transid) { |
274 | ret = 0; | 276 | ret = 0; |
275 | goto out; | 277 | goto out; |
@@ -282,10 +284,10 @@ static int verify_parent_transid(struct extent_io_tree *io_tree, | |||
282 | (unsigned long long)btrfs_header_generation(eb)); | 284 | (unsigned long long)btrfs_header_generation(eb)); |
283 | } | 285 | } |
284 | ret = 1; | 286 | ret = 1; |
285 | clear_extent_buffer_uptodate(io_tree, eb); | 287 | clear_extent_buffer_uptodate(io_tree, eb, &cached_state); |
286 | out: | 288 | out: |
287 | unlock_extent(io_tree, eb->start, eb->start + eb->len - 1, | 289 | unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1, |
288 | GFP_NOFS); | 290 | &cached_state, GFP_NOFS); |
289 | return ret; | 291 | return ret; |
290 | } | 292 | } |
291 | 293 | ||
@@ -2497,7 +2499,8 @@ int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid) | |||
2497 | int ret; | 2499 | int ret; |
2498 | struct inode *btree_inode = buf->first_page->mapping->host; | 2500 | struct inode *btree_inode = buf->first_page->mapping->host; |
2499 | 2501 | ||
2500 | ret = extent_buffer_uptodate(&BTRFS_I(btree_inode)->io_tree, buf); | 2502 | ret = extent_buffer_uptodate(&BTRFS_I(btree_inode)->io_tree, buf, |
2503 | NULL); | ||
2501 | if (!ret) | 2504 | if (!ret) |
2502 | return ret; | 2505 | return ret; |
2503 | 2506 | ||