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 d2ac518f90e4..32d67a822e93 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2635,8 +2635,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, | |||
2635 | if (old_compressed) | 2635 | if (old_compressed) |
2636 | contig = bio->bi_sector == sector; | 2636 | contig = bio->bi_sector == sector; |
2637 | else | 2637 | else |
2638 | contig = bio->bi_sector + (bio->bi_size >> 9) == | 2638 | contig = bio_end_sector(bio) == sector; |
2639 | sector; | ||
2640 | 2639 | ||
2641 | if (prev_bio_flags != bio_flags || !contig || | 2640 | if (prev_bio_flags != bio_flags || !contig || |
2642 | merge_bio(rw, tree, page, offset, page_size, bio, bio_flags) || | 2641 | 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 1669c3b4be2f..9b31b3b091fc 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 a191bac31d85..0e925ced971b 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -5192,7 +5192,7 @@ static int bio_size_ok(struct block_device *bdev, struct bio *bio, | |||
5192 | } | 5192 | } |
5193 | 5193 | ||
5194 | prev = &bio->bi_io_vec[bio->bi_vcnt - 1]; | 5194 | prev = &bio->bi_io_vec[bio->bi_vcnt - 1]; |
5195 | if ((bio->bi_size >> 9) > max_sectors) | 5195 | if (bio_sectors(bio) > max_sectors) |
5196 | return 0; | 5196 | return 0; |
5197 | 5197 | ||
5198 | if (!q->merge_bvec_fn) | 5198 | if (!q->merge_bvec_fn) |