changelog: v3 -> v4 ... Reorganize patches and updates commit log. No code change in total v2 -> v3 ... Use if-else block instead of two if blocks and add Tested-by tag in 2nd patch v1 -> v2 ... Split the patch to hopefully make review easier
Note: I will send a xfstest if this series is merged. This series changes the behavior of rmdir(2) and allow it to delete an empty subvolume. 1st to 3rd patches refactor btrfs_ioctl_snap_destroy() and no functional change happens. btrfs_ioctl_snap_destroy() is roughly comprised of two parts. The first part is permission check of the (parent) subvolume. The second part is additional check (1. send is not in progress. 2. the subvolume is not a default subvolume. 3. the subvolume does not contain other subvoume) and actual deletion process. The aim of 1st to 3rd patches is to extract the second part as btrfs_delete_subvolume(). 4th patch is just one line but this changes the behavior of rmdir(2) by calling btrfs_delete_subvolume(). For rmdir(2), permission check is already done in vfs layer. Tomohiro Misono (4): btrfs: move may_destroy_subvol() from ioctl.c to inode.c btrfs: Add definition of btrfs_delete_subvolume() btrfs: Refactor btrfs_ioctl_snap_destroy() by using btrfs_delete_subvolume() btrfs: Allow rmdir(2) to delete an empty subvolume fs/btrfs/ctree.h | 5 +- fs/btrfs/inode.c | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- fs/btrfs/ioctl.c | 185 +-------------------------------------------------- 3 files changed, 198 insertions(+), 189 deletions(-) -- 2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html