diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-27 16:57:12 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-27 16:57:12 -0400 |
| commit | a0c3061093c8b49facef95dc09a618c6e0d17cb5 (patch) | |
| tree | 1d6ff7c06134b71a8bd0721395386e82e46e60c8 | |
| parent | 10799db60cbc4f990dd69eb49883477095c66af7 (diff) | |
| parent | 174ba50915b08dcfd07c8b5fb795b46a165fa09a (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: (58 commits)
Btrfs: use the device_list_mutex during write_dev_supers
Btrfs: setup free ino caching in a more asynchronous way
btrfs scrub: don't coalesce pages that are logically discontiguous
Btrfs: return -ENOMEM in clear_extent_bit
Btrfs: add mount -o auto_defrag
Btrfs: using rcu lock in the reader side of devices list
Btrfs: drop unnecessary device lock
Btrfs: fix the race between remove dev and alloc chunk
Btrfs: fix the race between reading and updating devices
Btrfs: fix bh leak on __btrfs_open_devices path
Btrfs: fix unsafe usage of merge_state
Btrfs: allocate extent state and check the result properly
fs/btrfs: Add missing btrfs_free_path
Btrfs: check return value of btrfs_inc_extent_ref()
Btrfs: return error to caller if read_one_inode() fails
Btrfs: BUG_ON is deleted from the caller of btrfs_truncate_item & btrfs_extend_item
Btrfs: return error code to caller when btrfs_del_item fails
Btrfs: return error code to caller when btrfs_previous_item fails
btrfs: fix typo 'testeing' -> 'testing'
btrfs: typo: 'btrfS' -> 'btrfs'
...
48 files changed, 6481 insertions, 4557 deletions
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile index 31610ea73aec..9b72dcf1cd25 100644 --- a/fs/btrfs/Makefile +++ b/fs/btrfs/Makefile | |||
| @@ -7,4 +7,4 @@ btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.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 acl.o free-space-cache.o zlib.o lzo.o \ |
| 10 | compression.o delayed-ref.o relocation.o | 10 | compression.o delayed-ref.o relocation.o delayed-inode.o scrub.o |
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 44ea5b92e1ba..f66fc9959733 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
| @@ -288,7 +288,7 @@ int btrfs_acl_chmod(struct inode *inode) | |||
| 288 | return 0; | 288 | return 0; |
| 289 | 289 | ||
| 290 | acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); | 290 | acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); |
| 291 | if (IS_ERR(acl) || !acl) | 291 | if (IS_ERR_OR_NULL(acl)) |
| 292 | return PTR_ERR(acl); | 292 | return PTR_ERR(acl); |
| 293 | 293 | ||
| 294 | clone = posix_acl_clone(acl, GFP_KERNEL); | 294 | clone = posix_acl_clone(acl, GFP_KERNEL); |
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 57c3bb2884ce..93b1aa932014 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include "extent_map.h" | 22 | #include "extent_map.h" |
| 23 | #include "extent_io.h" | 23 | #include "extent_io.h" |
| 24 | #include "ordered-data.h" | 24 | #include "ordered-data.h" |
| 25 | #include "delayed-inode.h" | ||
| 25 | 26 | ||
| 26 | /* in memory btrfs inode */ | 27 | /* in memory btrfs inode */ |
| 27 | struct btrfs_inode { | 28 | struct btrfs_inode { |
| @@ -152,20 +153,34 @@ struct btrfs_inode { | |||
| 152 | unsigned ordered_data_close:1; | 153 | unsigned ordered_data_close:1; |
| 153 | unsigned orphan_meta_reserved:1; | 154 | unsigned orphan_meta_reserved:1; |
| 154 | unsigned dummy_inode:1; | 155 | unsigned dummy_inode:1; |
| 156 | unsigned in_defrag:1; | ||
| 155 | 157 | ||
| 156 | /* | 158 | /* |
| 157 | * always compress this one file | 159 | * always compress this one file |
| 158 | */ | 160 | */ |
| 159 | unsigned force_compress:4; | 161 | unsigned force_compress:4; |
| 160 | 162 | ||
| 163 | struct btrfs_delayed_node *delayed_node; | ||
| 164 | |||
| 161 | struct inode vfs_inode; | 165 | struct inode vfs_inode; |
| 162 | }; | 166 | }; |
| 163 | 167 | ||
| 168 | extern unsigned char btrfs_filetype_table[]; | ||
| 169 | |||
| 164 | static inline struct btrfs_inode *BTRFS_I(struct inode *inode) | 170 | static inline struct btrfs_inode *BTRFS_I(struct inode *inode) |
| 165 | { | 171 | { |
| 166 | return container_of(inode, struct btrfs_inode, vfs_inode); | 172 | return container_of(inode, struct btrfs_inode, vfs_inode); |
| 167 | } | 173 | } |
| 168 | 174 | ||
| 175 | static inline u64 btrfs_ino(struct inode *inode) | ||
| 176 | { | ||
| 177 | u64 ino = BTRFS_I(inode)->location.objectid; | ||
| 178 | |||
| 179 | if (ino <= BTRFS_FIRST_FREE_OBJECTID) | ||
| 180 | ino = inode->i_ino; | ||
| 181 | return ino; | ||
| 182 | } | ||
| 183 | |||
| 169 | static inline void btrfs_i_size_write(struct inode *inode, u64 size) | 184 | static inline void btrfs_i_size_write(struct inode *inode, u64 size) |
| 170 | { | 185 | { |
| 171 | i_size_write(inode, size); | 186 | i_size_write(inode, size); |
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 41d1d7c70e29..bfe42b03eaf9 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
| @@ -125,9 +125,10 @@ static int check_compressed_csum(struct inode *inode, | |||
| 125 | kunmap_atomic(kaddr, KM_USER0); | 125 | kunmap_atomic(kaddr, KM_USER0); |
| 126 | 126 | ||
| 127 | if (csum != *cb_sum) { | 127 | if (csum != *cb_sum) { |
| 128 | printk(KERN_INFO "btrfs csum failed ino %lu " | 128 | printk(KERN_INFO "btrfs csum failed ino %llu " |
| 129 | "extent %llu csum %u " | 129 | "extent %llu csum %u " |
| 130 | "wanted %u mirror %d\n", inode->i_ino, | 130 | "wanted %u mirror %d\n", |
| 131 | (unsigned long long)btrfs_ino(inode), | ||
| 131 | (unsigned long long)disk_start, | 132 | (unsigned long long)disk_start, |
| 132 | csum, *cb_sum, cb->mirror_num); | 133 | csum, *cb_sum, cb->mirror_num); |
| 133 | ret = -EIO; | 134 | ret = -EIO; |
| @@ -332,7 +333,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
| 332 | struct compressed_bio *cb; | 333 | struct compressed_bio *cb; |
| 333 | unsigned long bytes_left; | 334 | unsigned long bytes_left; |
| 334 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; | 335 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; |
| 335 | int page_index = 0; | 336 | int pg_index = 0; |
| 336 | struct page *page; | 337 | struct page *page; |
| 337 | u64 first_byte = disk_start; | 338 | u64 first_byte = disk_start; |
| 338 | struct block_device *bdev; | 339 | struct block_device *bdev; |
| @@ -366,8 +367,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
| 366 | 367 | ||
| 367 | /* create and submit bios for the compressed pages */ | 368 | /* create and submit bios for the compressed pages */ |
| 368 | bytes_left = compressed_len; | 369 | bytes_left = compressed_len; |
| 369 | for (page_index = 0; page_index < cb->nr_pages; page_index++) { | 370 | for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) { |
| 370 | page = compressed_pages[page_index]; | 371 | page = compressed_pages[pg_index]; |
| 371 | page->mapping = inode->i_mapping; | 372 | page->mapping = inode->i_mapping; |
| 372 | if (bio->bi_size) | ||
