History

Merge branch 'work.recursive_removal' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs recursive removal updates from Al Viro: "We have quite a few places where synthetic filesystems do an equivalent of 'rm -rf', with varying amounts of code duplication, wrong locking, etc. That really ought to be a library helper. Only debugfs (and very similar tracefs) are converted here - I have more conversions, but they'd never been in -next, so they'll have to wait" * 'work.recursive_removal' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: simple_recursive_removal(): kernel-side rm -rf for ramfs-style filesystems

Linus Torvalds committed 6 years ago

Commit 72f582f2 parents bddea11 a3d1e7e9 files · +104 −218Browse files

Showing the changes to include/linux (3 of 9 files). Show all

Unified · Split

3 files
  1. include/linux/debugfs.h +1 −1
  2. include/linux/fs.h +2 −0
  3. include/linux/tracefs.h +0 −1
include/linux/debugfs.h+1−1
@@ -83,7 +83,7 @@ struct dentry *debugfs_create_automount(const char *name, · 82 unmodified lines
8383 void *data);
8484
8585 void debugfs_remove(struct dentry *dentry);
86−void debugfs_remove_recursive(struct dentry *dentry);
86+#define debugfs_remove_recursive debugfs_remove
8787
8888 const struct file_operations *debugfs_real_fops(const struct file *filp);
8989
include/linux/fs.h+2−0
@@ -3318,6 +3318,8 @@ extern int simple_unlink(struct inode *, struct dentry *); · 3317 unmodified lines
33183318 extern int simple_rmdir(struct inode *, struct dentry *);
33193319 extern int simple_rename(struct inode *, struct dentry *,
33203320 struct inode *, struct dentry *, unsigned int);
3321+extern void simple_recursive_removal(struct dentry *,
3322+ void (*callback)(struct dentry *));
33213323 extern int noop_fsync(struct file *, loff_t, loff_t, int);
33223324 extern int noop_set_page_dirty(struct page *page);
33233325 extern void noop_invalidatepage(struct page *page, unsigned int offset,
include/linux/tracefs.h+0−1
@@ -28,7 +28,6 @@ struct dentry *tracefs_create_file(const char *name, umode_t mode, · 27 unmodified lines
2828 struct dentry *tracefs_create_dir(const char *name, struct dentry *parent);
2929
3030 void tracefs_remove(struct dentry *dentry);
31−void tracefs_remove_recursive(struct dentry *dentry);
3231
3332 struct dentry *tracefs_create_instance_dir(const char *name, struct dentry *parent,
3433 int (*mkdir)(const char *name),