From: Anand Jain <anand.j...@oracle.com> v2->v3: Changes are in the btrfs kernel patch only, which accepts review comments by Miao. v1->v2: This v2 patch accepts the review comments on the btrfs kernel changes by Jan. and Moved the get and set subvol label to under subvol sub-cmd eg: btrfs subvolume label /btrfs/ss5 btrfs su la /btrfs/ss5 "ss5-label" btrfs su la /btrfs/ss5 ss5-label
v1: (This patch is for the review/test not yet for the integration). Here is an implementation of the feature to add label to the subvolume and snapshots. Which would help sysadmin to better manager the subvol and snapshots. This can be done in two ways, one - using attr which is user land only changes but drawback is able to change the label using the non btrfs cli. And the other way is to add a member to btrfs_root_item in the btrfs kernel to hold the label info for each snapshot and subvol. The drawback here is having to introduce V3 version of this structure. If there is any better way pls do share. The patch code is for the review. Any comments/suggestion welcome. Below is a demo of this new feature. ------------ btrfs fi label -t /btrfs/sv1 "Prod-DB" btrfs fi label -t /btrfs/sv1 Prod-DB btrfs su snap /btrfs/sv1 /btrfs/snap1-sv1 Create a snapshot of '/btrfs/sv1' in '/btrfs/snap1-sv1' btrfs fi label -t /btrfs/snap1-sv1 btrfs fi label -t /btrfs/snap1-sv1 "Prod-DB-sand-box-testing" btrfs fi label -t /btrfs/snap1-sv1 Prod-DB-sand-box-testing ---------------- Anand Jain (3): Btrfs-progs: move open_file_or_dir() to utils.c Btrfs-progs: add feature to label subvol and snapshot Btrfs-progs: cmd option to show or set the subvol label Makefile | 4 ++-- btrfsctl.c | 7 ++++--- btrfslabel.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ btrfslabel.h | 4 +++- cmds-balance.c | 1 + cmds-inspect.c | 1 + cmds-qgroup.c | 1 + cmds-quota.c | 1 + cmds-subvolume.c | 38 ++++++++++++++++++++++++++++++++++++++ commands.h | 3 --- common.c | 46 ---------------------------------------------- ctree.h | 4 +++- ioctl.h | 2 ++ man/btrfs.8.in | 6 ++++++ print-tree.c | 2 ++ utils.c | 30 ++++++++++++++++++++++++++++-- utils.h | 3 +++ 17 files changed, 140 insertions(+), 58 deletions(-) delete mode 100644 common.c -- 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