From patchwork Fri Dec 24 19:52:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Nicol X-Patchwork-Id: 432391 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBOJqte3012456 for ; Fri, 24 Dec 2010 19:52:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753028Ab0LXTwv (ORCPT ); Fri, 24 Dec 2010 14:52:51 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:52118 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752974Ab0LXTwu (ORCPT ); Fri, 24 Dec 2010 14:52:50 -0500 Received: by iyi12 with SMTP id 12so6021212iyi.19 for ; Fri, 24 Dec 2010 11:52:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=lruFUIt9gIbZjUYq1yw/fRE04ICFZ6IouSjXcbkc3ko=; b=lHcka4UCr0lGIwrIiAbyRQtgku/eAfggt/3N/9NzMiaFUONLTrRsCt8qcfSsIb8Q7J kS7dT+gxOOtoAoI3+pTP6F6kgLRYHKqdFTdVgkIs1JRCA7K37SVte+WDE7K1Utl6tBFv lzNIyj9hjoEUVuGhrZ8Xu+275Y6Ij9x8H9lus= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=sYQyXswYyMv3oSygO4or9YboaZ4EoWmCL/u+N7jZ9p4VSK2eEl1Zz4BfeWidcj2jBe VXbApDleZrD4F0s49OGgFdzOtYUdlV7ug/qS4RT8b1adxL5wF7nuJuiBhI/4FCWKnAdx aCMwTcbPTQlpwkt6fZ3vGEsON1yqU3TH9RQqI= Received: by 10.231.30.70 with SMTP id t6mr9456640ibc.165.1293220369422; Fri, 24 Dec 2010 11:52:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.206.148 with HTTP; Fri, 24 Dec 2010 11:52:29 -0800 (PST) In-Reply-To: References: From: David Nicol Date: Fri, 24 Dec 2010 13:52:29 -0600 Message-ID: Subject: Re: revised ioctl#21 btrfsprogs patch To: BTRFS MAILING LIST Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 24 Dec 2010 19:52:55 +0000 (UTC) diff --git a/Makefile b/Makefile index 6e6f6c6..555da92 100644 --- a/Makefile +++ b/Makefile @@ -37,12 +37,13 @@ all: version $(progs) manpages version: bash version.sh -btrfs: $(objects) btrfs.o btrfs_cmds.o - gcc $(CFLAGS) -o btrfs btrfs.o btrfs_cmds.o \ +btrfs: $(objects) btrfs.o btrfs_cmds.o iso8601toms.o + gcc $(CFLAGS) -o btrfs btrfs.o btrfs_cmds.o iso8601toms.o \ $(objects) $(LDFLAGS) $(LIBS) -btrfsctl: $(objects) btrfsctl.o - gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS) +btrfsctl: $(objects) btrfsctl.o iso8601toms.o + gcc $(CFLAGS) -o btrfsctl btrfsctl.o iso8601toms.o \ + $(objects) $(LDFLAGS) $(LIBS) btrfs-vol: $(objects) btrfs-vol.o gcc $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS) diff --git a/btrfs.c b/btrfs.c index 46314cf..6b3ebf6 100644 --- a/btrfs.c +++ b/btrfs.c @@ -29,6 +29,7 @@ struct Command { CommandFunction func; /* function which implements the command */ int nargs; /* if == 999, any number of arguments if >= 0, number of arguments, + if > 1000, 1000 more than the _maximum_ number of arguments, if < 0, _minimum_ number of arguments */ char *verb; /* verb */ char *help; /* help lines; form the 2nd onward they are @@ -73,14 +74,19 @@ static struct Command commands[] = { "Set the subvolume of the filesystem which will be mounted\n" "as default." }, - { do_fssync, 1, - "filesystem sync", "\n" - "Force a sync on the filesystem ." + { do_fssync, 1002, + "filesystem sync", "[-dq] \n" + "Force a sync on the filesystem , defaulting to '.'." + }, + { do_wait4clean, 1002, /* require at most two args */ + "filesystem reclaim", "[path [timeout]] \n" + "Wait for cleanup of deleted subvolumes. Path defaults to .\n" + "Timeout in seconds, or add m for minutes.\n" }, { do_resize, 2, "filesystem resize", "[+/-][gkm]|max \n" "Resize the file system. If 'max' is passed, the filesystem\n" - "will occupe all available space on the device." + "will occupy all available space on the device." }, { do_show_filesystem, 999, "filesystem show", "[|