]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kill binderfs_remove_file()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 May 2024 03:15:55 +0000 (23:15 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 3 Jul 2025 02:36:52 +0000 (22:36 -0400)
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>
drivers/android/binder.c
drivers/android/binder_internal.h
drivers/android/binderfs.c

index c463ca4a8fff81967ea7d8d83930ae19dc34ce6b..ffecf212c2d047a54f91bbcf6f3ec366e8c783f2 100644 (file)
@@ -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;
        }
 
index 1ba5caf1d88d9d8cd16ff692b68ab8cb2b68f8a0..a5fd23dcafcdd48b2e8684147d1df68bf0e47224 100644 (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,
                                           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
index 024275dbfdd8944462e3939c97cc9ab88f3ea80b..acc946bb1457f16cba11f966fb1194ce9f0b476c 100644 (file)
@@ -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)