diff mbox series

NFS: remove sync_mode test from nfs_writepage_locked()

Message ID 170907510763.24797.12414304736328194537@noble.neil.brown.name (mailing list archive)
State New
Headers show
Series NFS: remove sync_mode test from nfs_writepage_locked() | expand

Commit Message

NeilBrown Feb. 27, 2024, 11:05 p.m. UTC
nfs_writepage_locked() is only called from nfs_wb_folio() (since Commit
12fc0a963128 ("nfs: Remove writepage")) so ->sync_mode is always
WB_SYNC_ALL.

This means the test for WB_SYNC_NONE is dead code and can be removed.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 fs/nfs/write.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Jeffrey Layton March 7, 2024, 12:29 p.m. UTC | #1
On Wed, 2024-02-28 at 10:05 +1100, NeilBrown wrote:
> nfs_writepage_locked() is only called from nfs_wb_folio() (since Commit
> 12fc0a963128 ("nfs: Remove writepage")) so ->sync_mode is always
> WB_SYNC_ALL.
> 
> This means the test for WB_SYNC_NONE is dead code and can be removed.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  fs/nfs/write.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index bb79d3a886ae..58adbb7709ba 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -667,10 +667,6 @@ static int nfs_writepage_locked(struct folio *folio,
>  	struct inode *inode = folio_file_mapping(folio)->host;
>  	int err;
>  
> -	if (wbc->sync_mode == WB_SYNC_NONE &&
> -	    NFS_SERVER(inode)->write_congested)
> -		return AOP_WRITEPAGE_ACTIVATE;
> -
>  	nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
>  	nfs_pageio_init_write(&pgio, inode, 0, false,
>  			      &nfs_async_write_completion_ops);

Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff mbox series

Patch

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index bb79d3a886ae..58adbb7709ba 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -667,10 +667,6 @@  static int nfs_writepage_locked(struct folio *folio,
 	struct inode *inode = folio_file_mapping(folio)->host;
 	int err;
 
-	if (wbc->sync_mode == WB_SYNC_NONE &&
-	    NFS_SERVER(inode)->write_congested)
-		return AOP_WRITEPAGE_ACTIVATE;
-
 	nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
 	nfs_pageio_init_write(&pgio, inode, 0, false,
 			      &nfs_async_write_completion_ops);