From: Paolo Bonzini <pbonzini@redhat.com>
To: "Jason J. Herne" <hernejj@gmail.com>
Cc: linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org,
JBottomley@parallels.com, stern@rowland.harvard.edu
Subject: Re: [PATCH] Use SCSI read/write(16) with >2TB drives
Date: Wed, 14 Nov 2012 02:17:35 +0100 [thread overview]
Message-ID: <50A2F12F.9060209@redhat.com> (raw)
In-Reply-To: <1352854453-3781-1-git-send-email-hernejj@gmail.com>
Il 14/11/2012 01:54, Jason J. Herne ha scritto:
> blk_queue_physical_block_size(sdp->request_queue,
> sdkp->physical_block_size);
> sdkp->device->sector_size = sector_size;
> +
> + /* Use read/write(16) for > 2TB disks */
> + sdp->use_16_for_rw = (sdkp->capacity > 0xffffffff);
> }
This needs to be done before this bit:
/* Rescale capacity to 512-byte units */
if (sector_size == 4096)
sdkp->capacity <<= 3;
else if (sector_size == 2048)
sdkp->capacity <<= 2;
else if (sector_size == 1024)
sdkp->capacity <<= 1;
else if (sector_size == 256)
sdkp->capacity >>= 1;
For example, for a 4K-sector disk the "threshold" would be 16TB (2^12 *
2^32).
Paolo
prev parent reply other threads:[~2012-11-14 1:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 0:54 [PATCH] Use SCSI read/write(16) with >2TB drives Jason J. Herne
2012-11-14 1:17 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50A2F12F.9060209@redhat.com \
--to=pbonzini@redhat.com \
--cc=JBottomley@parallels.com \
--cc=hernejj@gmail.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).