diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/disk-io.c | 4 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 3 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 28 | ||||
-rw-r--r-- | fs/btrfs/ordered-data.c | 1 | ||||
-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 |
7 files changed, 24 insertions, 22 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f1e905f7e701..644e796fd643 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, |
@@ -1371,6 +1371,7 @@ static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi) | |||
1371 | { | 1371 | { |
1372 | int err; | 1372 | int err; |
1373 | 1373 | ||
1374 | bdi->name = "btrfs"; | ||
1374 | bdi->capabilities = BDI_CAP_MAP_COPY; | 1375 | bdi->capabilities = BDI_CAP_MAP_COPY; |
1375 | err = bdi_init(bdi); | 1376 | err = bdi_init(bdi); |
1376 | if (err) | 1377 | if (err) |
@@ -1639,6 +1640,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
1639 | 1640 | ||
1640 | sb->s_blocksize = 4096; | 1641 | sb->s_blocksize = 4096; |
1641 | sb->s_blocksize_bits = blksize_bits(4096); | 1642 | sb->s_blocksize_bits = blksize_bits(4096); |
1643 | sb->s_bdi = &fs_info->bdi; | ||
1642 | 1644 | ||
1643 | fs_info->btree_inode->i_ino = BTRFS_BTREE_INODE_OBJECTID; | 1645 | fs_info->btree_inode->i_ino = BTRFS_BTREE_INODE_OBJECTID; |
1644 | 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 90d314eeff6d..993f93ff7ba6 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -1570,7 +1570,8 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans, | |||
1570 | static void btrfs_issue_discard(struct block_device *bdev, | 1570 | static void btrfs_issue_discard(struct block_device *bdev, |
1571 | u64 start, u64 len) | 1571 | u64 start, u64 len) |
1572 | { | 1572 | { |
1573 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL); | 1573 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, |
1574 | DISCARD_FL_BARRIER); | ||
1574 | } | 1575 | } |
1575 | #endif | 1576 | #endif |
1576 | 1577 | ||
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 01c5f8b5a34e..976bfda032e0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -55,13 +55,13 @@ 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 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 | ||
@@ -5521,7 +5521,7 @@ static int btrfs_permission(struct inode *inode, int mask) | |||
5521 | return generic_permission(inode, mask, btrfs_check_acl); | 5521 | return generic_permission(inode, mask, btrfs_check_acl); |
5522 | } | 5522 | } |
5523 | 5523 | ||
5524 | static struct inode_operations btrfs_dir_inode_operations = { | 5524 | static const struct inode_operations btrfs_dir_inode_operations = { |
5525 | .getattr = btrfs_getattr, | 5525 | .getattr = btrfs_getattr, |
5526 | .lookup = btrfs_lookup, | 5526 | .lookup = btrfs_lookup, |
5527 | .create = btrfs_create, | 5527 | .create = btrfs_create, |
@@ -5539,7 +5539,7 @@ static struct inode_operations btrfs_dir_inode_operations = { | |||
5539 | .removexattr = btrfs_removexattr, | 5539 | .removexattr = btrfs_removexattr, |
5540 | .permission = btrfs_permission, | 5540 | .permission = btrfs_permission, |
5541 | }; | 5541 | }; |
5542 | static struct inode_operations btrfs_dir_ro_inode_operations = { | 5542 | static const struct inode_operations btrfs_dir_ro_inode_operations = { |
5543 | .lookup = btrfs_lookup, | 5543 | .lookup = btrfs_lookup, |
5544 | .permission = btrfs_permission, | 5544 | .permission = btrfs_permission, |
5545 | }; | 5545 | }; |
@@ -5580,7 +5580,7 @@ static struct extent_io_ops btrfs_extent_io_ops = { | |||
5580 | * | 5580 | * |
5581 | * For now we're avoiding this by dropping bmap. | 5581 | * For now we're avoiding this by dropping bmap. |
5582 | */ | 5582 | */ |
5583 | static struct address_space_operations btrfs_aops = { | 5583 | static const struct address_space_operations btrfs_aops = { |
5584 | .readpage = btrfs_readpage, | 5584 | .readpage = btrfs_readpage, |
5585 | .writepage = btrfs_writepage, | 5585 | .writepage = btrfs_writepage, |
5586 | .writepages = btrfs_writepages, | 5586 | .writepages = btrfs_writepages, |
@@ -5592,14 +5592,14 @@ static struct address_space_operations btrfs_aops = { | |||
5592 | .set_page_dirty = btrfs_set_page_dirty, | 5592 | .set_page_dirty = btrfs_set_page_dirty, |
5593 | }; | 5593 | }; |
5594 | 5594 | ||
5595 | static struct address_space_operations btrfs_symlink_aops = { | 5595 | static const struct address_space_operations btrfs_symlink_aops = { |
5596 | .readpage = btrfs_readpage, | 5596 | .readpage = btrfs_readpage, |
5597 | .writepage = btrfs_writepage, | 5597 | .writepage = btrfs_writepage, |
5598 | .invalidatepage = btrfs_invalidatepage, | 5598 | .invalidatepage = btrfs_invalidatepage, |
5599 | .releasepage = btrfs_releasepage, | 5599 | .releasepage = btrfs_releasepage, |
5600 | }; | 5600 | }; |
5601 | 5601 | ||
5602 | static struct inode_operations btrfs_file_inode_operations = { | 5602 | static const struct inode_operations btrfs_file_inode_operations = { |
5603 | .truncate = btrfs_truncate, | 5603 | .truncate = btrfs_truncate, |
5604 | .getattr = btrfs_getattr, | 5604 | .getattr = btrfs_getattr, |
5605 | .setattr = btrfs_setattr, | 5605 | .setattr = btrfs_setattr, |
@@ -5611,7 +5611,7 @@ static struct inode_operations btrfs_file_inode_operations = { | |||
5611 | .fallocate = btrfs_fallocate, | 5611 | .fallocate = btrfs_fallocate, |
5612 | .fiemap = btrfs_fiemap, | 5612 | .fiemap = btrfs_fiemap, |
5613 | }; | 5613 | }; |
5614 | static struct inode_operations btrfs_special_inode_operations = { | 5614 | static const struct inode_operations btrfs_special_inode_operations = { |
5615 | .getattr = btrfs_getattr, | 5615 | .getattr = btrfs_getattr, |
5616 | .setattr = btrfs_setattr, | 5616 | .setattr = btrfs_setattr, |
5617 | .permission = btrfs_permission, | 5617 | .permission = btrfs_permission, |
@@ -5620,7 +5620,7 @@ static struct inode_operations btrfs_special_inode_operations = { | |||
5620 | .listxattr = btrfs_listxattr, | 5620 | .listxattr = btrfs_listxattr, |
5621 | .removexattr = btrfs_removexattr, | 5621 | .removexattr = btrfs_removexattr, |
5622 | }; | 5622 | }; |
5623 | static struct inode_operations btrfs_symlink_inode_operations = { | 5623 | static const struct inode_operations btrfs_symlink_inode_operations = { |
5624 | .readlink = generic_readlink, | 5624 | .readlink = generic_readlink, |
5625 | .follow_link = page_follow_link_light, | 5625 | .follow_link = page_follow_link_light, |
5626 | .put_link = page_put_link, | 5626 | .put_link = page_put_link, |
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 4a9c8c4cec25..b5d6d24726b0 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -741,7 +741,6 @@ int btrfs_fdatawrite_range(struct address_space *mapping, loff_t start, | |||
741 | .nr_to_write = mapping->nrpages * 2, | 741 | .nr_to_write = mapping->nrpages * 2, |
742 | .range_start = start, | 742 | .range_start = start, |
743 | .range_end = end, | 743 | .range_end = end, |
744 | .for_writepages = 1, | ||
745 | }; | 744 | }; |
746 | return btrfs_writepages(mapping, &wbc); | 745 | return btrfs_writepages(mapping, &wbc); |
747 | } | 746 | } |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 0242c8babae9..67035385444c 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 | { |
@@ -675,7 +675,7 @@ static int btrfs_unfreeze(struct super_block *sb) | |||
675 | return 0; | 675 | return 0; |
676 | } | 676 | } |
677 | 677 | ||
678 | static struct super_operations btrfs_super_ops = { | 678 | static const struct super_operations btrfs_super_ops = { |
679 | .drop_inode = btrfs_drop_inode, | 679 | .drop_inode = btrfs_drop_inode, |
680 | .delete_inode = btrfs_delete_inode, | 680 | .delete_inode = btrfs_delete_inode, |
681 | .put_super = btrfs_put_super, | 681 | .put_super = btrfs_put_super, |
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 4d7d9abef42f..7827841b55cb 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -2605,7 +2605,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, | |||
2605 | extent); | 2605 | extent); |
2606 | cs = btrfs_file_extent_offset(src, extent); | 2606 | cs = btrfs_file_extent_offset(src, extent); |
2607 | cl = btrfs_file_extent_num_bytes(src, | 2607 | cl = btrfs_file_extent_num_bytes(src, |
2608 | extent);; | 2608 | extent); |
2609 | if (btrfs_file_extent_compression(src, | 2609 | if (btrfs_file_extent_compression(src, |
2610 | extent)) { | 2610 | extent)) { |
2611 | cs = 0; | 2611 | cs = 0; |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index be953afe804c..23e7d36ff325 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()) { |
@@ -2942,7 +2942,7 @@ static noinline int schedule_bio(struct btrfs_root *root, | |||
2942 | bio->bi_rw |= rw; | 2942 | bio->bi_rw |= rw; |
2943 | 2943 | ||
2944 | spin_lock(&device->io_lock); | 2944 | spin_lock(&device->io_lock); |
2945 | if (bio_sync(bio)) | 2945 | if (bio_rw_flagged(bio, BIO_RW_SYNCIO)) |
2946 | pending_bios = &device->pending_sync_bios; | 2946 | pending_bios = &device->pending_sync_bios; |
2947 | else | 2947 | else |
2948 | pending_bios = &device->pending_bios; | 2948 | pending_bios = &device->pending_bios; |