diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-03 03:14:05 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-03 03:14:05 -0400 |
| commit | ed8f37370d83e695c0a4fa5d5fc7a83ecb947526 (patch) | |
| tree | 2e57247c609a495b31892b2d05ea52e35556ab60 | |
| parent | a6b11f53388973d99c4a357c22b19753b424e73c (diff) | |
| parent | 0d10ee2e6deb5c8409ae65b970846344897d5e4e (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (31 commits)
Btrfs: don't call writepages from within write_full_page
Btrfs: Remove unused variable 'last_index' in file.c
Btrfs: clean up for find_first_extent_bit()
Btrfs: clean up for wait_extent_bit()
Btrfs: clean up for insert_state()
Btrfs: remove unused members from struct extent_state
Btrfs: clean up code for merging extent maps
Btrfs: clean up code for extent_map lookup
Btrfs: clean up search_extent_mapping()
Btrfs: remove redundant code for dir item lookup
Btrfs: make acl functions really no-op if acl is not enabled
Btrfs: remove remaining ref-cache code
Btrfs: remove a BUG_ON() in btrfs_commit_transaction()
Btrfs: use wait_event()
Btrfs: check the nodatasum flag when writing compressed files
Btrfs: copy string correctly in INO_LOOKUP ioctl
Btrfs: don't print the leaf if we had an error
btrfs: make btrfs_set_root_node void
Btrfs: fix oops while writing data to SSD partitions
Btrfs: Protect the readonly flag of block group
...
Fix up trivial conflicts (due to acl and writeback cleanups) in
- fs/btrfs/acl.c
- fs/btrfs/ctree.h
- fs/btrfs/extent_io.c
| -rw-r--r-- | fs/btrfs/Makefile | 4 | ||||
| -rw-r--r-- | fs/btrfs/acl.c | 17 | ||||
| -rw-r--r-- | fs/btrfs/compression.c | 14 | ||||
| -rw-r--r-- | fs/btrfs/ctree.h | 30 | ||||
| -rw-r--r-- | fs/btrfs/dir-item.c | 30 | ||||
| -rw-r--r-- | fs/btrfs/extent-tree.c | 45 | ||||
| -rw-r--r-- | fs/btrfs/extent_io.c | 139 | ||||
| -rw-r--r-- | fs/btrfs/extent_io.h | 20 | ||||
| -rw-r--r-- | fs/btrfs/extent_map.c | 155 | ||||
| -rw-r--r-- | fs/btrfs/file-item.c | 7 | ||||
| -rw-r--r-- | fs/btrfs/file.c | 21 | ||||
| -rw-r--r-- | fs/btrfs/inode.c | 98 | ||||
| -rw-r--r-- | fs/btrfs/ioctl.c | 3 | ||||
| -rw-r--r-- | fs/btrfs/ref-cache.c | 68 | ||||
| -rw-r--r-- | fs/btrfs/ref-cache.h | 52 | ||||
| -rw-r--r-- | fs/btrfs/root-tree.c | 5 | ||||
| -rw-r--r-- | fs/btrfs/transaction.c | 65 | ||||
| -rw-r--r-- | fs/btrfs/tree-log.c | 12 | ||||
| -rw-r--r-- | fs/btrfs/volumes.c | 12 |
19 files changed, 269 insertions, 528 deletions
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile index 9b72dcf1cd25..40e6ac08c21f 100644 --- a/fs/btrfs/Makefile +++ b/fs/btrfs/Makefile | |||
| @@ -6,5 +6,7 @@ btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \ | |||
| 6 | transaction.o inode.o file.o tree-defrag.o \ | 6 | transaction.o inode.o file.o tree-defrag.o \ |
| 7 | extent_map.o sysfs.o struct-funcs.o xattr.o ordered-data.o \ | 7 | extent_map.o sysfs.o struct-funcs.o xattr.o ordered-data.o \ |
| 8 | extent_io.o volumes.o async-thread.o ioctl.o locking.o orphan.o \ | 8 | extent_io.o volumes.o async-thread.o ioctl.o locking.o orphan.o \ |
| 9 | export.o tree-log.o acl.o free-space-cache.o zlib.o lzo.o \ | 9 | export.o tree-log.o free-space-cache.o zlib.o lzo.o \ |
| 10 | compression.o delayed-ref.o relocation.o delayed-inode.o scrub.o | 10 | compression.o delayed-ref.o relocation.o delayed-inode.o scrub.o |
| 11 | |||
| 12 | btrfs-$(CONFIG_BTRFS_FS_POSIX_ACL) += acl.o | ||
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 4cc5c0164ed6..eb159aaa5a11 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
| @@ -28,8 +28,6 @@ | |||
| 28 | #include "btrfs_inode.h" | 28 | #include "btrfs_inode.h" |
| 29 | #include "xattr.h" | 29 | #include "xattr.h" |
| 30 | 30 | ||
| 31 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL | ||
| 32 | |||
| 33 | struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | 31 | struct posix_acl *btrfs_get_acl(struct inode *inode, int type) |
| 34 | { | 32 | { |
| 35 | int size; | 33 | int size; |
| @@ -276,18 +274,3 @@ const struct xattr_handler btrfs_xattr_acl_access_handler = { | |||
| 276 | .get = btrfs_xattr_acl_get, | 274 | .get = btrfs_xattr_acl_get, |
| 277 | .set = btrfs_xattr_acl_set, | 275 | .set = btrfs_xattr_acl_set, |
| 278 | }; | 276 | }; |
| 279 | |||
| 280 | #else /* CONFIG_BTRFS_FS_POSIX_ACL */ | ||
| 281 | |||
| 282 | int btrfs_acl_chmod(struct inode *inode) | ||
| 283 | { | ||
| 284 | return 0; | ||
| 285 | } | ||
| 286 | |||
| 287 | int btrfs_init_acl(struct btrfs_trans_handle *trans, | ||
| 288 | struct inode *inode, struct inode *dir) | ||
| 289 | { | ||
| 290 | return 0; | ||
| 291 | } | ||
| 292 | |||
| 293 | #endif /* CONFIG_BTRFS_FS_POSIX_ACL */ | ||
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index bfe42b03eaf9..8ec5d86f1734 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
| @@ -338,6 +338,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
| 338 | u64 first_byte = disk_start; | 338 | u64 first_byte = disk_start; |
| 339 | struct block_device *bdev; | 339 | struct block_device *bdev; |
| 340 | int ret; | 340 | int ret; |
| 341 | int skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; | ||
| 341 | 342 | ||
| 342 | WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1)); | 343 | WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1)); |
| 343 | cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS); | 344 | cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS); |
| @@ -392,8 +393,11 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
| 392 | ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0); | 393 | ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0); |
| 393 | BUG_ON(ret); | 394 | BUG_ON(ret); |
| 394 | 395 | ||
| 395 | ret = btrfs_csum_one_bio(root, inode, bio, start, 1); | 396 | if (!skip_sum) { |
| 396 | BUG_ON(ret); | 397 | ret = btrfs_csum_one_bio(root, inode, bio, |
| 398 | start, 1); | ||
| 399 | BUG_ON(ret); | ||
| 400 | } | ||
| 397 | 401 | ||
| 398 | ret = btrfs_map_bio(root, WRITE, bio, 0, 1); | 402 | ret = btrfs_map_bio(root, WRITE, bio, 0, 1); |
| 399 | BUG_ON(ret); | 403 | BUG_ON(ret); |
| @@ -418,8 +422,10 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
| 418 | ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0); | 422 | ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0); |
| 419 | BUG_ON(ret); | 423 | BUG_ON(ret); |
| 420 | 424 | ||
| 421 | ret = btrfs_csum_one_bio(root, inode, bio, start, 1); | 425 | if (!skip_sum) { |
| 422 | BUG_ON(ret); | 426 | ret = btrfs_csum_one_bio(root, inode, bio, start, 1); |
| 427 | BUG_ON(ret); | ||
| 428 | } | ||
| 423 | 429 | ||
| 424 | ret = btrfs_map_bio(root, WRITE, bio, 0, 1); | 430 | ret = btrfs_map_bio(root, WRITE, bio, 0, 1); |
| 425 | BUG_ON(ret); | 431 | BUG_ON(ret); |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 365c4e1dde04..0469263e327e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
| @@ -2406,8 +2406,8 @@ int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct | |||
| 2406 | btrfs_root_item *item, struct btrfs_key *key); | 2406 | btrfs_root_item *item, struct btrfs_key *key); |
| 2407 | int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); | 2407 | int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); |
| 2408 | int btrfs_find_orphan_roots(struct btrfs_root *tree_root); | 2408 | int btrfs_find_orphan_roots(struct btrfs_root *tree_root); |
| 2409 | int btrfs_set_root_node(struct btrfs_root_item *item, | 2409 | void btrfs_set_root_node(struct btrfs_root_item *item, |
| 2410 | struct extent_buffer *node); | 2410 | struct extent_buffer *node); |
| 2411 | void btrfs_check_and_init_root_item(struct btrfs_root_item *item); | 2411 | void btrfs_check_and_init_root_item(struct btrfs_root_item *item); |
| 2412 | 2412 | ||
| 2413 | /* dir-item.c */ | 2413 | /* dir-item.c */ |
| @@ -2523,6 +2523,14 @@ struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *pag | |||
| 2523 | #define PageChecked PageFsMisc | 2523 | #define PageChecked PageFsMisc |
| 2524 | #endif | 2524 | #endif |
| 2525 | 2525 | ||
| 2526 | /* This forces readahead on a given range of bytes in an inode */ | ||
| 2527 | static inline void btrfs_force_ra(struct address_space *mapping, | ||
| 2528 | struct file_ra_state *ra, struct file *file, | ||
| 2529 | pgoff_t offset, unsigned long req_size) | ||
| 2530 | { | ||
| 2531 | page_cache_sync_readahead(mapping, ra, file, offset, req_size); | ||
| 2532 | } | ||
| 2533 | |||
| 2526 | struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry); | 2534 | struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry); |
| 2527 | int btrfs_set_inode_index(struct inode *dir, u64 *index); | 2535 | int btrfs_set_inode_index(struct inode *dir, u64 *index); |
| 2528 | int btrfs_unlink_inode(struct btrfs_trans_handle *trans, | 2536 | int btrfs_unlink_inode(struct btrfs_trans_handle *trans, |
| @@ -2551,9 +2559,6 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, | |||
| 2551 | int btrfs_merge_bio_hook(struct page *page, unsigned long offset, | 2559 | int btrfs_merge_bio_hook(struct page *page, unsigned long offset, |
| 2552 | size_t size, struct bio *bio, unsigned long bio_flags); | 2560 | size_t size, struct bio *bio, unsigned long bio_flags); |
| 2553 | 2561 | ||
| 2554 | unsigned long btrfs_force_ra(struct address_space *mapping, | ||
| 2555 | struct file_ra_state *ra, struct file *file, | ||
| 2556 | pgoff_t offset, pgoff_t last_index); | ||
| 2557 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); | 2562 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); |
| 2558 | int btrfs_readpage(struct file *file, struct page *page); | 2563 | int btrfs_readpage(struct file *file, struct page *page); |
| 2559 | void btrfs_evict_inode(struct inode *inode); | 2564 | void btrfs_evict_inode(struct inode *inode); |
| @@ -2648,12 +2653,21 @@ do { \ | |||
| 2648 | /* acl.c */ | 2653 | /* acl.c */ |
| 2649 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL | 2654 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL |
| 2650 | struct posix_acl *btrfs_get_acl(struct inode *inode, int type); | 2655 | struct posix_acl *btrfs_get_acl(struct inode *inode, int type); |
| 2651 | #else | ||
| 2652 | #define btrfs_get_acl NULL | ||
| 2653 | #endif | ||
| 2654 | int btrfs_init_acl(struct btrfs_trans_handle *trans, | 2656 | int btrfs_init_acl(struct btrfs_trans_handle *trans, |
| 2655 | struct inode *inode, struct inode *dir); | 2657 | struct inode *inode, struct inode *dir); |
| 2656 | int btrfs_acl_chmod(struct inode *inode); | 2658 | int btrfs_acl_chmod(struct inode *inode); |
| 2659 | #else | ||
| 2660 | #define btrfs_get_acl NULL | ||
| 2661 | static inline int btrfs_init_acl(struct btrfs_trans_handle *trans, | ||
| 2662 | struct inode *inode, struct inode *dir) | ||
| 2663 | { | ||
| 2664 | return 0; | ||
| 2665 | } | ||
| 2666 | static inline int btrfs_acl_chmod(struct inode *inode) | ||
| 2667 | { | ||
| 2668 | return 0; | ||
| 2669 | } | ||
| 2670 | #endif | ||
| 2657 | 2671 | ||
| 2658 | /* relocation.c */ | 2672 | /* relocation.c */ |
| 2659 | int btrfs_relocate_block_group(struct btrfs_root *root, u64 group_start); | 2673 | int btrfs_relocate_block_group(struct btrfs_root *root, u64 group_start); |
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index c360a848d97f..31d84e78129b 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c | |||
| @@ -198,8 +198,6 @@ struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, | |||
| 198 | struct btrfs_key key; | 198 | struct btrfs_key key; |
| 199 | int ins_len = mod < 0 ? -1 : 0; | 199 | int ins_len = mod < 0 ? -1 : 0; |
| 200 | int cow = mod != 0; | 200 | int cow = mod != 0; |
| 201 | struct btrfs_key found_key; | ||
| 202 | struct extent_buffer *leaf; | ||
| 203 | 201 | ||
| 204 | key.objectid = dir; | 202 | key.objectid = dir; |
| 205 | btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); | 203 | btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); |
| @@ -209,18 +207,7 @@ struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, | |||
| 209 | ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow); | 207 | ret = btrfs_s |
