mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
afs: Prepare for use of THPs
As a prelude to supporting transparent huge pages, use thp_size() and similar rather than PAGE_SIZE/SHIFT. Further, try and frame everything in terms of file positions and lengths rather than page indices and numbers of pages. Signed-off-by: David Howells <dhowells@redhat.com> Tested-By: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/160588540227.3465195.4752143929716269062.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/161118155821.1232039.540445038028845740.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/161161051439.2537118.15577827510426326534.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/161340415869.1303470.6040191748634322355.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/161539559365.286939.18344613540296085269.stgit@warthog.procyon.org.uk/ # v4 Link: https://lore.kernel.org/r/161653815142.2770958.454490670311230206.stgit@warthog.procyon.org.uk/ # v5 Link: https://lore.kernel.org/r/161789098713.6155.16394227991842480300.stgit@warthog.procyon.org.uk/ # v6
This commit is contained in:
@@ -2083,6 +2083,6 @@ static void afs_dir_invalidatepage(struct page *page, unsigned int offset,
|
||||
afs_stat_v(dvnode, n_inval);
|
||||
|
||||
/* we clean up only if the entire page is being invalidated */
|
||||
if (offset == 0 && length == PAGE_SIZE)
|
||||
if (offset == 0 && length == thp_size(page))
|
||||
detach_page_private(page);
|
||||
}
|
||||
|
||||
@@ -329,8 +329,8 @@ static int afs_page_filler(struct key *key, struct page *page)
|
||||
req->vnode = vnode;
|
||||
req->key = key_get(key);
|
||||
req->pos = (loff_t)page->index << PAGE_SHIFT;
|
||||
req->len = PAGE_SIZE;
|
||||
req->nr_pages = 1;
|
||||
req->len = thp_size(page);
|
||||
req->nr_pages = thp_nr_pages(page);
|
||||
req->done = afs_file_read_done;
|
||||
req->cleanup = afs_file_read_cleanup;
|
||||
|
||||
@@ -574,8 +574,8 @@ undirty:
|
||||
trace_afs_page_dirty(vnode, tracepoint_string("undirty"), page);
|
||||
clear_page_dirty_for_io(page);
|
||||
full_invalidate:
|
||||
detach_page_private(page);
|
||||
trace_afs_page_dirty(vnode, tracepoint_string("inval"), page);
|
||||
detach_page_private(page);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -620,8 +620,8 @@ static int afs_releasepage(struct page *page, gfp_t gfp_flags)
|
||||
#endif
|
||||
|
||||
if (PagePrivate(page)) {
|
||||
detach_page_private(page);
|
||||
trace_afs_page_dirty(vnode, tracepoint_string("rel"), page);
|
||||
detach_page_private(page);
|
||||
}
|
||||
|
||||
/* indicate that the page can be released */
|
||||
|
||||
@@ -815,8 +815,6 @@ struct afs_operation {
|
||||
loff_t pos;
|
||||
loff_t size;
|
||||
loff_t i_size;
|
||||
pgoff_t first; /* first page in mapping to deal with */
|
||||
pgoff_t last; /* last page in mapping to deal with */
|
||||
bool laundering; /* Laundering page, PG_writeback not set */
|
||||
} store;
|
||||
struct {
|
||||
|
||||
430
fs/afs/write.c
430
fs/afs/write.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user