From: Jeff Layton pipefs declares its drop_inode function to be generic_delete_inode, which obviates the need to have the fs make certain that i_nlink is properly set at drop_inode time. Signed-off-by: Jeff Layton Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- fs/pipe.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -puN fs/pipe.c~have-pipefs-ensure-i_ino-uniqueness-by-calling-iunique-and-hashing-the-inode-update fs/pipe.c --- a/fs/pipe.c~have-pipefs-ensure-i_ino-uniqueness-by-calling-iunique-and-hashing-the-inode-update +++ a/fs/pipe.c @@ -825,7 +825,6 @@ void free_pipe_info(struct inode *inode) { __free_pipe_info(inode->i_pipe); inode->i_pipe = NULL; - clear_nlink(inode); } static struct vfsmount *pipe_mnt __read_mostly; @@ -1006,6 +1005,11 @@ int do_pipe(int *fd) return error; } +static struct super_operations pipefs_sops = { + .statfs = simple_statfs, + .drop_inode = generic_delete_inode, +}; + /* * pipefs should _never_ be mounted by userland - too much of security hassle, * no real gain from having the whole whorehouse mounted. So we don't need @@ -1016,7 +1020,7 @@ static int pipefs_get_sb(struct file_sys int flags, const char *dev_name, void *data, struct vfsmount *mnt) { - return get_sb_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC, mnt); + return get_sb_pseudo(fs_type, "pipe:", &pipefs_sops, PIPEFS_MAGIC, mnt); } static struct file_system_type pipe_fs_type = { _