diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/check-integrity.c | 4 | ||||
-rw-r--r-- | fs/btrfs/compression.c | 2 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 4 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 1 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 2 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 6 | ||||
-rw-r--r-- | fs/btrfs/send.c | 12 | ||||
-rw-r--r-- | fs/btrfs/super.c | 2 |
8 files changed, 17 insertions, 16 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 49a62b4dda3b..0e8388e72d8d 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c | |||
@@ -92,11 +92,11 @@ | |||
92 | #include <linux/slab.h> | 92 | #include <linux/slab.h> |
93 | #include <linux/buffer_head.h> | 93 | #include <linux/buffer_head.h> |
94 | #include <linux/mutex.h> | 94 | #include <linux/mutex.h> |
95 | #include <linux/crc32c.h> | ||
96 | #include <linux/genhd.h> | 95 | #include <linux/genhd.h> |
97 | #include <linux/blkdev.h> | 96 | #include <linux/blkdev.h> |
98 | #include "ctree.h" | 97 | #include "ctree.h" |
99 | #include "disk-io.h" | 98 | #include "disk-io.h" |
99 | #include "hash.h" | ||
100 | #include "transaction.h" | 100 | #include "transaction.h" |
101 | #include "extent_io.h" | 101 | #include "extent_io.h" |
102 | #include "volumes.h" | 102 | #include "volumes.h" |
@@ -1823,7 +1823,7 @@ static int btrfsic_test_for_metadata(struct btrfsic_state *state, | |||
1823 | size_t sublen = i ? PAGE_CACHE_SIZE : | 1823 | size_t sublen = i ? PAGE_CACHE_SIZE : |
1824 | (PAGE_CACHE_SIZE - BTRFS_CSUM_SIZE); | 1824 | (PAGE_CACHE_SIZE - BTRFS_CSUM_SIZE); |
1825 | 1825 | ||
1826 | crc = crc32c(crc, data, sublen); | 1826 | crc = btrfs_crc32c(crc, data, sublen); |
1827 | } | 1827 | } |
1828 | btrfs_csum_final(crc, csum); | 1828 | btrfs_csum_final(crc, csum); |
1829 | if (memcmp(csum, h->csum, state->csum_size)) | 1829 | if (memcmp(csum, h->csum, state->csum_size)) |
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index e2600cdb6c25..b01fb6c527e3 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
@@ -1010,6 +1010,8 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, | |||
1010 | bytes = min(bytes, working_bytes); | 1010 | bytes = min(bytes, working_bytes); |
1011 | kaddr = kmap_atomic(page_out); | 1011 | kaddr = kmap_atomic(page_out); |
1012 | memcpy(kaddr + *pg_offset, buf + buf_offset, bytes); | 1012 | memcpy(kaddr + *pg_offset, buf + buf_offset, bytes); |
1013 | if (*pg_index == (vcnt - 1) && *pg_offset == 0) | ||
1014 | memset(kaddr + bytes, 0, PAGE_CACHE_SIZE - bytes); | ||
1013 | kunmap_atomic(kaddr); | 1015 | kunmap_atomic(kaddr); |
1014 | flush_dcache_page(page_out); | 1016 | flush_dcache_page(page_out); |
1015 | 1017 | ||
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0e69295d0031..5215f04260b2 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/workqueue.h> | 26 | #include <linux/workqueue.h> |
27 | #include <linux/kthread.h> | 27 | #include <linux/kthread.h> |
28 | #include <linux/freezer.h> | 28 | #include <linux/freezer.h> |
29 | #include <linux/crc32c.h> | ||
30 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
31 | #include <linux/migrate.h> | 30 | #include <linux/migrate.h> |
32 | #include <linux/ratelimit.h> | 31 | #include <linux/ratelimit.h> |
@@ -35,6 +34,7 @@ | |||
35 | #include <asm/unaligned.h> | 34 | #include <asm/unaligned.h> |
36 | #include "ctree.h" | 35 | #include "ctree.h" |
37 | #include "disk-io.h" | 36 | #include "disk-io.h" |
37 | #include "hash.h" | ||
38 | #include "transaction.h" | 38 | #include "transaction.h" |
39 | #include "btrfs_inode.h" | 39 | #include "btrfs_inode.h" |
40 | #include "volumes.h" | 40 | #include "volumes.h" |
@@ -244,7 +244,7 @@ out: | |||
244 | 244 | ||
245 | u32 btrfs_csum_data(char *data, u32 seed, size_t len) | 245 | u32 btrfs_csum_data(char *data, u32 seed, size_t len) |
246 | { | 246 | { |
247 | return crc32c(seed, data, len); | 247 | return btrfs_crc32c(seed, data, len); |
248 | } | 248 | } |
249 | 249 | ||
250 | void btrfs_csum_final(u32 crc, char *result) | 250 | void btrfs_csum_final(u32 crc, char *result) |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 9c9ecc93ae2c..32312e09f0f5 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -2385,6 +2385,7 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, | |||
2385 | spin_unlock(&delayed_refs->lock); | 2385 | spin_unlock(&delayed_refs->lock); |
2386 | locked_ref = NULL; | 2386 | locked_ref = NULL; |
2387 | cond_resched(); | 2387 | cond_resched(); |
2388 | count++; | ||
2388 | continue; | 2389 | continue; |
2389 | } | 2390 | } |
2390 | 2391 | ||
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5c4ab9c18940..184e9cb39647 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -2629,7 +2629,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent) | |||
2629 | EXTENT_DEFRAG, 1, cached_state); | 2629 | EXTENT_DEFRAG, 1, cached_state); |
2630 | if (ret) { | 2630 | if (ret) { |
2631 | u64 last_snapshot = btrfs_root_last_snapshot(&root->root_item); | 2631 | u64 last_snapshot = btrfs_root_last_snapshot(&root->root_item); |
2632 | if (last_snapshot >= BTRFS_I(inode)->generation) | 2632 | if (0 && last_snapshot >= BTRFS_I(inode)->generation) |
2633 | /* the inode is shared */ | 2633 | /* the inode is shared */ |
2634 | new = record_old_file_extents(inode, ordered_extent); | 2634 | new = record_old_file_extents(inode, ordered_extent); |
2635 | 2635 | ||
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b0134892dc70..383ab455bfa7 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -4525,7 +4525,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg) | |||
4525 | spin_lock(&root->fs_info->super_lock); | 4525 | spin_lock(&root->fs_info->super_lock); |
4526 | strcpy(super_block->label, label); | 4526 | strcpy(super_block->label, label); |
4527 | spin_unlock(&root->fs_info->super_lock); | 4527 | spin_unlock(&root->fs_info->super_lock); |
4528 | ret = btrfs_end_transaction(trans, root); | 4528 | ret = btrfs_commit_transaction(trans, root); |
4529 | 4529 | ||
4530 | out_unlock: | 4530 | out_unlock: |
4531 | mnt_drop_write_file(file); | 4531 | mnt_drop_write_file(file); |
@@ -4668,7 +4668,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg) | |||
4668 | if (ret) | 4668 | if (ret) |
4669 | return ret; | 4669 | return ret; |
4670 | 4670 | ||
4671 | trans = btrfs_start_transaction(root, 1); | 4671 | trans = btrfs_start_transaction(root, 0); |
4672 | if (IS_ERR(trans)) | 4672 | if (IS_ERR(trans)) |
4673 | return PTR_ERR(trans); | 4673 | return PTR_ERR(trans); |
4674 | 4674 | ||
@@ -4689,7 +4689,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg) | |||
4689 | btrfs_set_super_incompat_flags(super_block, newflags); | 4689 | btrfs_set_super_incompat_flags(super_block, newflags); |
4690 | spin_unlock(&root->fs_info->super_lock); | 4690 | spin_unlock(&root->fs_info->super_lock); |
4691 | 4691 | ||
4692 | return btrfs_end_transaction(trans, root); | 4692 | return btrfs_commit_transaction(trans, root); |
4693 | } | 4693 | } |
4694 | 4694 | ||
4695 | long btrfs_ioctl(struct file *file, unsigned int | 4695 | long btrfs_ioctl(struct file *file, unsigned int |
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 730dce395858..9c8d1a3fdc3a 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -24,12 +24,12 @@ | |||
24 | #include <linux/xattr.h> | 24 | #include <linux/xattr.h> |
25 | #include <linux/posix_acl_xattr.h> | 25 | #include <linux/posix_acl_xattr.h> |
26 | #include <linux/radix-tree.h> | 26 | #include <linux/radix-tree.h> |
27 | #include <linux/crc32c.h> | ||
28 | #include <linux/vmalloc.h> | 27 | #include <linux/vmalloc.h> |
29 | #include <linux/string.h> | 28 | #include <linux/string.h> |
30 | 29 | ||
31 | #include "send.h" | 30 | #include "send.h" |
32 | #include "backref.h" | 31 | #include "backref.h" |
32 | #include "hash.h" | ||
33 | #include "locking.h" | 33 | #include "locking.h" |
34 | #include "disk-io.h" | 34 | #include "disk-io.h" |
35 | #include "btrfs_inode.h" | 35 | #include "btrfs_inode.h" |
@@ -620,7 +620,7 @@ static int send_cmd(struct send_ctx *sctx) | |||
620 | hdr->len = cpu_to_le32(sctx->send_size - sizeof(*hdr)); | 620 | hdr->len = cpu_to_le32(sctx->send_size - sizeof(*hdr)); |
621 | hdr->crc = 0; | 621 | hdr->crc = 0; |
622 | 622 | ||
623 | crc = crc32c(0, (unsigned char *)sctx->send_buf, sctx->send_size); | 623 | crc = btrfs_crc32c(0, (unsigned char *)sctx->send_buf, sctx->send_size); |
624 | hdr->crc = cpu_to_le32(crc); | 624 | hdr->crc = cpu_to_le32(crc); |
625 | 625 | ||
626 | ret = write_buf(sctx->send_filp, sctx->send_buf, sctx->send_size, | 626 | ret = write_buf(sctx->send_filp, sctx->send_buf, sctx->send_size, |
@@ -2774,8 +2774,6 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino) | |||
2774 | return 0; | 2774 | return 0; |
2775 | } | 2775 | } |
2776 | 2776 | ||
2777 | #ifdef CONFIG_BTRFS_ASSERT | ||
2778 | |||
2779 | static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino) | 2777 | static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino) |
2780 | { | 2778 | { |
2781 | struct rb_node *n = sctx->waiting_dir_moves.rb_node; | 2779 | struct rb_node *n = sctx->waiting_dir_moves.rb_node; |
@@ -2796,8 +2794,6 @@ static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino) | |||
2796 | return -ENOENT; | 2794 | return -ENOENT; |
2797 | } | 2795 | } |
2798 | 2796 | ||
2799 | #endif | ||
2800 | |||
2801 | static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino) | 2797 | static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino) |
2802 | { | 2798 | { |
2803 | struct rb_node **p = &sctx->pending_dir_moves.rb_node; | 2799 | struct rb_node **p = &sctx->pending_dir_moves.rb_node; |
@@ -2902,7 +2898,9 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) | |||
2902 | } | 2898 | } |
2903 | 2899 | ||
2904 | sctx->send_progress = sctx->cur_ino + 1; | 2900 | sctx->send_progress = sctx->cur_ino + 1; |
2905 | ASSERT(del_waiting_dir_move(sctx, pm->ino) == 0); | 2901 | ret = del_waiting_dir_move(sctx, pm->ino); |
2902 | ASSERT(ret == 0); | ||
2903 | |||
2906 | ret = get_cur_path(sctx, pm->ino, pm->gen, to_path); | 2904 | ret = get_cur_path(sctx, pm->ino, pm->gen, to_path); |
2907 | if (ret < 0) | 2905 | if (ret < 0) |
2908 | goto out; | 2906 | goto out; |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index c02f63356895..97cc24198554 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -1996,7 +1996,7 @@ static void __exit exit_btrfs_fs(void) | |||
1996 | btrfs_hash_exit(); | 1996 | btrfs_hash_exit(); |
1997 | } | 1997 | } |
1998 | 1998 | ||
1999 | module_init(init_btrfs_fs) | 1999 | late_initcall(init_btrfs_fs); |
2000 | module_exit(exit_btrfs_fs) | 2000 | module_exit(exit_btrfs_fs) |
2001 | 2001 | ||
2002 | MODULE_LICENSE("GPL"); | 2002 | MODULE_LICENSE("GPL"); |