[stgt] [PATCH] support custom block sizes
FUJITA Tomonori
fujita.tomonori at lab.ntt.co.jp
Fri Dec 31 05:39:27 CET 2010
On Thu, 30 Dec 2010 17:33:17 +0200
Alexander Nezhinsky <alexandern at Voltaire.COM> wrote:
> Added support for user-defined block size.
>
> The rationale is for using with devices (notably SSDs) that allow
> formatting with sector size different from 512B. If such device
> is formatted to a greater value, but tgt reports its sector size
> to be 512B, all commands referencing device sectors and/or extents
> will address wrong locations, some of which will be even out of
> the device's capacity.
>
> This patch follows the patch posted here:
> http://lists.wpkg.org/pipermail/stgt/2009-December/003469.html
> and elaborates the suggested functionality a bit further.
>
> The default block size is maintained by sbc (block devices).
> It is set to 512B. After this all block devices will report
> the passed block sz value during scsi inquiries.
>
> Block size can be set for individual luns as well using
> --params blocksize=4096,...
> among the parameters of new logical unit through tgtadm.
>
> This may be used in scripts as follows:
> --params blocksize=`blockdev --getss /dev/sdd`
> In this case lun specific setting overrides sbc default.
>
> Tha actual per lun is displayed through -m target -o show.
>
> Signed-off-by: Alexander Nezhinsky <alexandern at voltaire.com>
> ---
> usr/sbc.c | 25 +++++++++++++++++--------
> usr/target.c | 35 +++++++++++++++++++++++++++++++----
> usr/tgtd.h | 1 +
> usr/util.c | 19 +++++++++++++++++++
> usr/util.h | 1 +
> 5 files changed, 69 insertions(+), 12 deletions(-)
Thanks, merged.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list