aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 9e097fbfc78d..b0ff34b96607 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -991,8 +991,8 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
991 size_t write_bytes = min(iov_iter_count(&i), 991 size_t write_bytes = min(iov_iter_count(&i),
992 nrptrs * (size_t)PAGE_CACHE_SIZE - 992 nrptrs * (size_t)PAGE_CACHE_SIZE -
993 offset); 993 offset);
994 size_t num_pages = (write_bytes + PAGE_CACHE_SIZE - 1) >> 994 size_t num_pages = (write_bytes + offset +
995 PAGE_CACHE_SHIFT; 995 PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
996 996
997 WARN_ON(num_pages > nrptrs); 997 WARN_ON(num_pages > nrptrs);
998 memset(pages, 0, sizeof(struct page *) * nrptrs); 998 memset(pages, 0, sizeof(struct page *) * nrptrs);
@@ -1022,8 +1022,8 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
1022 1022
1023 copied = btrfs_copy_from_user(pos, num_pages, 1023 copied = btrfs_copy_from_user(pos, num_pages,
1024 write_bytes, pages, &i); 1024 write_bytes, pages, &i);
1025 dirty_pages = (copied + PAGE_CACHE_SIZE - 1) >> 1025 dirty_pages = (copied + offset + PAGE_CACHE_SIZE - 1) >>
1026 PAGE_CACHE_SHIFT; 1026 PAGE_CACHE_SHIFT;
1027 1027
1028 if (num_pages > dirty_pages) { 1028 if (num_pages > dirty_pages) {
1029 if (copied > 0) 1029 if (copied > 0)