diff mbox series

[17/21] 9p: don't bother with always_delete_dentry

Message ID 20250224212051.1756517-17-viro@zeniv.linux.org.uk (mailing list archive)
State New
Headers show
Series [01/21] procfs: kill ->proc_dops | expand

Commit Message

Al Viro Feb. 24, 2025, 9:20 p.m. UTC
just set DCACHE_DONTCACHE for "don't cache" mounts...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/9p/vfs_dentry.c | 1 -
 fs/9p/vfs_super.c  | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Christian Brauner Feb. 26, 2025, 8:40 a.m. UTC | #1
On Mon, Feb 24, 2025 at 09:20:47PM +0000, Al Viro wrote:
> just set DCACHE_DONTCACHE for "don't cache" mounts...
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---

Reviewed-by: Christian Brauner <brauner@kernel.org>

>  fs/9p/vfs_dentry.c | 1 -
>  fs/9p/vfs_super.c  | 6 ++++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c
> index 5061f192eafd..04795508a795 100644
> --- a/fs/9p/vfs_dentry.c
> +++ b/fs/9p/vfs_dentry.c
> @@ -127,7 +127,6 @@ const struct dentry_operations v9fs_cached_dentry_operations = {
>  };
>  
>  const struct dentry_operations v9fs_dentry_operations = {
> -	.d_delete = always_delete_dentry,
>  	.d_release = v9fs_dentry_release,
>  	.d_unalias_trylock = v9fs_dentry_unalias_trylock,
>  	.d_unalias_unlock = v9fs_dentry_unalias_unlock,
> diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
> index 5c3dc3efb909..795c6388744c 100644
> --- a/fs/9p/vfs_super.c
> +++ b/fs/9p/vfs_super.c
> @@ -134,10 +134,12 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
>  	if (retval)
>  		goto release_sb;
>  
> -	if (v9ses->cache & (CACHE_META|CACHE_LOOSE))
> +	if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) {
>  		set_default_d_op(sb, &v9fs_cached_dentry_operations);
> -	else
> +	} else {
>  		set_default_d_op(sb, &v9fs_dentry_operations);
> +		sb->s_d_flags |= DCACHE_DONTCACHE;
> +	}
>  
>  	inode = v9fs_get_new_inode_from_fid(v9ses, fid, sb);
>  	if (IS_ERR(inode)) {
> -- 
> 2.39.5
>
diff mbox series

Patch

diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c
index 5061f192eafd..04795508a795 100644
--- a/fs/9p/vfs_dentry.c
+++ b/fs/9p/vfs_dentry.c
@@ -127,7 +127,6 @@  const struct dentry_operations v9fs_cached_dentry_operations = {
 };
 
 const struct dentry_operations v9fs_dentry_operations = {
-	.d_delete = always_delete_dentry,
 	.d_release = v9fs_dentry_release,
 	.d_unalias_trylock = v9fs_dentry_unalias_trylock,
 	.d_unalias_unlock = v9fs_dentry_unalias_unlock,
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 5c3dc3efb909..795c6388744c 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -134,10 +134,12 @@  static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
 	if (retval)
 		goto release_sb;
 
-	if (v9ses->cache & (CACHE_META|CACHE_LOOSE))
+	if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) {
 		set_default_d_op(sb, &v9fs_cached_dentry_operations);
-	else
+	} else {
 		set_default_d_op(sb, &v9fs_dentry_operations);
+		sb->s_d_flags |= DCACHE_DONTCACHE;
+	}
 
 	inode = v9fs_get_new_inode_from_fid(v9ses, fid, sb);
 	if (IS_ERR(inode)) {