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:
Al Viro
2024-02-26 01:27:23 -05:00
parent 0703b36e4e
commit e11e247608
2 changed files with 5 additions and 7 deletions

View File

@@ -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 = {

View File

@@ -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);
}