kill binderfs_remove_file()

don't try to open-code simple_recursive_removal(), especially when
you miss things like d_invalidate()...

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2024-05-08 23:15:55 -04:00
parent fcaac5b427
commit 1664a91025
3 changed files with 1 additions and 18 deletions

View File

@ -6128,7 +6128,7 @@ static int binder_release(struct inode *nodp, struct file *filp)
debugfs_remove(proc->debugfs_entry); debugfs_remove(proc->debugfs_entry);
if (proc->binderfs_entry) { if (proc->binderfs_entry) {
binderfs_remove_file(proc->binderfs_entry); simple_recursive_removal(proc->binderfs_entry, NULL);
proc->binderfs_entry = NULL; proc->binderfs_entry = NULL;
} }

View File

@ -81,7 +81,6 @@ extern bool is_binderfs_device(const struct inode *inode);
extern struct dentry *binderfs_create_file(struct dentry *dir, const char *name, extern struct dentry *binderfs_create_file(struct dentry *dir, const char *name,
const struct file_operations *fops, const struct file_operations *fops,
void *data); void *data);
extern void binderfs_remove_file(struct dentry *dentry);
#else #else
static inline bool is_binderfs_device(const struct inode *inode) static inline bool is_binderfs_device(const struct inode *inode)
{ {
@ -94,7 +93,6 @@ static inline struct dentry *binderfs_create_file(struct dentry *dir,
{ {
return NULL; return NULL;
} }
static inline void binderfs_remove_file(struct dentry *dentry) {}
#endif #endif
#ifdef CONFIG_ANDROID_BINDERFS #ifdef CONFIG_ANDROID_BINDERFS

View File

@ -500,21 +500,6 @@ static struct dentry *binderfs_create_dentry(struct dentry *parent,
return dentry; return dentry;
} }
void binderfs_remove_file(struct dentry *dentry)
{
struct inode *parent_inode;
parent_inode = d_inode(dentry->d_parent);
inode_lock(parent_inode);
if (simple_positive(dentry)) {
dget(dentry);
simple_unlink(parent_inode, dentry);
d_delete(dentry);
dput(dentry);
}
inode_unlock(parent_inode);
}
struct dentry *binderfs_create_file(struct dentry *parent, const char *name, struct dentry *binderfs_create_file(struct dentry *parent, const char *name,
const struct file_operations *fops, const struct file_operations *fops,
void *data) void *data)