diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2024-05-08 23:15:55 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2025-07-02 22:36:52 -0400 |
| commit | 1664a91025f9a85c4592864a4001c28100a2fca5 (patch) | |
| tree | 913a3f4a3ad277c8fae1e9e12b6bb007d1e1a0cc | |
| parent | fcaac5b427686c9ba521c4e08a5f595fb89e669f (diff) | |
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>
| -rw-r--r-- | drivers/android/binder.c | 2 | ||||
| -rw-r--r-- | drivers/android/binder_internal.h | 2 | ||||
| -rw-r--r-- | drivers/android/binderfs.c | 15 |
3 files changed, 1 insertions, 18 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c index c463ca4a8fff..ffecf212c2d0 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -6128,7 +6128,7 @@ static int binder_release(struct inode *nodp, struct file *filp) debugfs_remove(proc->debugfs_entry); if (proc->binderfs_entry) { - binderfs_remove_file(proc->binderfs_entry); + simple_recursive_removal(proc->binderfs_entry, NULL); proc->binderfs_entry = NULL; } diff --git a/drivers/android/binder_internal.h b/drivers/android/binder_internal.h index 1ba5caf1d88d..a5fd23dcafcd 100644 --- a/drivers/android/binder_internal.h +++ b/drivers/android/binder_internal.h @@ -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, const struct file_operations *fops, void *data); -extern void binderfs_remove_file(struct dentry *dentry); #else 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; } -static inline void binderfs_remove_file(struct dentry *dentry) {} #endif #ifdef CONFIG_ANDROID_BINDERFS diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 024275dbfdd8..acc946bb1457 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -500,21 +500,6 @@ static struct dentry *binderfs_create_dentry(struct dentry *parent, 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, const struct file_operations *fops, void *data) |