Re: /sys/block [was: [PATCH 007 of 7] md: Get name for block device in sysfs]

2007-12-17 Thread Michael Tokarev
Michael Tokarev wrote: > Kay Sievers wrote: >> On Mon, 2007-12-17 at 08:29 +0300, Michael Tokarev wrote: > [] >>> How to distinguish char devices from block devices in sysfs? >>> Is the only way to read a symlink `subsystem' in the device >>> directory? >> By its subsystem value (block), from the s

Re: /sys/block [was: [PATCH 007 of 7] md: Get name for block device in sysfs]

2007-12-17 Thread Michael Tokarev
Kay Sievers wrote: > On Mon, 2007-12-17 at 08:29 +0300, Michael Tokarev wrote: [] >> How to distinguish char devices from block devices in sysfs? >> Is the only way to read a symlink `subsystem' in the device >> directory? > > By its subsystem value (block), from the symlink, from the environment,

Re: /sys/block [was: [PATCH 007 of 7] md: Get name for block device in sysfs]

2007-12-17 Thread Kay Sievers
On Mon, 2007-12-17 at 08:29 +0300, Michael Tokarev wrote: > Kay Sievers wrote: > > On Mon, 2007-12-17 at 09:43 +1100, Neil Brown wrote: > >> On Saturday December 15, [EMAIL PROTECTED] wrote: > >>> On Dec 14, 2007 7:26 AM, NeilBrown <[EMAIL PROTECTED]> wrote: > Given an fd on a block device, re

/sys/block [was: [PATCH 007 of 7] md: Get name for block device in sysfs]

2007-12-16 Thread Michael Tokarev
Kay Sievers wrote: > On Mon, 2007-12-17 at 09:43 +1100, Neil Brown wrote: >> On Saturday December 15, [EMAIL PROTECTED] wrote: >>> On Dec 14, 2007 7:26 AM, NeilBrown <[EMAIL PROTECTED]> wrote: Given an fd on a block device, returns a string like /block/sda/sda1 whic

Re: [PATCH 007 of 7] md: Get name for block device in sysfs

2007-12-16 Thread Kay Sievers
On Mon, 2007-12-17 at 09:43 +1100, Neil Brown wrote: > On Saturday December 15, [EMAIL PROTECTED] wrote: > > On Dec 14, 2007 7:26 AM, NeilBrown <[EMAIL PROTECTED]> wrote: > > > > > > Given an fd on a block device, returns a string like > > > > > > /block/sda/sda1 > > > > > > which can be us

Re: [PATCH 007 of 7] md: Get name for block device in sysfs

2007-12-16 Thread Neil Brown
On Saturday December 15, [EMAIL PROTECTED] wrote: > On Dec 14, 2007 7:26 AM, NeilBrown <[EMAIL PROTECTED]> wrote: > > > > Given an fd on a block device, returns a string like > > > > /block/sda/sda1 > > > > which can be used to find related information in /sys. > > As pointed out to w

Re: [PATCH 007 of 7] md: Get name for block device in sysfs

2007-12-15 Thread Kay Sievers
On Dec 14, 2007 7:26 AM, NeilBrown <[EMAIL PROTECTED]> wrote: > > Given an fd on a block device, returns a string like > > /block/sda/sda1 > > which can be used to find related information in /sys. > > Ideally we should have an ioctl that works on char devices as well, > but that seems far

[PATCH 007 of 7] md: Get name for block device in sysfs

2007-12-13 Thread NeilBrown
Given an fd on a block device, returns a string like /block/sda/sda1 which can be used to find related information in /sys. Ideally we should have an ioctl that works on char devices as well, but that seems far from trivial, so it seems reasonable to have this until the later can be imp