fs: no games with DCACHE_UNHASHED

Previous thread: score: include asm-generic/param.h in asm/delay.h. by Linux Kernel Mailing List on Thursday, December 17, 2009 - 9:59 am. (1 message)

Next thread: fsstack/ecryptfs: remove unused get_nlinks param to fsstack_copy_attr_all by Linux Kernel Mailing List on Thursday, December 17, 2009 - 9:59 am. (1 message)
From: Linux Kernel Mailing List
Date: Thursday, December 17, 2009 - 9:59 am

Gitweb:     http://git.kernel.org/linus/a3a065e3f13da8a3470ed09c7f38aad256083726
Commit:     a3a065e3f13da8a3470ed09c7f38aad256083726
Parent:     b9aff027b2c1d6019d237382c78fd396f9de2ea5
Author:     Nick Piggin <npiggin@suse.de>
AuthorDate: Wed Nov 18 05:30:19 2009 +0100
Committer:  Al Viro <viro@zeniv.linux.org.uk>
CommitDate: Thu Dec 17 10:51:40 2009 -0500

    fs: no games with DCACHE_UNHASHED
    
    Filesystems outside the regular namespace do not have to clear DCACHE_UNHASHED
    in order to have a working /proc/$pid/fd/XXX. Nothing in proc prevents the
    fd link from being used if its dentry is not in the hash.
    
    Also, it does not get put into the dcache hash if DCACHE_UNHASHED is clear;
    that depends on the filesystem calling d_add or d_rehash.
    
    So delete the misleading comments and needless code.
    
    Acked-by: Miklos Szeredi <mszeredi@suse.cz>
    Signed-off-by: Nick Piggin <npiggin@suse.de>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/anon_inodes.c |   13 -------------
 fs/pipe.c        |   18 ------------------
 net/socket.c     |   19 -------------------
 3 files changed, 0 insertions(+), 50 deletions(-)

diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 01c529a..2c99459 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -35,16 +35,6 @@ static int anon_inodefs_get_sb(struct file_system_type *fs_type, int flags,
 			     mnt);
 }
 
-static int anon_inodefs_delete_dentry(struct dentry *dentry)
-{
-	/*
-	 * We faked vfs to believe the dentry was hashed when we created it.
-	 * Now we restore the flag so that dput() will work correctly.
-	 */
-	dentry->d_flags |= DCACHE_UNHASHED;
-	return 1;
-}
-
 /*
  * anon_inodefs_dname() is called from d_path().
  */
@@ -60,7 +50,6 @@ static struct file_system_type anon_inode_fs_type = {
 	.kill_sb	= kill_anon_super,
 };
 static const struct dentry_operations anon_inodefs_dentry_operations = {
-	.d_delete	= anon_inodefs_delete_dentry,
 	.d_dname	= ...
Previous thread: score: include asm-generic/param.h in asm/delay.h. by Linux Kernel Mailing List on Thursday, December 17, 2009 - 9:59 am. (1 message)

Next thread: fsstack/ecryptfs: remove unused get_nlinks param to fsstack_copy_attr_all by Linux Kernel Mailing List on Thursday, December 17, 2009 - 9:59 am. (1 message)