aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-10-18 16:21:18 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-18 16:21:18 -0400
commit3be6cbd73f74b4a3da82cc7d6e1688a4ae595fc7 (patch)
treea077cf70d1cd438db34f5def23dd8f72f42b5a8c /include/linux/libata.h
parent858c9c406688bc7244986b5836265071edfd1d3f (diff)
[libata] kill ata_sg_is_last()
Short term, this works around a bug introduced by early sg-chaining work. Long term, removing this function eliminates a branch from a hot path loop in each scatter/gather table build. Also, as this code demonstrates, we don't need to _track_ the end of the s/g list, as long as we mark it in some way. And doing so programatically is nice. So its a useful cleanup, regardless of its short term effects. Based conceptually on a quick patch by Jens Axboe. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 377e6d4d9be3..bc3b6fc7b98d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1037,18 +1037,6 @@ extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset,
1037/* 1037/*
1038 * qc helpers 1038 * qc helpers
1039 */ 1039 */
1040static inline int
1041ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
1042{
1043 if (sg == &qc->pad_sgent)
1044 return 1;
1045 if (qc->pad_len)
1046 return 0;
1047 if (qc->n_iter == qc->n_elem)
1048 return 1;
1049 return 0;
1050}
1051
1052static inline struct scatterlist * 1040static inline struct scatterlist *
1053ata_qc_first_sg(struct ata_queued_cmd *qc) 1041ata_qc_first_sg(struct ata_queued_cmd *qc)
1054{ 1042{