Message ID | 162981148752.1901565.3663780601682206026.stgit@warthog.procyon.org.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | netfs, afs, ceph: Support folios, at least partially | expand |
On Tue, Aug 24, 2021 at 02:24:47PM +0100, David Howells wrote: > + ret = afs_store_data(vnode, &iter, > + (loff_t)page->index * PAGE_SIZE + f, true); You probably want to use page_offset() here: ret = afs_store_data(vnode, &iter, page_offset(page) + f, true);
On Tue, Aug 24, 2021 at 02:24:47PM +0100, David Howells wrote: > +++ b/fs/afs/write.c > @@ -950,8 +950,8 @@ int afs_launder_page(struct page *page) > iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len); > > trace_afs_page_dirty(vnode, tracepoint_string("launder"), page); > - ret = afs_store_data(vnode, &iter, (loff_t)page->index * PAGE_SIZE, > - true); > + ret = afs_store_data(vnode, &iter, > + (loff_t)page->index * PAGE_SIZE + f, true); This could be page_offset(page), which reads better to me: ret = afs_store_data(vnode, &iter, page_offset(page) + f, true);
Matthew Wilcox <willy@infradead.org> wrote: > > This could be page_offset(page), which reads better to me: > > ret = afs_store_data(vnode, &iter, page_offset(page) + f, true); True. It gets converted to folio_pos() in patch #5 - will that do? David
diff --git a/fs/afs/write.c b/fs/afs/write.c index fb7d5c1cabde..fff4c7d88e0d 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -950,8 +950,8 @@ int afs_launder_page(struct page *page) iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len); trace_afs_page_dirty(vnode, tracepoint_string("launder"), page); - ret = afs_store_data(vnode, &iter, (loff_t)page->index * PAGE_SIZE, - true); + ret = afs_store_data(vnode, &iter, + (loff_t)page->index * PAGE_SIZE + f, true); } trace_afs_page_dirty(vnode, tracepoint_string("laundered"), page);