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 36a19cd43e03..1bb897ecdeeb 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2342,7 +2342,7 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync); | |||
2342 | int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, | 2342 | int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, |
2343 | int skip_pinned); | 2343 | int skip_pinned); |
2344 | int btrfs_check_file(struct btrfs_root *root, struct inode *inode); | 2344 | int btrfs_check_file(struct btrfs_root *root, struct inode *inode); |
2345 | extern struct file_operations btrfs_file_operations; | 2345 | extern const struct file_operations btrfs_file_operations; |
2346 | int btrfs_drop_extents(struct btrfs_trans_handle *trans, | 2346 | int btrfs_drop_extents(struct btrfs_trans_handle *trans, |
2347 | struct btrfs_root *root, struct inode *inode, | 2347 | struct btrfs_root *root, struct inode *inode, |
2348 | u64 start, u64 end, u64 locked_end, | 2348 | u64 start, u64 end, u64 locked_end, |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index ac8927bdc33d..100551a66c46 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, |
@@ -1373,6 +1371,7 @@ static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi) | |||
1373 | { | 1371 | { |
1374 | int err; | 1372 | int err; |
1375 | 1373 | ||
1374 | bdi->name = "btrfs"; | ||
1376 | bdi->capabilities = BDI_CAP_MAP_COPY; | 1375 | bdi->capabilities = BDI_CAP_MAP_COPY; |
1377 | err = bdi_init(bdi); | 1376 | err = bdi_init(bdi); |
1378 | if (err) | 1377 | if (err) |
@@ -1641,6 +1640,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
1641 | 1640 | ||
1642 | sb->s_blocksize = 4096; | 1641 | sb->s_blocksize = 4096; |
1643 | sb->s_blocksize_bits = blksize_bits(4096); | 1642 | sb->s_blocksize_bits = blksize_bits(4096); |
1643 | sb->s_bdi = &fs_info->bdi; | ||
1644 | 1644 | ||
1645 | fs_info->btree_inode->i_ino = BTRFS_BTREE_INODE_OBJECTID; | 1645 | fs_info->btree_inode->i_ino = BTRFS_BTREE_INODE_OBJECTID; |
1646 | fs_info->btree_inode->i_nlink = 1; | 1646 | fs_info->btree_inode->i_nlink = 1; |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4aedbff36b8f..d0c4d584efad 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -1572,7 +1572,8 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans, | |||
1572 | static void btrfs_issue_discard(struct block_device *bdev, | 1572 | static void btrfs_issue_discard(struct block_device *bdev, |
1573 | u64 start, u64 len) | 1573 | u64 start, u64 len) |
1574 | { | 1574 | { |
1575 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL); | 1575 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, |
1576 | DISCARD_FL_BARRIER); | ||
1576 | } | 1577 | } |
1577 | #endif | 1578 | #endif |
1578 | 1579 | ||
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 53fb1c997f0e..2d623aa0625f 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); |
@@ -1203,7 +1202,7 @@ out: | |||
1203 | return ret > 0 ? EIO : ret; | 1202 | return ret > 0 ? EIO : ret; |
1204 | } | 1203 | } |
1205 | 1204 | ||
1206 | static struct vm_operations_struct btrfs_file_vm_ops = { | 1205 | static const struct vm_operations_struct btrfs_file_vm_ops = { |
1207 | .fault = filemap_fault, | 1206 | .fault = filemap_fault, |
1208 | .page_mkwrite = btrfs_page_mkwrite, | 1207 | .page_mkwrite = btrfs_page_mkwrite, |
1209 | }; | 1208 | }; |
@@ -1215,7 +1214,7 @@ static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma) | |||
1215 | return 0; | 1214 | return 0; |
1216 | } | 1215 | } |
1217 | 1216 | ||
1218 | struct file_operations btrfs_file_operations = { | 1217 | const struct file_operations btrfs_file_operations = { |
1219 | .llseek = generic_file_llseek, | 1218 | .llseek = generic_file_llseek, |
1220 | .read = do_sync_read, | 1219 | .read = do_sync_read, |
1221 | .aio_read = generic_file_aio_read, | 1220 | .aio_read = generic_file_aio_read, |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ef399a7794ff..9e138b793dc7 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; |
@@ -5729,7 +5729,7 @@ static int btrfs_permission(struct inode *inode, int mask) | |||
5729 | return generic_permission(inode, mask, btrfs_check_acl); | 5729 | return generic_permission(inode, mask, btrfs_check_acl); |
5730 | } | 5730 | } |
5731 | 5731 | ||
5732 | static struct inode_operations btrfs_dir_inode_operations = { | 5732 | static const struct inode_operations btrfs_dir_inode_operations = { |
5733 | .getattr = btrfs_getattr, | 5733 | .getattr = btrfs_getattr, |
5734 | .lookup = btrfs_lookup, | 5734 | .lookup = btrfs_lookup, |
5735 | .create = btrfs_create, | 5735 | .create = btrfs_create, |
@@ -5747,12 +5747,12 @@ static struct inode_operations btrfs_dir_inode_operations = { | |||
5747 | .removexattr = btrfs_removexattr, | 5747 | .removexattr = btrfs_removexattr, |
5748 | .permission = btrfs_permission, | 5748 | .permission = btrfs_permission, |
5749 | }; | 5749 | }; |
5750 | static struct inode_operations btrfs_dir_ro_inode_operations = { | 5750 | static const struct inode_operations btrfs_dir_ro_inode_operations = { |
5751 | .lookup = btrfs_lookup, | 5751 | .lookup = btrfs_lookup, |
5752 | .permission = btrfs_permission, | 5752 | .permission = btrfs_permission, |
5753 | }; | 5753 | }; |
5754 | 5754 | ||
5755 | static struct file_operations btrfs_dir_file_operations = { | 5755 | static const struct file_operations btrfs_dir_file_operations = { |
5756 | .llseek = generic_file_llseek, | 5756 | .llseek = generic_file_llseek, |
5757 | .read = generic_read_dir, | 5757 | .read = generic_read_dir, |
5758 | .readdir = btrfs_real_readdir, | 5758 | .readdir = btrfs_real_readdir, |
@@ -5790,7 +5790,7 @@ static struct extent_io_ops btrfs_extent_io_ops = { | |||
5790 | * | 5790 | * |
5791 | * For now we're avoiding this by dropping bmap. | 5791 | * For now we're avoiding this by dropping bmap. |
5792 | */ | 5792 | */ |
5793 | static struct address_space_operations btrfs_aops = { | 5793 | static const struct address_space_operations btrfs_aops = { |
5794 | .readpage = btrfs_readpage, | 5794 | .readpage = btrfs_readpage, |
5795 | .writepage = btrfs_writepage, | 5795 | .writepage = btrfs_writepage, |
5796 | .writepages = btrfs_writepages, | 5796 | .writepages = btrfs_writepages, |
@@ -5800,16 +5800,17 @@ static struct address_space_operations btrfs_aops = { | |||
5800 | .invalidatepage = btrfs_invalidatepage, | 5800 | .invalidatepage = btrfs_invalidatepage, |
5801 | .releasepage = btrfs_releasepage, | 5801 | .releasepage = btrfs_releasepage, |
5802 | .set_page_dirty = btrfs_set_page_dirty, | 5802 | .set_page_dirty = btrfs_set_page_dirty, |
5803 | .error_remove_page = generic_error_remove_page, | ||
5803 | }; | 5804 | }; |
5804 | 5805 | ||
5805 | static struct address_space_operations btrfs_symlink_aops = { | 5806 | static const struct address_space_operations btrfs_symlink_aops = { |
5806 | .readpage = btrfs_readpage, | 5807 | .readpage = btrfs_readpage, |
5807 | .writepage = btrfs_writepage, | 5808 | .writepage = btrfs_writepage, |
5808 | .invalidatepage = btrfs_invalidatepage, | 5809 | .invalidatepage = btrfs_invalidatepage, |
5809 | .releasepage = btrfs_releasepage, | 5810 | .releasepage = btrfs_releasepage, |
5810 | }; | 5811 | }; |
5811 | 5812 | ||
5812 | static struct inode_operations btrfs_file_inode_operations = { | 5813 | static const struct inode_operations btrfs_file_inode_operations = { |
5813 | .truncate = btrfs_truncate, | 5814 | .truncate = btrfs_truncate, |
5814 | .getattr = btrfs_getattr, | 5815 | .getattr = btrfs_getattr, |
5815 | .setattr = btrfs_setattr, | 5816 | .setattr = btrfs_setattr, |
@@ -5821,7 +5822,7 @@ static struct inode_operations btrfs_file_inode_operations = { | |||
5821 | .fallocate = btrfs_fallocate, | 5822 | .fallocate = btrfs_fallocate, |
5822 | .fiemap = btrfs_fiemap, | 5823 | .fiemap = btrfs_fiemap, |
5823 | }; | 5824 | }; |
5824 | static struct inode_operations btrfs_special_inode_operations = { | 5825 | static const struct inode_operations btrfs_special_inode_operations = { |
5825 | .getattr = btrfs_getattr, | 5826 | .getattr = btrfs_getattr, |
5826 | .setattr = btrfs_setattr, | 5827 | .setattr = btrfs_setattr, |
5827 | .permission = btrfs_permission, | 5828 | .permission = btrfs_permission, |
@@ -5830,7 +5831,7 @@ static struct inode_operations btrfs_special_inode_operations = { | |||
5830 | .listxattr = btrfs_listxattr, | 5831 | .listxattr = btrfs_listxattr, |
5831 | .removexattr = btrfs_removexattr, | 5832 | .removexattr = btrfs_removexattr, |
5832 | }; | 5833 | }; |
5833 | static struct inode_operations btrfs_symlink_inode_operations = { | 5834 | static const struct inode_operations btrfs_symlink_inode_operations = { |
5834 | .readlink = generic_readlink, | 5835 | .readlink = generic_readlink, |
5835 | .follow_link = page_follow_link_light, | 5836 | .follow_link = page_follow_link_light, |
5836 | .put_link = page_put_link, | 5837 | .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 e0a64328080c..9de9b2236419 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 | { |
@@ -677,7 +677,7 @@ static int btrfs_unfreeze(struct super_block *sb) | |||
677 | return 0; | 677 | return 0; |
678 | } | 678 | } |
679 | 679 | ||
680 | static struct super_operations btrfs_super_ops = { | 680 | static const struct super_operations btrfs_super_ops = { |
681 | .drop_inode = btrfs_drop_inode, | 681 | .drop_inode = btrfs_drop_inode, |
682 | .delete_inode = btrfs_delete_inode, | 682 | .delete_inode = btrfs_delete_inode, |
683 | .put_super = btrfs_put_super, | 683 | .put_super = btrfs_put_super, |
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 78f6254ac2d9..4edfdc2acc5f 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -2615,7 +2615,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, | |||
2615 | extent); | 2615 | extent); |
2616 | cs = btrfs_file_extent_offset(src, extent); | 2616 | cs = btrfs_file_extent_offset(src, extent); |
2617 | cl = btrfs_file_extent_num_bytes(src, | 2617 | cl = btrfs_file_extent_num_bytes(src, |
2618 | extent);; | 2618 | extent); |
2619 | if (btrfs_file_extent_compression(src, | 2619 | if (btrfs_file_extent_compression(src, |
2620 | extent)) { | 2620 | extent)) { |
2621 | cs = 0; | 2621 | 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; |