Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-30 Thread Lennart Poettering
On Thu, 30.09.10 21:59, Kay Sievers (kay.siev...@vrfy.org) wrote: > > So my question is, is this what we want?  Do I just need to quit bitching > > and > > make it work?  Or am I doing something wrong?  This is a completely new > > area for > > me so I'm just looking around at what md/dm does an

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-30 Thread Kay Sievers
On Thu, Sep 30, 2010 at 21:48, Josef Bacik wrote: > On Wed, Sep 29, 2010 at 07:43:27PM -0400, Christoph Hellwig wrote: >> On Wed, Sep 29, 2010 at 10:04:31AM +0200, Kay Sievers wrote: >> > On Wed, Sep 29, 2010 at 09:25, Ric Wheeler wrote: >> > >> > > Second question is why is checking in /sys a bi

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-30 Thread Josef Bacik
On Wed, Sep 29, 2010 at 07:43:27PM -0400, Christoph Hellwig wrote: > On Wed, Sep 29, 2010 at 10:04:31AM +0200, Kay Sievers wrote: > > On Wed, Sep 29, 2010 at 09:25, Ric Wheeler wrote: > > > > > Second question is why is checking in /sys a big deal, would ??you prefer > > > an > > > interface lik

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-30 Thread Andi Kleen
Kay Sievers writes: > > Yeah, we thought about that too, but a btrfs mount does not show up as > a block device, like md/dm, so there is no place for a slaves/ > directory in /sys with the individual disks listed. How could be solve > that? Create some fake blockdev for every btrfs mount, but tha

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-30 Thread Josef Bacik
On Thu, Sep 30, 2010 at 09:43:00AM +0200, Kay Sievers wrote: > On Thu, Sep 30, 2010 at 01:43, Christoph Hellwig wrote: > > On Wed, Sep 29, 2010 at 10:04:31AM +0200, Kay Sievers wrote: > >> On Wed, Sep 29, 2010 at 09:25, Ric Wheeler wrote: > >> > >> > Second question is why is checking in /sys a b

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-30 Thread Kay Sievers
On Thu, Sep 30, 2010 at 01:43, Christoph Hellwig wrote: > On Wed, Sep 29, 2010 at 10:04:31AM +0200, Kay Sievers wrote: >> On Wed, Sep 29, 2010 at 09:25, Ric Wheeler wrote: >> >> > Second question is why is checking in /sys a big deal, would ??you prefer >> > an >> > interface like we did for ali

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-29 Thread Josef Bacik
On Wed, Sep 29, 2010 at 07:43:27PM -0400, Christoph Hellwig wrote: > On Wed, Sep 29, 2010 at 10:04:31AM +0200, Kay Sievers wrote: > > On Wed, Sep 29, 2010 at 09:25, Ric Wheeler wrote: > > > > > Second question is why is checking in /sys a big deal, would ??you prefer > > > an > > > interface lik

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-29 Thread Christoph Hellwig
On Wed, Sep 29, 2010 at 10:04:31AM +0200, Kay Sievers wrote: > On Wed, Sep 29, 2010 at 09:25, Ric Wheeler wrote: > > > Second question is why is checking in /sys a big deal, would ??you prefer an > > interface like we did for alignment in libblkid? > > It's about knowing what's behind the 'nodev

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-29 Thread Kay Sievers
On Wed, Sep 29, 2010 at 01:25, Christoph Hellwig wrote: > On Tue, Sep 28, 2010 at 04:53:16PM -0400, Josef Bacik wrote: >> This was a request from the systemd guys.  They need a quick and easy way to >> get >> all devices attached to a Btrfs filesystem in order to check if any of the >> disks >>

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-29 Thread Ric Wheeler
On 09/29/2010 08:59 PM, Lennart Poettering wrote: On Wed, 29.09.10 16:25, Ric Wheeler (rwhee...@redhat.com) wrote: This in fact is how all current readahead implementations work, be it the fedora, the suse or ubuntu's readahead or Arjan's sreadahead. What's new is that in the systemd case we t

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-29 Thread Lennart Poettering
On Wed, 29.09.10 16:25, Ric Wheeler (rwhee...@redhat.com) wrote: > >This in fact is how all current readahead implementations work, be it > >the fedora, the suse or ubuntu's readahead or Arjan's sreadahead. What's > >new is that in the systemd case we try to test for ssd/rotating > >properly, inst

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-29 Thread Kay Sievers
On Wed, Sep 29, 2010 at 09:25, Ric Wheeler wrote: > Second question is why is checking in /sys a big deal, would  you prefer an > interface like we did for alignment in libblkid? It's about knowing what's behind the 'nodev' major == 0 of a btrfs mount. There is no way to get that from /sys or an

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-29 Thread Ric Wheeler
On 09/29/2010 09:19 AM, Lennart Poettering wrote: On Tue, 28.09.10 20:08, Josef Bacik (jo...@redhat.com) wrote: On Tue, Sep 28, 2010 at 07:25:13PM -0400, Christoph Hellwig wrote: On Tue, Sep 28, 2010 at 04:53:16PM -0400, Josef Bacik wrote: This was a request from the systemd guys. They need

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-28 Thread Lennart Poettering
On Tue, 28.09.10 20:08, Josef Bacik (jo...@redhat.com) wrote: > > On Tue, Sep 28, 2010 at 07:25:13PM -0400, Christoph Hellwig wrote: > > On Tue, Sep 28, 2010 at 04:53:16PM -0400, Josef Bacik wrote: > > > This was a request from the systemd guys. They need a quick and easy way > > > to get > > >

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-28 Thread Josef Bacik
On Wed, Sep 29, 2010 at 12:28:51AM +0200, Goffredo Baroncelli wrote: > Hi Josef, > > what about using your ioctl to exporting also other info ? For example devid, > size, bytes, uuid ... > > I know that btrfs filesystem-show does the same, but it reads the partition > (the disk) instead of quer

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-28 Thread Josef Bacik
On Tue, Sep 28, 2010 at 07:25:13PM -0400, Christoph Hellwig wrote: > On Tue, Sep 28, 2010 at 04:53:16PM -0400, Josef Bacik wrote: > > This was a request from the systemd guys. They need a quick and easy way > > to get > > all devices attached to a Btrfs filesystem in order to check if any of the

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-28 Thread Christoph Hellwig
On Tue, Sep 28, 2010 at 04:53:16PM -0400, Josef Bacik wrote: > This was a request from the systemd guys. They need a quick and easy way to > get > all devices attached to a Btrfs filesystem in order to check if any of the > disks > are SSD for...something, I didn't ask :). I've tested this wit

Re: [PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem

2010-09-28 Thread Goffredo Baroncelli
Hi Josef, what about using your ioctl to exporting also other info ? For example devid, size, bytes, uuid ... I know that btrfs filesystem-show does the same, but it reads the partition (the disk) instead of query the filesystem. That means: - It work even for unmounted filesystem (which is goo