diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ctree.h | 2 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 14 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 3 | ||||
-rw-r--r-- | fs/btrfs/file.c | 9 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 33 | ||||
-rw-r--r-- | fs/btrfs/ordered-data.c | 94 | ||||
-rw-r--r-- | fs/btrfs/ordered-data.h | 4 | ||||
-rw-r--r-- | fs/btrfs/super.c | 4 | ||||
-rw-r--r-- | fs/btrfs/tree-log.c | 2 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 4 |
10 files changed, 40 insertions, 129 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index e5dd628a526f..444b3e9b92a4 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2344,7 +2344,7 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync); | |||
2344 | int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, | 2344 | int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, |
2345 | int skip_pinned); | 2345 | int skip_pinned); |
2346 | int btrfs_check_file(struct btrfs_root *root, struct inode *inode); | 2346 | int btrfs_check_file(struct btrfs_root *root, struct inode *inode); |
2347 | extern struct file_operations btrfs_file_operations; | 2347 | extern const struct file_operations btrfs_file_operations; |
2348 | int btrfs_drop_extents(struct btrfs_trans_handle *trans, | 2348 | int btrfs_drop_extents(struct btrfs_trans_handle *trans, |
2349 | struct btrfs_root *root, struct inode *inode, | 2349 | struct btrfs_root *root, struct inode *inode, |
2350 | u64 start, u64 end, u64 locked_end, | 2350 | u64 start, u64 end, u64 locked_end, |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index d4132aad9ea1..02b6afbd7450 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -773,7 +773,7 @@ static void btree_invalidatepage(struct page *page, unsigned long offset) | |||
773 | } | 773 | } |
774 | } | 774 | } |
775 | 775 | ||
776 | static struct address_space_operations btree_aops = { | 776 | static const struct address_space_operations btree_aops = { |
777 | .readpage = btree_readpage, | 777 | .readpage = btree_readpage, |
778 | .writepage = btree_writepage, | 778 | .writepage = btree_writepage, |
779 | .writepages = btree_writepages, | 779 | .writepages = btree_writepages, |
@@ -822,16 +822,14 @@ struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root, | |||
822 | 822 | ||
823 | int btrfs_write_tree_block(struct extent_buffer *buf) | 823 | int btrfs_write_tree_block(struct extent_buffer *buf) |
824 | { | 824 | { |
825 | return btrfs_fdatawrite_range(buf->first_page->mapping, buf->start, | 825 | return filemap_fdatawrite_range(buf->first_page->mapping, buf->start, |
826 | buf->start + buf->len - 1, WB_SYNC_ALL); | 826 | buf->start + buf->len - 1); |
827 | } | 827 | } |
828 | 828 | ||
829 | int btrfs_wait_tree_block_writeback(struct extent_buffer *buf) | 829 | int btrfs_wait_tree_block_writeback(struct extent_buffer *buf) |
830 | { | 830 | { |
831 | return btrfs_wait_on_page_writeback_range(buf->first_page->mapping, | 831 | return filemap_fdatawait_range(buf->first_page->mapping, |
832 | buf->start >> PAGE_CACHE_SHIFT, | 832 | buf->start, buf->start + buf->len - 1); |
833 | (buf->start + buf->len - 1) >> | ||
834 | PAGE_CACHE_SHIFT); | ||
835 | } | 833 | } |
836 | 834 | ||
837 | struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr, | 835 | struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr, |
@@ -1375,6 +1373,7 @@ static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi) | |||
1375 | { | 1373 | { |
1376 | int err; | 1374 | int err; |
1377 | 1375 | ||
1376 | bdi->name = "btrfs"; | ||
1378 | bdi->capabilities = BDI_CAP_MAP_COPY; | 1377 | bdi->capabilities = BDI_CAP_MAP_COPY; |
1379 | err = bdi_init(bdi); | 1378 | err = bdi_init(bdi); |
1380 | if (err) | 1379 | if (err) |
@@ -1643,6 +1642,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
1643 | 1642 | ||
1644 | sb->s_blocksize = 4096; | 1643 | sb->s_blocksize = 4096; |
1645 | sb->s_blocksize_bits = blksize_bits(4096); | 1644 | sb->s_blocksize_bits = blksize_bits(4096); |
1645 | sb->s_bdi = &fs_info->bdi; | ||
1646 | 1646 | ||
1647 | fs_info->btree_inode->i_ino = BTRFS_BTREE_INODE_OBJECTID; | 1647 | fs_info->btree_inode->i_ino = BTRFS_BTREE_INODE_OBJECTID; |
1648 | fs_info->btree_inode->i_nlink = 1; | 1648 | fs_info->btree_inode->i_nlink = 1; |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 8d1fd6dc22ac..94627c4cc193 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -1571,7 +1571,8 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans, | |||
1571 | static void btrfs_issue_discard(struct block_device *bdev, | 1571 | static void btrfs_issue_discard(struct block_device *bdev, |
1572 | u64 start, u64 len) | 1572 | u64 start, u64 len) |
1573 | { | 1573 | { |
1574 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL); | 1574 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, |
1575 | DISCARD_FL_BARRIER); | ||
1575 | } | 1576 | } |
1576 | 1577 | ||
1577 | static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, | 1578 | static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 4599113ed72e..06550affbd27 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1023,9 +1023,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf, | |||
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | if (will_write) { | 1025 | if (will_write) { |
1026 | btrfs_fdatawrite_range(inode->i_mapping, pos, | 1026 | filemap_fdatawrite_range(inode->i_mapping, pos, |
1027 | pos + write_bytes - 1, | 1027 | pos + write_bytes - 1); |
1028 | WB_SYNC_ALL); | ||
1029 | } else { | 1028 | } else { |
1030 | balance_dirty_pages_ratelimited_nr(inode->i_mapping, | 1029 | balance_dirty_pages_ratelimited_nr(inode->i_mapping, |
1031 | num_pages); | 1030 | num_pages); |
@@ -1214,7 +1213,7 @@ out: | |||
1214 | return ret > 0 ? EIO : ret; | 1213 | return ret > 0 ? EIO : ret; |
1215 | } | 1214 | } |
1216 | 1215 | ||
1217 | static struct vm_operations_struct btrfs_file_vm_ops = { | 1216 | static const struct vm_operations_struct btrfs_file_vm_ops = { |
1218 | .fault = filemap_fault, | 1217 | .fault = filemap_fault, |
1219 | .page_mkwrite = btrfs_page_mkwrite, | 1218 | .page_mkwrite = btrfs_page_mkwrite, |
1220 | }; | 1219 | }; |
@@ -1226,7 +1225,7 @@ static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma) | |||
1226 | return 0; | 1225 | return 0; |
1227 | } | 1226 | } |
1228 | 1227 | ||
1229 | struct file_operations btrfs_file_operations = { | 1228 | const struct file_operations btrfs_file_operations = { |
1230 | .llseek = generic_file_llseek, | 1229 | .llseek = generic_file_llseek, |
1231 | .read = do_sync_read, | 1230 | .read = do_sync_read, |
1232 | .aio_read = generic_file_aio_read, | 1231 | .aio_read = generic_file_aio_read, |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ee92801fc5db..b3ad168a0bfc 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -55,14 +55,14 @@ struct btrfs_iget_args { | |||
55 | struct btrfs_root *root; | 55 | struct btrfs_root *root; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static struct inode_operations btrfs_dir_inode_operations; | 58 | static const struct inode_operations btrfs_dir_inode_operations; |
59 | static struct inode_operations btrfs_symlink_inode_operations; | 59 | static const struct inode_operations btrfs_symlink_inode_operations; |
60 | static struct inode_operations btrfs_dir_ro_inode_operations; | 60 | static const struct inode_operations btrfs_dir_ro_inode_operations; |
61 | static struct inode_operations btrfs_special_inode_operations; | 61 | static const struct inode_operations btrfs_special_inode_operations; |
62 | static struct inode_operations btrfs_file_inode_operations; | 62 | static const struct inode_operations btrfs_file_inode_operations; |
63 | static struct address_space_operations btrfs_aops; | 63 | static const struct address_space_operations btrfs_aops; |
64 | static struct address_space_operations btrfs_symlink_aops; | 64 | static const struct address_space_operations btrfs_symlink_aops; |
65 | static struct file_operations btrfs_dir_file_operations; | 65 | static const struct file_operations btrfs_dir_file_operations; |
66 | static struct extent_io_ops btrfs_extent_io_ops; | 66 | static struct extent_io_ops btrfs_extent_io_ops; |
67 | 67 | ||
68 | static struct kmem_cache *btrfs_inode_cachep; | 68 | static struct kmem_cache *btrfs_inode_cachep; |
@@ -5819,7 +5819,7 @@ static int btrfs_permission(struct inode *inode, int mask) | |||
5819 | return generic_permission(inode, mask, btrfs_check_acl); | 5819 | return generic_permission(inode, mask, btrfs_check_acl); |
5820 | } | 5820 | } |
5821 | 5821 | ||
5822 | static struct inode_operations btrfs_dir_inode_operations = { | 5822 | static const struct inode_operations btrfs_dir_inode_operations = { |
5823 | .getattr = btrfs_getattr, | 5823 | .getattr = btrfs_getattr, |
5824 | .lookup = btrfs_lookup, | 5824 | .lookup = btrfs_lookup, |
5825 | .create = btrfs_create, | 5825 | .create = btrfs_create, |
@@ -5837,12 +5837,12 @@ static struct inode_operations btrfs_dir_inode_operations = { | |||
5837 | .removexattr = btrfs_removexattr, | 5837 | .removexattr = btrfs_removexattr, |
5838 | .permission = btrfs_permission, | 5838 | .permission = btrfs_permission, |
5839 | }; | 5839 | }; |
5840 | static struct inode_operations btrfs_dir_ro_inode_operations = { | 5840 | static const struct inode_operations btrfs_dir_ro_inode_operations = { |
5841 | .lookup = btrfs_lookup, | 5841 | .lookup = btrfs_lookup, |
5842 | .permission = btrfs_permission, | 5842 | .permission = btrfs_permission, |
5843 | }; | 5843 | }; |
5844 | 5844 | ||
5845 | static struct file_operations btrfs_dir_file_operations = { | 5845 | static const struct file_operations btrfs_dir_file_operations = { |
5846 | .llseek = generic_file_llseek, | 5846 | .llseek = generic_file_llseek, |
5847 | .read = generic_read_dir, | 5847 | .read = generic_read_dir, |
5848 | .readdir = btrfs_real_readdir, | 5848 | .readdir = btrfs_real_readdir, |
@@ -5880,7 +5880,7 @@ static struct extent_io_ops btrfs_extent_io_ops = { | |||
5880 | * | 5880 | * |
5881 | * For now we're avoiding this by dropping bmap. | 5881 | * For now we're avoiding this by dropping bmap. |
5882 | */ | 5882 | */ |
5883 | static struct address_space_operations btrfs_aops = { | 5883 | static const struct address_space_operations btrfs_aops = { |
5884 | .readpage = btrfs_readpage, | 5884 | .readpage = btrfs_readpage, |
5885 | .writepage = btrfs_writepage, | 5885 | .writepage = btrfs_writepage, |
5886 | .writepages = btrfs_writepages, | 5886 | .writepages = btrfs_writepages, |
@@ -5890,16 +5890,17 @@ static struct address_space_operations btrfs_aops = { | |||
5890 | .invalidatepage = btrfs_invalidatepage, | 5890 | .invalidatepage = btrfs_invalidatepage, |
5891 | .releasepage = btrfs_releasepage, | 5891 | .releasepage = btrfs_releasepage, |
5892 | .set_page_dirty = btrfs_set_page_dirty, | 5892 | .set_page_dirty = btrfs_set_page_dirty, |
5893 | .error_remove_page = generic_error_remove_page, | ||
5893 | }; | 5894 | }; |
5894 | 5895 | ||
5895 | static struct address_space_operations btrfs_symlink_aops = { | 5896 | static const struct address_space_operations btrfs_symlink_aops = { |
5896 | .readpage = btrfs_readpage, | 5897 | .readpage = btrfs_readpage, |
5897 | .writepage = btrfs_writepage, | 5898 | .writepage = btrfs_writepage, |
5898 | .invalidatepage = btrfs_invalidatepage, | 5899 | .invalidatepage = btrfs_invalidatepage, |
5899 | .releasepage = btrfs_releasepage, | 5900 | .releasepage = btrfs_releasepage, |
5900 | }; | 5901 | }; |
5901 | 5902 | ||
5902 | static struct inode_operations btrfs_file_inode_operations = { | 5903 | static const struct inode_operations btrfs_file_inode_operations = { |
5903 | .truncate = btrfs_truncate, | 5904 | .truncate = btrfs_truncate, |
5904 | .getattr = btrfs_getattr, | 5905 | .getattr = btrfs_getattr, |
5905 | .setattr = btrfs_setattr, | 5906 | .setattr = btrfs_setattr, |
@@ -5911,7 +5912,7 @@ static struct inode_operations btrfs_file_inode_operations = { | |||
5911 | .fallocate = btrfs_fallocate, | 5912 | .fallocate = btrfs_fallocate, |
5912 | .fiemap = btrfs_fiemap, | 5913 | .fiemap = btrfs_fiemap, |
5913 | }; | 5914 | }; |
5914 | static struct inode_operations btrfs_special_inode_operations = { | 5915 | static const struct inode_operations btrfs_special_inode_operations = { |
5915 | .getattr = btrfs_getattr, | 5916 | .getattr = btrfs_getattr, |
5916 | .setattr = btrfs_setattr, | 5917 | .setattr = btrfs_setattr, |
5917 | .permission = btrfs_permission, | 5918 | .permission = btrfs_permission, |
@@ -5920,7 +5921,7 @@ static struct inode_operations btrfs_special_inode_operations = { | |||
5920 | .listxattr = btrfs_listxattr, | 5921 | .listxattr = btrfs_listxattr, |
5921 | .removexattr = btrfs_removexattr, | 5922 | .removexattr = btrfs_removexattr, |
5922 | }; | 5923 | }; |
5923 | static struct inode_operations btrfs_symlink_inode_operations = { | 5924 | static const struct inode_operations btrfs_symlink_inode_operations = { |
5924 | .readlink = generic_readlink, | 5925 | .readlink = generic_readlink, |
5925 | .follow_link = page_follow_link_light, | 5926 | .follow_link = page_follow_link_light, |
5926 | .put_link = page_put_link, | 5927 | .put_link = page_put_link, |
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index ab21c29f2247..5799bc46a309 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -464,7 +464,7 @@ void btrfs_start_ordered_extent(struct inode *inode, | |||
464 | * start IO on any dirty ones so the wait doesn't stall waiting | 464 | * start IO on any dirty ones so the wait doesn't stall waiting |
465 | * for pdflush to find them | 465 | * for pdflush to find them |
466 | */ | 466 | */ |
467 | btrfs_fdatawrite_range(inode->i_mapping, start, end, WB_SYNC_ALL); | 467 | filemap_fdatawrite_range(inode->i_mapping, start, end); |
468 | if (wait) { | 468 | if (wait) { |
469 | wait_event(entry->wait, test_bit(BTRFS_ORDERED_COMPLETE, | 469 | wait_event(entry->wait, test_bit(BTRFS_ORDERED_COMPLETE, |
470 | &entry->flags)); | 470 | &entry->flags)); |
@@ -494,17 +494,15 @@ again: | |||
494 | /* start IO across the range first to instantiate any delalloc | 494 | /* start IO across the range first to instantiate any delalloc |
495 | * extents | 495 | * extents |
496 | */ | 496 | */ |
497 | btrfs_fdatawrite_range(inode->i_mapping, start, orig_end, WB_SYNC_ALL); | 497 | filemap_fdatawrite_range(inode->i_mapping, start, orig_end); |
498 | 498 | ||
499 | /* The compression code will leave pages locked but return from | 499 | /* The compression code will leave pages locked but return from |
500 | * writepage without setting the page writeback. Starting again | 500 | * writepage without setting the page writeback. Starting again |
501 | * with WB_SYNC_ALL will end up waiting for the IO to actually start. | 501 | * with WB_SYNC_ALL will end up waiting for the IO to actually start. |
502 | */ | 502 | */ |
503 | btrfs_fdatawrite_range(inode->i_mapping, start, orig_end, WB_SYNC_ALL); | 503 | filemap_fdatawrite_range(inode->i_mapping, start, orig_end); |
504 | 504 | ||
505 | btrfs_wait_on_page_writeback_range(inode->i_mapping, | 505 | filemap_fdatawait_range(inode->i_mapping, start, orig_end); |
506 | start >> PAGE_CACHE_SHIFT, | ||
507 | orig_end >> PAGE_CACHE_SHIFT); | ||
508 | 506 | ||
509 | end = orig_end; | 507 | end = orig_end; |
510 | found = 0; | 508 | found = 0; |
@@ -722,90 +720,6 @@ out: | |||
722 | } | 720 | } |
723 | 721 | ||
724 | 722 | ||
725 | /** | ||
726 | * taken from mm/filemap.c because it isn't exported | ||
727 | * | ||
728 | * __filemap_fdatawrite_range - start writeback on mapping dirty pages in range | ||
729 | * @mapping: address space structure to write | ||
730 | * @start: offset in bytes where the range starts | ||
731 | * @end: offset in bytes where the range ends (inclusive) | ||
732 | * @sync_mode: enable synchronous operation | ||
733 | * | ||
734 | * Start writeback against all of a mapping's dirty pages that lie | ||
735 | * within the byte offsets <start, end> inclusive. | ||
736 | * | ||
737 | * If sync_mode is WB_SYNC_ALL then this is a "data integrity" operation, as | ||
738 | * opposed to a regular memory cleansing writeback. The difference between | ||
739 | * these two operations is that if a dirty page/buffer is encountered, it must | ||
740 | * be waited upon, and not just skipped over. | ||
741 | */ | ||
742 | int btrfs_fdatawrite_range(struct address_space *mapping, loff_t start, | ||
743 | loff_t end, int sync_mode) | ||
744 | { | ||
745 | struct writeback_control wbc = { | ||
746 | .sync_mode = sync_mode, | ||
747 | .nr_to_write = mapping->nrpages * 2, | ||
748 | .range_start = start, | ||
749 | .range_end = end, | ||
750 | .for_writepages = 1, | ||
751 | }; | ||
752 | return btrfs_writepages(mapping, &wbc); | ||
753 | } | ||
754 | |||
755 | /** | ||
756 | * taken from mm/filemap.c because it isn't exported | ||
757 | * | ||
758 | * wait_on_page_writeback_range - wait for writeback to complete | ||
759 | * @mapping: target address_space | ||
760 | * @start: beginning page index | ||
761 | * @end: ending page index | ||
762 | * | ||
763 | * Wait for writeback to complete against pages indexed by start->end | ||
764 | * inclusive | ||
765 | */ | ||
766 | int btrfs_wait_on_page_writeback_range(struct address_space *mapping, | ||
767 | pgoff_t start, pgoff_t end) | ||
768 | { | ||
769 | struct pagevec pvec; | ||
770 | int nr_pages; | ||
771 | int ret = 0; | ||
772 | pgoff_t index; | ||
773 | |||
774 | if (end < start) | ||
775 | return 0; | ||
776 | |||
777 | pagevec_init(&pvec, 0); | ||
778 | index = start; | ||
779 | while ((index <= end) && | ||
780 | (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, | ||
781 | PAGECACHE_TAG_WRITEBACK, | ||
782 | min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1)) != 0) { | ||
783 | unsigned i; | ||
784 | |||
785 | for (i = 0; i < nr_pages; i++) { | ||
786 | struct page *page = pvec.pages[i]; | ||
787 | |||
788 | /* until radix tree lookup accepts end_index */ | ||
789 | if (page->index > end) | ||
790 | continue; | ||
791 | |||
792 | wait_on_page_writeback(page); | ||
793 | if (PageError(page)) | ||
794 | ret = -EIO; | ||
795 | } | ||
796 | pagevec_release(&pvec); | ||
797 | cond_resched(); | ||
798 | } | ||
799 | |||
800 | /* Check for outstanding write errors */ | ||
801 | if (test_and_clear_bit(AS_ENOSPC, &mapping->flags)) | ||
802 | ret = -ENOSPC; | ||
803 | if (test_and_clear_bit(AS_EIO, &mapping->flags)) | ||
804 | ret = -EIO; | ||
805 | |||
806 | return ret; | ||
807 | } | ||
808 | |||
809 | /* | 723 | /* |
810 | * add a given inode to the list of inodes that must be fully on | 724 | * add a given inode to the list of inodes that must be fully on |
811 | * disk before a transaction commit finishes. | 725 | * disk before a transaction commit finishes. |
diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h index 993a7ea45c70..f82e87488ca8 100644 --- a/fs/btrfs/ordered-data.h +++ b/fs/btrfs/ordered-data.h | |||
@@ -153,10 +153,6 @@ btrfs_lookup_first_ordered_extent(struct inode * inode, u64 file_offset); | |||
153 | int btrfs_ordered_update_i_size(struct inode *inode, | 153 | int btrfs_ordered_update_i_size(struct inode *inode, |
154 | struct btrfs_ordered_extent *ordered); | 154 | struct btrfs_ordered_extent *ordered); |
155 | int btrfs_find_ordered_sum(struct inode *inode, u64 offset, u64 disk_bytenr, u32 *sum); | 155 | int btrfs_find_ordered_sum(struct inode *inode, u64 offset, u64 disk_bytenr, u32 *sum); |
156 | int btrfs_wait_on_page_writeback_range(struct address_space *mapping, | ||
157 | pgoff_t start, pgoff_t end); | ||
158 | int btrfs_fdatawrite_range(struct address_space *mapping, loff_t start, | ||
159 | loff_t end, int sync_mode); | ||
160 | int btrfs_wait_ordered_extents(struct btrfs_root *root, int nocow_only); | 156 | int btrfs_wait_ordered_extents(struct btrfs_root *root, int nocow_only); |
161 | int btrfs_run_ordered_operations(struct btrfs_root *root, int wait); | 157 | int btrfs_run_ordered_operations(struct btrfs_root *root, int wait); |
162 | int btrfs_add_ordered_operation(struct btrfs_trans_handle *trans, | 158 | int btrfs_add_ordered_operation(struct btrfs_trans_handle *trans, |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 939b68f0612d..752a5463bf53 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include "export.h" | 51 | #include "export.h" |
52 | #include "compression.h" | 52 | #include "compression.h" |
53 | 53 | ||
54 | static struct super_operations btrfs_super_ops; | 54 | static const struct super_operations btrfs_super_ops; |
55 | 55 | ||
56 | static void btrfs_put_super(struct super_block *sb) | 56 | static void btrfs_put_super(struct super_block *sb) |
57 | { | 57 | { |
@@ -682,7 +682,7 @@ static int btrfs_unfreeze(struct super_block *sb) | |||
682 | return 0; | 682 | return 0; |
683 | } | 683 | } |
684 | 684 | ||
685 | static struct super_operations btrfs_super_ops = { | 685 | static const struct super_operations btrfs_super_ops = { |
686 | .drop_inode = btrfs_drop_inode, | 686 | .drop_inode = btrfs_drop_inode, |
687 | .delete_inode = btrfs_delete_inode, | 687 | .delete_inode = btrfs_delete_inode, |
688 | .put_super = btrfs_put_super, | 688 | .put_super = btrfs_put_super, |
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index f51bf13125c0..741666a7676a 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -2629,7 +2629,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, | |||
2629 | extent); | 2629 | extent); |
2630 | cs = btrfs_file_extent_offset(src, extent); | 2630 | cs = btrfs_file_extent_offset(src, extent); |
2631 | cl = btrfs_file_extent_num_bytes(src, | 2631 | cl = btrfs_file_extent_num_bytes(src, |
2632 | extent);; | 2632 | extent); |
2633 | if (btrfs_file_extent_compression(src, | 2633 | if (btrfs_file_extent_compression(src, |
2634 | extent)) { | 2634 | extent)) { |
2635 | cs = 0; | 2635 | cs = 0; |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 20cbd2eebd97..7eda483d7b5a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -260,7 +260,7 @@ loop_lock: | |||
260 | num_run++; | 260 | num_run++; |
261 | batch_run++; | 261 | batch_run++; |
262 | 262 | ||
263 | if (bio_sync(cur)) | 263 | if (bio_rw_flagged(cur, BIO_RW_SYNCIO)) |
264 | num_sync_run++; | 264 | num_sync_run++; |
265 | 265 | ||
266 | if (need_resched()) { | 266 | if (need_resched()) { |
@@ -2944,7 +2944,7 @@ static noinline int schedule_bio(struct btrfs_root *root, | |||
2944 | bio->bi_rw |= rw; | 2944 | bio->bi_rw |= rw; |
2945 | 2945 | ||
2946 | spin_lock(&device->io_lock); | 2946 | spin_lock(&device->io_lock); |
2947 | if (bio_sync(bio)) | 2947 | if (bio_rw_flagged(bio, BIO_RW_SYNCIO)) |
2948 | pending_bios = &device->pending_sync_bios; | 2948 | pending_bios = &device->pending_sync_bios; |
2949 | else | 2949 | else |
2950 | pending_bios = &device->pending_bios; | 2950 | pending_bios = &device->pending_bios; |