[PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3

2013-11-07 Thread Anand Jain
need fsinfo from btrfs-control that is when mount path is not known. current method of going through each mount points isn't efficient, and multiple subvol of a fsid could be mounted means extra logic to handle that. Further this will help to revamp check_mounted() (planned) check_mounted is

[PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3

2013-11-07 Thread Anand Jain
need fsinfo from btrfs-control that is when mount path is not known. current method of going through each mount points isn't efficient, and multiple subvol of a fsid could be mounted means extra logic to handle that. Further this will help to revamp check_mounted() (planned) check_mounted is

Re: [PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3

2013-11-07 Thread Stefan Behrens
On Thu, 7 Nov 2013 18:01:41 +0800, Anand Jain wrote: + *out_fslist = malloc(sz); + if (*out_fslist == NULL) { + ret = -ENOMEM; + goto out; + } + memcpy(*out_fslist, fslist, sz); + ret = 0; +out: + free(fsargs_saved); + close(fd); +

Re: [PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3

2013-11-07 Thread Anand Jain
On 11/07/2013 06:04 PM, Stefan Behrens wrote: On Thu, 7 Nov 2013 18:01:41 +0800, Anand Jain wrote: + *out_fslist = malloc(sz); + if (*out_fslist == NULL) { + ret = -ENOMEM; + goto out; + } + memcpy(*out_fslist, fslist, sz); + ret = 0;