aboutsummaryrefslogtreecommitdiff
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-12-05 16:43:12 +0900
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:15 -0500
commit0bcc65ad78ae517de16b2ca07a2891f49d44d156 (patch)
tree87eecc4aec56500f3e29a1e82b631093f950ac85 /include/linux/libata.h
parentff2aeb1eb64c8a4770a6304f9addbae9f9828646 (diff)
libata: make qc->nbytes include extra buffers
qc->nbytes didn't use to include extra buffers setup by libata core layer and my be odd. This patch makes qc->nbytes include any extra buffers setup by libata core layer and guaranteed to be aligned on 4 byte boundary. This value is to be used to program the host controller. As this represents the actual length of buffer available to the controller and the controller must be able to deal with short transfers for ATAPI commands which can transfer variable length, this shouldn't break any controllers while making problems like rounding-down and controllers choking up on odd transfer bytes much less likely. The unmodified value is stored in new field qc->raw_nbytes. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 162f8b5509a..7b7c78e4207 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -466,6 +466,7 @@ struct ata_queued_cmd {
unsigned int sect_size;
unsigned int nbytes;
+ unsigned int raw_nbytes;
unsigned int curbytes;
struct scatterlist *cursg;
@@ -1362,7 +1363,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
qc->flags = 0;
qc->cursg = NULL;
qc->cursg_ofs = 0;
- qc->nbytes = qc->curbytes = 0;
+ qc->nbytes = qc->raw_nbytes = qc->curbytes = 0;
qc->n_elem = 0;
qc->mapped_n_elem = 0;
qc->n_iter = 0;