aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2006-02-20 16:56:08 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-02-20 16:56:08 -0500
commit11fff8287fdaeb700df79aa8253650b60c7b21e2 (patch)
treea0b695f44810b4cf8c4b3f81dd25811a10871003 /include
parenta5fd79ccd60b7c9cc0221dfaaa950933eff6af99 (diff)
parentf131883e73a8662dc92c3ea371ae9ded0c8f2c37 (diff)
Merge branch 'upstream'
Diffstat (limited to 'include')
-rw-r--r--include/linux/libata.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 63500881acc6..2558abac9fb2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -619,17 +619,29 @@ ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
619} 619}
620 620
621static inline struct scatterlist * 621static inline struct scatterlist *
622ata_qc_first_sg(struct ata_queued_cmd *qc)
623{
624 if (qc->n_elem)
625 return qc->__sg;
626 if (qc->pad_len)
627 return &qc->pad_sgent;
628 return NULL;
629}
630
631static inline struct scatterlist *
622ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc) 632ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
623{ 633{
624 if (sg == &qc->pad_sgent) 634 if (sg == &qc->pad_sgent)
625 return NULL; 635 return NULL;
626 if (++sg - qc->__sg < qc->n_elem) 636 if (++sg - qc->__sg < qc->n_elem)
627 return sg; 637 return sg;
628 return qc->pad_len ? &qc->pad_sgent : NULL; 638 if (qc->pad_len)
639 return &qc->pad_sgent;
640 return NULL;
629} 641}
630 642
631#define ata_for_each_sg(sg, qc) \ 643#define ata_for_each_sg(sg, qc) \
632 for (sg = qc->__sg; sg; sg = ata_qc_next_sg(sg, qc)) 644 for (sg = ata_qc_first_sg(qc); sg; sg = ata_qc_next_sg(sg, qc))
633 645
634static inline unsigned int ata_tag_valid(unsigned int tag) 646static inline unsigned int ata_tag_valid(unsigned int tag)
635{ 647{