just have hypfs_create_file() do the usual simple_start_creating()/
d_make_persistent()/simple_done_creating() and that's it

Signed-off-by: Al Viro <[email protected]>
---
 arch/s390/hypfs/inode.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 6a80ab2692be..98952543d593 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -311,7 +311,7 @@ static void hypfs_kill_super(struct super_block *sb)
        struct hypfs_sb_info *sb_info = sb->s_fs_info;
 
        hypfs_last_dentry = NULL;
-       kill_litter_super(sb);
+       kill_anon_super(sb);
        kfree(sb_info);
 }
 
@@ -321,17 +321,13 @@ static struct dentry *hypfs_create_file(struct dentry 
*parent, const char *name,
        struct dentry *dentry;
        struct inode *inode;
 
-       inode_lock(d_inode(parent));
-       dentry = lookup_noperm(&QSTR(name), parent);
-       if (IS_ERR(dentry)) {
-               dentry = ERR_PTR(-ENOMEM);
-               goto fail;
-       }
+       dentry = simple_start_creating(parent, name);
+       if (IS_ERR(dentry))
+               return ERR_PTR(-ENOMEM);
        inode = hypfs_make_inode(parent->d_sb, mode);
        if (!inode) {
-               dput(dentry);
-               dentry = ERR_PTR(-ENOMEM);
-               goto fail;
+               simple_done_creating(dentry);
+               return ERR_PTR(-ENOMEM);
        }
        if (S_ISREG(mode)) {
                inode->i_fop = &hypfs_file_ops;
@@ -346,10 +342,9 @@ static struct dentry *hypfs_create_file(struct dentry 
*parent, const char *name,
        } else
                BUG();
        inode->i_private = data;
-       d_instantiate(dentry, inode);
-fail:
-       inode_unlock(d_inode(parent));
-       return dentry;
+       d_make_persistent(dentry, inode);
+       simple_done_creating(dentry);
+       return dentry;   // borrowed
 }
 
 struct dentry *hypfs_mkdir(struct dentry *parent, const char *name)
-- 
2.47.3


Reply via email to