Skip to content

Commit 81e328a

Browse files
Al ViroKernel Patches Daemon
authored andcommitted
convert hypfs
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]>
1 parent bcf19d1 commit 81e328a

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

arch/s390/hypfs/inode.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static void hypfs_kill_super(struct super_block *sb)
311311
struct hypfs_sb_info *sb_info = sb->s_fs_info;
312312

313313
hypfs_last_dentry = NULL;
314-
kill_litter_super(sb);
314+
kill_anon_super(sb);
315315
kfree(sb_info);
316316
}
317317

@@ -321,17 +321,13 @@ static struct dentry *hypfs_create_file(struct dentry *parent, const char *name,
321321
struct dentry *dentry;
322322
struct inode *inode;
323323

324-
inode_lock(d_inode(parent));
325-
dentry = lookup_noperm(&QSTR(name), parent);
326-
if (IS_ERR(dentry)) {
327-
dentry = ERR_PTR(-ENOMEM);
328-
goto fail;
329-
}
324+
dentry = simple_start_creating(parent, name);
325+
if (IS_ERR(dentry))
326+
return ERR_PTR(-ENOMEM);
330327
inode = hypfs_make_inode(parent->d_sb, mode);
331328
if (!inode) {
332-
dput(dentry);
333-
dentry = ERR_PTR(-ENOMEM);
334-
goto fail;
329+
simple_done_creating(dentry);
330+
return ERR_PTR(-ENOMEM);
335331
}
336332
if (S_ISREG(mode)) {
337333
inode->i_fop = &hypfs_file_ops;
@@ -346,10 +342,9 @@ static struct dentry *hypfs_create_file(struct dentry *parent, const char *name,
346342
} else
347343
BUG();
348344
inode->i_private = data;
349-
d_instantiate(dentry, inode);
350-
fail:
351-
inode_unlock(d_inode(parent));
352-
return dentry;
345+
d_make_persistent(dentry, inode);
346+
simple_done_creating(dentry);
347+
return dentry; // borrowed
353348
}
354349

355350
struct dentry *hypfs_mkdir(struct dentry *parent, const char *name)

0 commit comments

Comments
 (0)