mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 12:52:29 -04:00
convert gadgetfs
same as functionfs Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1989,17 +1989,20 @@ static int gadgetfs_create_file (struct super_block *sb, char const *name,
|
||||
struct dentry *dentry;
|
||||
struct inode *inode;
|
||||
|
||||
dentry = d_alloc_name(sb->s_root, name);
|
||||
if (!dentry)
|
||||
return -ENOMEM;
|
||||
|
||||
inode = gadgetfs_make_inode (sb, data, fops,
|
||||
S_IFREG | (default_perm & S_IRWXUGO));
|
||||
if (!inode) {
|
||||
dput(dentry);
|
||||
if (!inode)
|
||||
return -ENOMEM;
|
||||
|
||||
dentry = simple_start_creating(sb->s_root, name);
|
||||
if (IS_ERR(dentry)) {
|
||||
iput(inode);
|
||||
return PTR_ERR(dentry);
|
||||
}
|
||||
d_add (dentry, inode);
|
||||
|
||||
d_make_persistent(dentry, inode);
|
||||
|
||||
simple_done_creating(dentry);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2096,7 +2099,7 @@ static void
|
||||
gadgetfs_kill_sb (struct super_block *sb)
|
||||
{
|
||||
mutex_lock(&sb_mutex);
|
||||
kill_litter_super (sb);
|
||||
kill_anon_super (sb);
|
||||
if (the_device) {
|
||||
put_dev (the_device);
|
||||
the_device = NULL;
|
||||
|
||||
Reference in New Issue
Block a user