From patchwork Wed Dec 15 22:18:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Nicol X-Patchwork-Id: 414741 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 oBFMJcf8030983 for ; Wed, 15 Dec 2010 22:19:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753138Ab0LOWTN (ORCPT ); Wed, 15 Dec 2010 17:19:13 -0500 Received: from mail-iw0-f180.google.com ([209.85.214.180]:61010 "EHLO mail-iw0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039Ab0LOWTL convert rfc822-to-8bit (ORCPT ); Wed, 15 Dec 2010 17:19:11 -0500 Received: by iwn37 with SMTP id 37so2816142iwn.11 for ; Wed, 15 Dec 2010 14:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=uDJz7VgNoCgLHrUdvZ8t/DFyKy8j+gbSAjAO4MVvNhY=; b=owXn1CObmUvlkoRrwhuc+kHeFOmU46YB8w5XoCq8bEP5MexJzHtJKw/nHpVOLyKoOd DCOJscgn4d8PcctOwm5TGwTnyGtUR7X9ESQmPVgxfOkenx+Ij04wAltbpvCIeE9vSV6l qNI65BOzYoie2Ic6RhQLcBZ7tBNe6juuAaZ1E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=TciipVJihEj3bRlSUnqgVodmnWf4blo8+hmZFQjklzxKc7MEjIkY7zrsVIvPYM4x6O ivok8ZtDIwC8hxnQmymotykkShtVS71KAkIfCR4xuq74eMJj8mZ0Mxkd/1thcRqrCuiW qCJ3gXKvcmYG3Mn2lEHBRbHRtTveQedFjzkR0= Received: by 10.231.14.134 with SMTP id g6mr5442913iba.65.1292451550745; Wed, 15 Dec 2010 14:19:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.206.148 with HTTP; Wed, 15 Dec 2010 14:18:50 -0800 (PST) From: David Nicol Date: Wed, 15 Dec 2010 16:18:50 -0600 Message-ID: Subject: 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]); Wed, 15 Dec 2010 22:19:41 +0000 (UTC) diff --git a/Makefile b/Makefile index d65f6a2..b8ef1f2 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", "[|