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.j...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to