Re: [Nbd] Setting the physical block size
- To: email@example.com
- Subject: Re: [Nbd] Setting the physical block size
- From: Goswin von Brederlow <goswin-v-b@...186...>
- Date: Thu, 01 Mar 2012 17:17:41 +0100
- Message-id: <87k4341eje.fsf@...860...>
- In-reply-to: <9A4E41323A793A2FAF045CAD@...874...> (Alex Bligh's message of "Thu, 01 Mar 2012 10:37:50 +0000")
- References: <87vcmoy9o2.fsf@...860...> <9A4E41323A793A2FAF045CAD@...874...>
Alex Bligh <alex@...872...> writes:
> --On 1 March 2012 10:04:13 +0100 Goswin von Brederlow
> <goswin-v-b@...186...> wrote:
>> below is a patch that makes the nbd kernel driver set the physical block
>> size of the device to the blocksize specified by the client.
> Can this be done via an ioctl from nbd-client?
> Alex Bligh
There is an ioctl NBD_SET_BLKSIZE, which sets the lo->blksize. The only
use of this seems to be to make the size of the nbd device a multiple of
the blocksize. I guess setting the physical block size could be moved
into the ioctl instead of doing it in nbd_do_it(). But then it would
have to be done twice, once when setting the default blocksize (1024)
and once in the ioctl.
Or did you mean that there should be a new ioctl NBD_SET_PHYS_BLKSIZE?
If we go that way then I would prefer a NBD_SET_GEOMETRY that sets all
the geometry infos (logical / physical block size, alignment offset,
rotational, ...) in a single call and introduce a handshake option to
communicate the disks geometry from server to client.