Skip to content

Commit 377afd9

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
orangefs: Simplify bvec setup in orangefs_writepages_work()
This produces a bvec which is slightly different as the last page is added in its entirety rather than only the portion which is being written back. However we don't use this information anywhere; the iovec has its own length parameter. Signed-off-by: "Matthew Wilcox (Oracle)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Mike Marshall <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent f9ec213 commit 377afd9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/orangefs/inode.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ static int orangefs_writepages_work(struct orangefs_writepages *ow,
8383
struct orangefs_write_range *wrp, wr;
8484
struct iov_iter iter;
8585
ssize_t ret;
86+
size_t start;
8687
loff_t len, off;
8788
int i;
8889

8990
len = i_size_read(inode);
9091

92+
start = offset_in_page(ow->off);
9193
for (i = 0; i < ow->npages; i++) {
9294
set_page_writeback(ow->pages[i]);
93-
bvec_set_page(&ow->bv[i], ow->pages[i],
94-
min(page_offset(ow->pages[i]) + PAGE_SIZE,
95-
ow->off + ow->len) -
96-
max(ow->off, page_offset(ow->pages[i])),
97-
i == 0 ? ow->off - page_offset(ow->pages[i]) : 0);
95+
bvec_set_page(&ow->bv[i], ow->pages[i], PAGE_SIZE - start,
96+
start);
97+
start = 0;
9898
}
9999
iov_iter_bvec(&iter, ITER_SOURCE, ow->bv, ow->npages, ow->len);
100100

0 commit comments

Comments
 (0)