All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fusionio.com>
To: Anand Jain <anand.jain@oracle.com>
Cc: <linux-btrfs@vger.kernel.org>, <jbacik@fusionio.com>,
	<zab@redhat.com>, <dsterba@suse.cz>
Subject: Re: [PATCH 3/4 v2] btrfs-progs: fs show should handle if subvol(s) mounted
Date: Wed, 6 Nov 2013 15:19:11 -0500	[thread overview]
Message-ID: <20131106201911.GF27784@localhost.localdomain> (raw)
In-Reply-To: <1383536745-4635-3-git-send-email-anand.jain@oracle.com>

On Mon, Nov 04, 2013 at 11:45:44AM +0800, Anand Jain wrote:
> as of now with out this patch user would see
> fsinfo per btrfs mount path but which mean multiple
> entry if more than one subvol is mounted of the same
> fsid. so this patch will handle that nicely.
> 
> v2: accepts Zach suggested
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  cmds-filesystem.c |   90 +++++++++++++++++++++++++++++++++--------------------
>  utils.c           |   88 ++++++++++++++++++++++++++++++++++++++++++---------
>  utils.h           |    3 +-
>  3 files changed, 130 insertions(+), 51 deletions(-)
> 
> diff --git a/cmds-filesystem.c b/cmds-filesystem.c
> index d2cad81..f8e8475 100644
> --- a/cmds-filesystem.c
> +++ b/cmds-filesystem.c
> @@ -317,6 +317,29 @@ static int print_one_fs(struct btrfs_ioctl_fs_info_args *fs_info,
>  	return 0;
>  }
>  
> +static void handle_print(char *mnt, char *label)
> +{
> +	int fd;
> +	struct btrfs_ioctl_fs_info_args fs_info_arg;
> +	struct btrfs_ioctl_dev_info_args *dev_info_arg = NULL;
> +	struct btrfs_ioctl_space_args *space_info_arg;
> +
> +	if (get_fs_info(mnt, &fs_info_arg, &dev_info_arg)) {
> +		fprintf(stdout, "ERROR: get_fs_info failed\n");
> +		return;
> +	}
> +
> +	fd = open(mnt, O_RDONLY);
> +	if (fd > 0 && !get_df(fd, &space_info_arg)) {

0 is a valid fd.  Thanks,

Josef

  reply	other threads:[~2013-11-06 20:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04  3:45 [PATCH 1/4] btrfs-progs: make filesystem show by label work Anand Jain
2013-11-04  3:45 ` [PATCH 2/4 v2] btrfs-progs: mechanism to fetch fsinfo from btrfs-control Anand Jain
2013-11-06 20:13   ` Josef Bacik
2013-11-07  9:53     ` Anand Jain
2013-11-04  3:45 ` [PATCH 3/4 v2] btrfs-progs: fs show should handle if subvol(s) mounted Anand Jain
2013-11-06 20:19   ` Josef Bacik [this message]
2013-11-07  9:54     ` Anand Jain
2013-11-04  3:45 ` [PATCH 4/4] btrfs-progs: lblkid wouldn't find non mapper path input Anand Jain
2013-11-04  4:36   ` [PATCH 4/4 v2] " Anand Jain
2013-11-06 20:20   ` [PATCH 4/4] " Josef Bacik
2013-11-07  9:54     ` Anand Jain
2013-11-07 10:06 ` [PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3 Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131106201911.GF27784@localhost.localdomain \
    --to=jbacik@fusionio.com \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.