From mboxrd@z Thu Jan 1 00:00:00 1970 From: Goffredo Baroncelli Subject: [PATCH] Add the "btrfs filesystem label" command Date: Mon, 13 Sep 2010 21:24:14 +0200 Message-ID: <201009132124.14402.kreijack@inwind.it> Reply-To: kreijack@inwind.it Mime-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2372059.zXHNtEVITe"; protocol="application/pgp-signature"; micalg=pgp-sha1 Cc: Felix Blanke To: chris.mason@oracle.com, linux-btrfs@vger.kernel.org Return-path: List-ID: --nextPart2372059.zXHNtEVITe Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, this patch adds the command "btrfs filesystem label" to change (or show) th= e=20 label of a filesystem. This patch is a subset of the one written previously by Morey Roof. I=20 included the user space part only. So it is possible only to change/show a= =20 label of a *single device* and *unounted* filesystem. The reason of excluding the kernel space part, is to simplify the patch in= =20 order to speed the check and then the merging of the patch itself. In fact = I=20 have to point out that in the past there was almost three attempts to propo= se=20 this patch, without success neither complaints. Chris, let me know how you want to proceed. I know that you are very busy,= =20 and you prefer to work to stabilize btrfs instead adding new feature. But I= =20 think that changing a label is a *essential* feature for a filesystem=20 managing tool. Think about a mount by LABEL. To show a label $ btrfs filesystem label To set a label $ btrfs filesystem label Please guys, give a look to the source.=20 Comments are welcome. You can pull the source from the branch "label" of the repository=20 http://cassiopea.homelinux.net/git/btrfs-progs-unstable-all.git Regards G.Baroncelli diff --git a/Makefile b/Makefile index 525676e..c06e512 100644 =2D-- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CFLAGS =3D -g -Werror -Os objects =3D ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \ root-tree.o dir-item.o file-item.o inode-item.o \ inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o \ =2D volumes.o utils.o btrfs-list.o + volumes.o utils.o btrfs-list.o btrfslabel.o =20 # CHECKFLAGS=3D-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \ diff --git a/btrfs.c b/btrfs.c index ab5e57f..ab0a9da 100644 =2D-- a/btrfs.c +++ b/btrfs.c @@ -95,6 +95,10 @@ static struct Command commands[] =3D { "filesystem balance", "\n" "Balance the chunks across the device." }, + { do_change_label, -1, + "filesystem label", " [