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
Showing the changes to include/linux (3 of 9 files). Show all
Unified · Split
| @@ -83,7 +83,7 @@ struct dentry *debugfs_create_automount(const char *name, · 82 unmodified lines | ||
| 83 | 83 | void *data); |
| 84 | 84 | |
| 85 | 85 | void debugfs_remove(struct dentry *dentry); |
| 86 | −void debugfs_remove_recursive(struct dentry *dentry); | |
| 86 | +#define debugfs_remove_recursive debugfs_remove | |
| 87 | 87 | |
| 88 | 88 | const struct file_operations *debugfs_real_fops(const struct file *filp); |
| 89 | 89 | |
| @@ -3318,6 +3318,8 @@ extern int simple_unlink(struct inode *, struct dentry *); · 3317 unmodified lines | ||
| 3318 | 3318 | extern int simple_rmdir(struct inode *, struct dentry *); |
| 3319 | 3319 | extern int simple_rename(struct inode *, struct dentry *, |
| 3320 | 3320 | struct inode *, struct dentry *, unsigned int); |
| 3321 | +extern void simple_recursive_removal(struct dentry *, | |
| 3322 | + void (*callback)(struct dentry *)); | |
| 3321 | 3323 | extern int noop_fsync(struct file *, loff_t, loff_t, int); |
| 3322 | 3324 | extern int noop_set_page_dirty(struct page *page); |
| 3323 | 3325 | extern void noop_invalidatepage(struct page *page, unsigned int offset, |
| @@ -28,7 +28,6 @@ struct dentry *tracefs_create_file(const char *name, umode_t mode, · 27 unmodified lines | ||
| 28 | 28 | struct dentry *tracefs_create_dir(const char *name, struct dentry *parent); |
| 29 | 29 | |
| 30 | 30 | void tracefs_remove(struct dentry *dentry); |
| 31 | −void tracefs_remove_recursive(struct dentry *dentry); | |
| 32 | 31 | |
| 33 | 32 | struct dentry *tracefs_create_instance_dir(const char *name, struct dentry *parent, |
| 34 | 33 | int (*mkdir)(const char *name), |