From patchwork Wed Oct 13 14:37:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Nicol X-Patchwork-Id: 250771 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 o9DEcCuE017285 for ; Wed, 13 Oct 2010 14:38:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752745Ab0JMOiF (ORCPT ); Wed, 13 Oct 2010 10:38:05 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:63386 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532Ab0JMOiD convert rfc822-to-8bit (ORCPT ); Wed, 13 Oct 2010 10:38:03 -0400 Received: by iwn5 with SMTP id 5so38930iwn.19 for ; Wed, 13 Oct 2010 07:38:03 -0700 (PDT) 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=qZe9qGZgVRQI4aSSAt+PBGqTPyCswWyMakdD/kxs61A=; b=pAKirz68KpkscqtOGgUN9b0zoluhgi+PK1kfO+FFSyHDJwusovadnnny+jubsNh+kX VUod+ccRDAag4GNkbbVs9rvZWL/cvVc4eYC+UzhG8aul+NBnZDFpXieIa2/RnTAG0pEr nqh9nExkg5ovo290P4UEWhkAbPe7mM0Qd5O6c= 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=aMofo978/4CSJB7WUn+mSCqZ5rb7jNaGMBR1TOEof91YBRkHVl8IhKhTRDNE/fTn9/ YgDPSOEXwibv0wwG+PUfFl5sdonW4EFtvq1ANOOEE3SpEJ9uueo7Tx+WyaVUu+2ZG6mb tf6allY4iWmKt2DE0RR8xWyUR/YcnNRtMRcNY= Received: by 10.42.209.18 with SMTP id ge18mr3895642icb.309.1286980681992; Wed, 13 Oct 2010 07:38:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.152.1 with HTTP; Wed, 13 Oct 2010 07:37:41 -0700 (PDT) From: David Nicol Date: Wed, 13 Oct 2010 09:37:41 -0500 Message-ID: Subject: PATCH: IOCTL#21 progs, including -dq OPTIONS FOR btrfs fi sy 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, 13 Oct 2010 14:38:13 +0000 (UTC) diff --git a/Makefile b/Makefile index 525676e..7442e14 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-list.c b/btrfs-list.c index 7741705..7b92bc0 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -16,6 +16,7 @@  * Boston, MA 021110-1307, USA.  */ +#define _GNU_SOURCE  #ifndef __CHECKER__  #include  #include @@ -34,6 +35,7 @@  #include "transaction.h"  #include "utils.h"  #include "version.h" +#include  /* we store all the roots we find in an rbtree so that we can  * search for them later. diff --git a/btrfs.c b/btrfs.c index ab5e57f..47ce5c2 100644 --- a/btrfs.c +++ b/btrfs.c @@ -15,6 +15,7 @@  */ +#define _GNU_SOURCE  #include  #include  #include @@ -29,6 +30,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 +75,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", "[|