[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4EE0C8DB.7070904@cfl.rr.com>
Date: Thu, 08 Dec 2011 09:25:31 -0500
From: Phillip Susi <psusi@....rr.com>
To: Karel Zak <kzak@...hat.com>
CC: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] Add BLKPG_GET_PARTITION operation
On 12/8/2011 7:35 AM, Karel Zak wrote:
> On Wed, Nov 30, 2011 at 10:23:44PM -0500, Phillip Susi wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Add a new operation to the BLKPG ioctl to read the partition.
>> This allows user space to find the current start and length
>> of a partition without having to open the partition and use
>> the long depreciated HDIO_GETGEO ioctl.
>
> $ cat /sys/block/sda/sda1/{size,start}
> 4096000
> 2048
>
> ...is probably the best way if you want to avoid problems with
> permissions and deprecated (or all) ioctls :-)
Yes, I patched parted to grab the values from sysfs and only use
HDIO_GETGEO if that fails, but I thought an ioctl would be preferable (
no need to muck about with appending partition numbers to paths and
parsing text and such ), and it seemed an orthogonal operation to the
other BLKPG ops.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists