lkml.org 
[lkml]   [2021]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] netfs: Miscellaneous fixes
On Mon, Apr 26, 2021 at 10:06:24PM +0100, David Howells wrote:
> @@ -968,7 +968,7 @@ int netfs_readpage(struct file *file,
> return -ENOMEM;
> }
> rreq->mapping = page_file_mapping(page);
> - rreq->start = page_index(page) * PAGE_SIZE;
> + rreq->start = page_offset(page);

This one needs to use page_file_offset() because swap-over-NFS.

> @@ -1105,8 +1105,8 @@ int netfs_write_begin(struct file *file, struct address_space *mapping,
> rreq = netfs_alloc_read_request(ops, netfs_priv, file);
> if (!rreq)
> goto error;
> - rreq->mapping = page->mapping;
> - rreq->start = page->index * PAGE_SIZE;
> + rreq->mapping = page_file_mapping(page);

There's nothing wrong with using page->mapping here. The swap-over-NFS
path doesn't use write_begin, it uses O_DIRECT writes.

\
 
 \ /
  Last update: 2021-04-26 23:10    [W:1.011 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site