Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-21 Thread Anand Jain
TREE_SEARCH ioctl doesn't help in this case the dev item don't provide all the info that btrfs-progs might need in the long run (and even the current needs). Thanks, Anand On 06/11/2013 10:24 PM, Josef Bacik wrote: On Mon, Jun 10, 2013 at 08:59:15AM -0600, Anand Jain wrote: This adds two

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-11 Thread anand jain
On 06/11/2013 03:40 AM, Josef Bacik wrote: On Mon, Jun 10, 2013 at 08:59:15AM -0600, Anand Jain wrote: This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure from the kernel respectively. The information in these structure

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-11 Thread Josef Bacik
On Tue, Jun 11, 2013 at 07:10:12AM -0600, anand jain wrote: On 06/11/2013 03:40 AM, Josef Bacik wrote: On Mon, Jun 10, 2013 at 08:59:15AM -0600, Anand Jain wrote: This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-11 Thread anand jain
On 06/11/2013 04:30 AM, Zach Brown wrote: On Mon, Jun 10, 2013 at 10:59:15PM +0800, Anand Jain wrote: This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure from the kernel respectively. Why not just use sysfs to export the

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-11 Thread Josef Bacik
On Mon, Jun 10, 2013 at 08:59:15AM -0600, Anand Jain wrote: This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure from the kernel respectively. The information in these structure are useful to report the device/fs

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-11 Thread Zach Brown
1) Have a simple single fixed input structure for each ioctl. Maybe with some extra padding and a flags argument if you think stuff is going to be added over time. No generic header. No casting. The ioctl number defines the input structure. If you need a different structure later, use a

[PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-10 Thread Anand Jain
This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure from the kernel respectively. The information in these structure are useful to report the device/fs information in line with the kernel operations and thus immediately

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-10 Thread Josef Bacik
On Mon, Jun 10, 2013 at 08:59:15AM -0600, Anand Jain wrote: This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure from the kernel respectively. The information in these structure are useful to report the device/fs

Re: [PATCH 2/2 v2] btrfs: add framework to read fs info and dev info from the kernel

2013-06-10 Thread Zach Brown
On Mon, Jun 10, 2013 at 10:59:15PM +0800, Anand Jain wrote: This adds two ioctl BTRFS_IOC_GET_FSIDS and BTRFS_IOC_GET_DEVS which reads the btrfs_fs_devices and btrfs_device structure from the kernel respectively. Why not just use sysfs to export the device lists? The information in these