mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
convert efivarfs
Initially filesystem is populated with d_alloc_name() + d_add(). That becomes d_alloc_name() + d_make_persistent() + dput(). Dynamic creation is switched to d_make_persistent(); removal - to simple_unlink() (no point open-coding it in efivarfs_unlink(), better call it there) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -113,8 +113,7 @@ static int efivarfs_create(struct mnt_idmap *idmap, struct inode *dir,
|
||||
|
||||
inode->i_private = var;
|
||||
|
||||
d_instantiate(dentry, inode);
|
||||
dget(dentry);
|
||||
d_make_persistent(dentry, inode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -126,9 +125,7 @@ static int efivarfs_unlink(struct inode *dir, struct dentry *dentry)
|
||||
if (efivar_entry_delete(var))
|
||||
return -EINVAL;
|
||||
|
||||
drop_nlink(d_inode(dentry));
|
||||
dput(dentry);
|
||||
return 0;
|
||||
return simple_unlink(dir, dentry);
|
||||
};
|
||||
|
||||
const struct inode_operations efivarfs_dir_inode_operations = {
|
||||
|
||||
@@ -278,7 +278,8 @@ static int efivarfs_create_dentry(struct super_block *sb, efi_char16_t *name16,
|
||||
inode->i_private = entry;
|
||||
i_size_write(inode, size + sizeof(__u32)); /* attributes + data */
|
||||
inode_unlock(inode);
|
||||
d_add(dentry, inode);
|
||||
d_make_persistent(dentry, inode);
|
||||
dput(dentry);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -522,7 +523,7 @@ static void efivarfs_kill_sb(struct super_block *sb)
|
||||
struct efivarfs_fs_info *sfi = sb->s_fs_info;
|
||||
|
||||
blocking_notifier_chain_unregister(&efivar_ops_nh, &sfi->nb);
|
||||
kill_litter_super(sb);
|
||||
kill_anon_super(sb);
|
||||
|
||||
kfree(sfi);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user