diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent_io.c | 3 | ||||
-rw-r--r-- | fs/btrfs/file.c | 4 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 1 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
4 files changed, 4 insertions, 6 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index b306b3a88fc7..e7e7afb4a872 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2643,8 +2643,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, | |||
2643 | if (old_compressed) | 2643 | if (old_compressed) |
2644 | contig = bio->bi_sector == sector; | 2644 | contig = bio->bi_sector == sector; |
2645 | else | 2645 | else |
2646 | contig = bio->bi_sector + (bio->bi_size >> 9) == | 2646 | contig = bio_end_sector(bio) == sector; |
2647 | sector; | ||
2648 | 2647 | ||
2649 | if (prev_bio_flags != bio_flags || !contig || | 2648 | if (prev_bio_flags != bio_flags || !contig || |
2650 | merge_bio(rw, tree, page, offset, page_size, bio, bio_flags) || | 2649 | merge_bio(rw, tree, page, offset, page_size, bio, bio_flags) || |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index b3e359bc8e68..4205ba752d40 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/string.h> | 24 | #include <linux/string.h> |
25 | #include <linux/backing-dev.h> | 25 | #include <linux/backing-dev.h> |
26 | #include <linux/mpage.h> | 26 | #include <linux/mpage.h> |
27 | #include <linux/aio.h> | ||
27 | #include <linux/falloc.h> | 28 | #include <linux/falloc.h> |
28 | #include <linux/swap.h> | 29 | #include <linux/swap.h> |
29 | #include <linux/writeback.h> | 30 | #include <linux/writeback.h> |
@@ -1517,8 +1518,6 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
1517 | size_t count, ocount; | 1518 | size_t count, ocount; |
1518 | bool sync = (file->f_flags & O_DSYNC) || IS_SYNC(file->f_mapping->host); | 1519 | bool sync = (file->f_flags & O_DSYNC) || IS_SYNC(file->f_mapping->host); |
1519 | 1520 | ||
1520 | sb_start_write(inode->i_sb); | ||
1521 | |||
1522 | mutex_lock(&inode->i_mutex); | 1521 | mutex_lock(&inode->i_mutex); |
1523 | 1522 | ||
1524 | err = generic_segment_checks(iov, &nr_segs, &ocount, VERIFY_READ); | 1523 | err = generic_segment_checks(iov, &nr_segs, &ocount, VERIFY_READ); |
@@ -1620,7 +1619,6 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
1620 | if (sync) | 1619 | if (sync) |
1621 | atomic_dec(&BTRFS_I(inode)->sync_writers); | 1620 | atomic_dec(&BTRFS_I(inode)->sync_writers); |
1622 | out: | 1621 | out: |
1623 | sb_end_write(inode->i_sb); | ||
1624 | current->backing_dev_info = NULL; | 1622 | current->backing_dev_info = NULL; |
1625 | return num_written ? num_written : err; | 1623 | return num_written ? num_written : err; |
1626 | } | 1624 | } |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c931a4dbd031..17f3064b4a3e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/writeback.h> | 32 | #include <linux/writeback.h> |
33 | #include <linux/statfs.h> | 33 | #include <linux/statfs.h> |
34 | #include <linux/compat.h> | 34 | #include <linux/compat.h> |
35 | #include <linux/aio.h> | ||
35 | #include <linux/bit_spinlock.h> | 36 | #include <linux/bit_spinlock.h> |
36 | #include <linux/xattr.h> | 37 | #include <linux/xattr.h> |
37 | #include <linux/posix_acl.h> | 38 | #include <linux/posix_acl.h> |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 24940085cdac..8bffb9174afb 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -5164,7 +5164,7 @@ static int bio_size_ok(struct block_device *bdev, struct bio *bio, | |||
5164 | } | 5164 | } |
5165 | 5165 | ||
5166 | prev = &bio->bi_io_vec[bio->bi_vcnt - 1]; | 5166 | prev = &bio->bi_io_vec[bio->bi_vcnt - 1]; |
5167 | if ((bio->bi_size >> 9) > max_sectors) | 5167 | if (bio_sectors(bio) > max_sectors) |
5168 | return 0; | 5168 | return 0; |
5169 | 5169 | ||
5170 | if (!q->merge_bvec_fn) | 5170 | if (!q->merge_bvec_fn) |