From: Anand Jain <anand.j...@oracle.com>

(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
----------------




Thanks, Anand
 

Anand Jain (2):
  Btrfs-progs: move open_file_or_dir() to utils.c
  Btrfs-progs: add feature to label subvol and snapshot

 Makefile          |    4 ++--
 btrfsctl.c        |    7 ++++---
 btrfslabel.c      |   40 ++++++++++++++++++++++++++++++++++++++++
 btrfslabel.h      |    4 +++-
 cmds-balance.c    |    1 +
 cmds-filesystem.c |   34 +++++++++++++++++++++++++++++-----
 cmds-inspect.c    |    1 +
 cmds-qgroup.c     |    1 +
 cmds-quota.c      |    1 +
 cmds-subvolume.c  |    1 +
 commands.h        |    3 ---
 common.c          |   46 ----------------------------------------------
 ioctl.h           |    2 ++
 utils.c           |   30 ++++++++++++++++++++++++++++--
 utils.h           |    3 +++
 15 files changed, 116 insertions(+), 62 deletions(-)
 delete mode 100644 common.c


  Btrfs: add label to snapshot and subvol

 fs/btrfs/ctree.h       |   14 ++++++++++++++
 fs/btrfs/ioctl.c       |   32 ++++++++++++++++++++++++++++++++
 fs/btrfs/ioctl.h       |    2 ++
 fs/btrfs/root-tree.c   |   44 +++++++++++++++++++++++---------------------
 fs/btrfs/transaction.c |    1 +
 5 files changed, 72 insertions(+), 21 deletions(-)


--
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

Reply via email to