diff options
| author | Misono Tomohiro <misono.tomohiro@jp.fujitsu.com> | 2018-04-18 11:34:52 +0900 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2018-05-28 18:07:18 +0200 |
| commit | f60a2364a4eee4d8c335775a3a0c39aa955aa6b7 (patch) | |
| tree | f6652ea895eb50a948f0ed2e703a07d5f02b3c0b /tools/perf/scripts/python | |
| parent | btrfs: Move may_destroy_subvol() from ioctl.c to inode.c (diff) | |
| download | linux-f60a2364a4eee4d8c335775a3a0c39aa955aa6b7.tar.gz linux-f60a2364a4eee4d8c335775a3a0c39aa955aa6b7.zip | |
btrfs: Factor out the main deletion process from btrfs_ioctl_snap_destroy()
Factor out the second half of btrfs_ioctl_snap_destroy() as
btrfs_delete_subvolume(), which performs some subvolume specific checks
before deletion:
1. send is not in progress
2. the subvolume is not the default subvolume
3. the subvolume does not contain other subvolumes
and actual deletion process. btrfs_delete_subvolume() requires
inode_lock for both @dir and inode of @dentry. The remaining part of
btrfs_ioctl_snap_destroy() is mainly permission checks.
Note that call of d_delete() is not included in btrfs_delete_subvolume()
as this function will also be used by btrfs_rmdir() to delete an empty
subvolume and in that case d_delete() is called in VFS layer.
As a result, btrfs_unlink_subvol() and may_destroy_subvol()
become static functions. No functional changes.
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ minor comment updates ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
