Skip to content

Commit 1664a91

Browse files
author
Al Viro
committed
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>
1 parent fcaac5b commit 1664a91

3 files changed

Lines changed: 1 addition & 18 deletions

File tree

drivers/android/binder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6128,7 +6128,7 @@ static int binder_release(struct inode *nodp, struct file *filp)
61286128
debugfs_remove(proc->debugfs_entry);
61296129

61306130
if (proc->binderfs_entry) {
6131-
binderfs_remove_file(proc->binderfs_entry);
6131+
simple_recursive_removal(proc->binderfs_entry, NULL);
61326132
proc->binderfs_entry = NULL;
61336133
}
61346134

drivers/android/binder_internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ extern bool is_binderfs_device(const struct inode *inode);
8181
extern struct dentry *binderfs_create_file(struct dentry *dir, const char *name,
8282
const struct file_operations *fops,
8383
void *data);
84-
extern void binderfs_remove_file(struct dentry *dentry);
8584
#else
8685
static inline bool is_binderfs_device(const struct inode *inode)
8786
{
@@ -94,7 +93,6 @@ static inline struct dentry *binderfs_create_file(struct dentry *dir,
9493
{
9594
return NULL;
9695
}
97-
static inline void binderfs_remove_file(struct dentry *dentry) {}
9896
#endif
9997

10098
#ifdef CONFIG_ANDROID_BINDERFS

drivers/android/binderfs.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -500,21 +500,6 @@ static struct dentry *binderfs_create_dentry(struct dentry *parent,
500500
return dentry;
501501
}
502502

503-
void binderfs_remove_file(struct dentry *dentry)
504-
{
505-
struct inode *parent_inode;
506-
507-
parent_inode = d_inode(dentry->d_parent);
508-
inode_lock(parent_inode);
509-
if (simple_positive(dentry)) {
510-
dget(dentry);
511-
simple_unlink(parent_inode, dentry);
512-
d_delete(dentry);
513-
dput(dentry);
514-
}
515-
inode_unlock(parent_inode);
516-
}
517-
518503
struct dentry *binderfs_create_file(struct dentry *parent, const char *name,
519504
const struct file_operations *fops,
520505
void *data)

0 commit comments

Comments
 (0)