Mark btrfsctl deprecated
Hi Chris,
what do you think about marking deprecate the "btrfsctl" program ?
A lot of people make patch involving both btrfs command and btrfsctl command, spending a lot of effort.
Initially we can put a warning in the btrfctl command which suggest to use the btrfs command. and after XX month (six ?) we could remouve the command at all. The same for the other utilities like btrfs-show, btrfs-vol....
Of course this is applicable if there is no evidence of regression of btrfs vs btrfsctl.
Regards
G.Baroncelli
I am certainly not in a position to answer for Chris Mason, but I am happy to share my response to the question, coming from a perspective of being somewhat obsessive about not breaking back-compat.
Let's not. As I am certainly within the "lot of people" in question, having just done exactly that, I found the two programs -- with very different styles -- to not be much of a block, and providing two examples instead of one of code that invokes an ioctl seems fine.
Ideally, everyone who needs to use an ioctl will simply write and compile a C program that does what they need -- ha ha.
I see no reason to break legacy code (such as it is) that uses btrfsctl instead of btrfs for a user-space tool to invoke ioctls. Calling the tool "btrfs" is actually a little confusing.
Quoted 16 lines · On Fri, Oct 22, 2010 at 7:02 AM, Goffredo Baroncelli <[email protected]>…
Hi Chris,
what do you think about marking deprecate the "btrfsctl" program ?
A lot of people make patch involving both btrfs command and btrfsctl command, spending a lot of effort.
Initially we can put a warning in the btrfctl command which suggest to use the btrfs command. and after XX month (six ?) we could remouve the command at all. The same for the other utilities like btrfs-show, btrfs-vol....
Of course this is applicable if there is no evidence of regression of btrfs vs btrfsctl.
Regards
G.Baroncelli
Quoted 3 lines · David Nicol
I am certainly not in a position to answer for Chris Mason, but I am happy to share my response to the question, coming from a perspective of being somewhat obsessive about not breaking back-compat.
I agree with this sentence; in fact I suggested to mark the program "deprecated" with a warning and to remove it after some months.
Quoted 5 lines
Let's not. As I am certainly within the "lot of people" in question, having just done exactly that, I found the two programs -- with very different styles -- to not be much of a block, and providing two examples instead of one of code that invokes an ioctl seems fine.
If you need an example program put it into a directory called "example"... for example :)
Quoted 7 lines
Ideally, everyone who needs to use an ioctl will simply write and compile a C program that does what they need -- ha ha.
I see no reason to break legacy code (such as it is) that uses btrfsctl instead of btrfs for a user-space tool to invoke ioctls. Calling the tool "btrfs" is actually a little confusing.
Ideally "btrfs" had the goal to replace "btrfsctl" (and some other programs). This for a lot of reason: btrfctl is buggy, un-maintainable, doesn't handle very well a lot of errors..
A lot of posts in this mailing lists reports errors due to a misunderstanding of the syntax and behavior of btrfs filesystem and btrfsctl. I hoped writing "btrfs" to improve this situation.
Every patch needs a checking and is a potential source of conflicts. Why double the effort maintaining two equivalent programs ?
The package btrfs-tools needs a lot of care:
- the INSTALL file still reports that is not possible to remove a subvolume
- a lot of program are not documented (what is the meaning of btrfs-zero-log ?)
- "btrfs dev scan" and "btrfs -a" try to read CDROM and Floppy looking for a btrfs filesystem: only waste of time
- [...]
I think that is better to improve the btrfs-progs and not to update btrfsctl.
Only my 2C
regards
G.Baroncelli
Quoted 10 lines
Quoted 5 lines · On Fri, Oct 22, 2010 at 7:02 AM, Goffredo Baroncelli <[email protected]>…
Hi Chris,
what do you think about marking deprecate the "btrfsctl" program ?
A lot of people make patch involving both btrfs command and btrfsctl
command,
Quoted 3 lines
Quoted 3 lines
spending a lot of effort.
Initially we can put a warning in the btrfctl command which suggest to use
the
Quoted 1 line
Quoted 1 line
btrfs command. and after XX month (six ?) we could remouve the command at
all.
Quoted 3 lines
Quoted 3 lines
The same for the other utilities like btrfs-show, btrfs-vol....
Of course this is applicable if there is no evidence of regression of
btrfs vs
Quoted 9 lines
Quoted 4 lines
btrfsctl.
Regards
G.Baroncelli--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <[email protected]> Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512
Quoted 10 lines · Goffredo Baroncelli
The package btrfs-tools needs a lot of care:
- the INSTALL file still reports that is not possible to remove a subvolume
- a lot of program are not documented (what is the meaning of btrfs-zero-log ?)
- "btrfs dev scan" and "btrfs -a" try to read CDROM and Floppy looking for a btrfs filesystem: only waste of time
- [...]I think that is better to improve the btrfs-progs and not to update btrfsctl.
I'd agree, the btrfsctl command is more than a little awkward, and the btrfs command is pretty much better in every way.
-chris
RFC PATCH 1/1 Deprecate btrfsctl, btrfs-show, btrfs-vol
Hi all,
the patch below deprecates the following programs
* btrfsctl
* btrfs-vol
* btrfs-show
the reason is simple, these programs are superseded by the btrfs utility, both in terms of documentation, usability and bug. The goal is to avoid to duplicate codes and avoid update two programs.
What I am asking here is a comment about the WARNINGs and suggestions about the policy to adopt in deprecating these programs.
My suggestions are:
- put a warning in the documentation and in the program (see below)
- "freeze" the programs avoiding to add new functionality to the "old utilities".
- after six month remove the old utilities programs from the btrfs-progs package
The aim is to support the old systems but discourage to use the old tools.
If btrfs would show regression respect the old tools, I am happy to know and I will work to solve the issues.
The patch adds a warning in the man pages, in the INSTALL file and in the programs.
$ ./btrfsctl
**
** WARNING: this program is considered deprecated
** Please consider to switch to the btrfs utility
**
no valid commands given
usage: btrfsctl [ -d file|dir] [ -s snap_name subvol|tree ]
[-r size] [-A device] [-a] [-c] [-D dir .]
-d filename: defragments one file
-d directory: defragments the entire Btree
-s snap_name dir: creates a new snapshot of dir
-S subvol_name dir: creates a new subvolume
-r [+-]size[gkm]: resize the FS by size amount
-A device: scans the device file for a Btrfs filesystem
-a: scans all devices for Btrfs filesystems
-c: forces a single FS sync
-D: delete snapshot
-m [tree id] directory: set the default mounted subvolume to the [tree id] or the
directoryBelow the patch, but it is possible to pull the changes from:
http://cassiopea.homelinux.net/git/btrfs-progs-unstable-all.git
branch
btrfs-deprecated
Comments are welcome.
G.Baroncelli
INSTALL | 5 +++++ btrfs-show.c | 5 +++++ btrfs-vol.c | 5 +++++ btrfsctl.c | 5 +++++ man/btrfs-show.8.in | 3 +++ man/btrfsctl.8.in | 3 +++ 6 files changed, 26 insertions(+)
INSTALL +0 -0
INSTALL +5 -0
@@ -24,10 +24,15 @@ e2fsprogs-devel from various distros. Building the utilities is just make ; make install. The programs go into /usr/local/bin. The commands available are: +btrfs: control program to manage the filesystem. + mkfs.btrfs: create a filesystem btrfsctl: control program to create snapshots and subvolumes: + NOTE: this utility is deprecated. Please consider to switch + to the btrfs utility (see above) + mount /dev/sda2 /mnt btrfsctl -s new_subvol_name /mnt btrfsctl -s snapshot_of_default /mnt/default
btrfs-show.c +5 -0
@@ -117,6 +117,11 @@ int main(int ac, char **av)int ret;int option_index =0 ; +printf ("**\n" +"** WARNING: this program is considered deprecated\n" +"** Please consider to switch to the btrfs utility\n" +"**\n" ); +while (1 ) {int c; c = getopt_long(ac, av, "", long_options,
btrfs-vol.c +5 -0
@@ -78,6 +78,11 @@ int main(int ac, char **av)struct btrfs_ioctl_vol_args args;u64 dev_block_count =0 ; +printf ("**\n" +"** WARNING: this program is considered deprecated\n" +"** Please consider to switch to the btrfs utility\n" +"**\n" ); +while (1 ) {int c; c = getopt_long(ac, av, "a:br:", long_options,
btrfsctl.c +5 -0
@@ -107,6 +107,11 @@ int main(int ac, char **av)char *fullpath;u64 objectid =0 ; +printf ("**\n" +"** WARNING: this program is considered deprecated\n" +"** Please consider to switch to the btrfs utility\n" +"**\n" ); +if (ac ==2 &&strcmp (av[1 ],"-a" ) ==0 ) {fprintf (stderr,"Scanning for Btrfs filesystems\n" );btrfs_scan_one_dir ("/dev" ,1 );
man/btrfs-show.8.in +3 -0
@@ -3,6 +3,9 @@ btrfs-show \- scan the /dev directory for btrfs partitions and print results. .SH SYNOPSIS .B btrfs-show +.SH NOTE +.B btrfs-show +is deprecated. Please consider to switch to the btrfs utility. .SH DESCRIPTION .B btrfs-show is used to scan the /dev directory for btrfs partitions and display brief
man/btrfsctl.8.in +3 -0
@@ -10,6 +10,9 @@ btrfsctl \- control a btrfs filesystem [ \fB \-A\fP\fI device\fP ] [ \fB \-a\fP ] [ \fB \-c\fP ] +.SH NOTE +.B btrfs-show +is deprecated. Please consider to switch to the btrfs utility. .SH DESCRIPTION .B btrfsctl is used to control the filesystem and the files and directories stored. It is the tool to
create a new snapshot for the filesystem.
Quoted 22 lines · Chris Mason
Quoted 10 lines · Goffredo Baroncelli
The package btrfs-tools needs a lot of care:
- the INSTALL file still reports that is not possible to remove a subvolume
- a lot of program are not documented (what is the meaning of btrfs-zero-log ?)
- "btrfs dev scan" and "btrfs -a" try to read CDROM and Floppy looking for a btrfs filesystem: only waste of time
- [...]I think that is better to improve the btrfs-progs and not to update btrfsctl.
I'd agree, the btrfsctl command is more than a little awkward, and the btrfs command is pretty much better in every way.
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <[email protected]> Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512