mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-11 12:30:09 +00:00
nfs: use writeback_iter directly
Stop using write_cache_pages and use writeback_iter directly. This removes an indirect call per written folio and makes the code easier to follow. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
This commit is contained in:
committed by
Anna Schumaker
parent
66a4981350
commit
f72a67598c
@@ -694,16 +694,6 @@ static int nfs_writepage_locked(struct folio *folio,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nfs_writepages_callback(struct folio *folio,
|
|
||||||
struct writeback_control *wbc, void *data)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = nfs_do_writepage(folio, wbc, data);
|
|
||||||
folio_unlock(folio);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void nfs_io_completion_commit(void *inode)
|
static void nfs_io_completion_commit(void *inode)
|
||||||
{
|
{
|
||||||
nfs_commit_inode(inode, 0);
|
nfs_commit_inode(inode, 0);
|
||||||
@@ -739,11 +729,15 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
struct folio *folio = NULL;
|
||||||
|
|
||||||
nfs_pageio_init_write(&pgio, inode, priority, false,
|
nfs_pageio_init_write(&pgio, inode, priority, false,
|
||||||
&nfs_async_write_completion_ops);
|
&nfs_async_write_completion_ops);
|
||||||
pgio.pg_io_completion = ioc;
|
pgio.pg_io_completion = ioc;
|
||||||
err = write_cache_pages(mapping, wbc, nfs_writepages_callback,
|
while ((folio = writeback_iter(mapping, wbc, folio, &err))) {
|
||||||
&pgio);
|
err = nfs_do_writepage(folio, wbc, &pgio);
|
||||||
|
folio_unlock(folio);
|
||||||
|
}
|
||||||
pgio.pg_error = 0;
|
pgio.pg_error = 0;
|
||||||
nfs_pageio_complete(&pgio);
|
nfs_pageio_complete(&pgio);
|
||||||
if (err == -EAGAIN && mntflags & NFS_MOUNT_SOFTERR)
|
if (err == -EAGAIN && mntflags & NFS_MOUNT_SOFTERR)
|
||||||
|
|||||||
Reference in New Issue
Block a user