Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=96b418c960af0d5c7185ff5c4af9376eb37ac9d3
Commit:     96b418c960af0d5c7185ff5c4af9376eb37ac9d3
Parent:     ab83407e9ee35a4972457aa487be6a7a21afd715
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 09:02:57 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 11:07:10 2007 +0200

    Add sg helpers for iterating over a scatterlist table
    
    First step to being able to change the scatterlist setup without
    having to modify drivers (a lot :-)
    
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 include/linux/scatterlist.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 4efbd9c..bed5ab4 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -20,4 +20,13 @@ static inline void sg_init_one(struct scatterlist *sg, const 
void *buf,
        sg_set_buf(sg, buf, buflen);
 }
 
+#define sg_next(sg)            ((sg) + 1)
+#define sg_last(sg, nents)     (&(sg[(nents) - 1]))
+
+/*
+ * Loop over each sg element, following the pointer to a new list if necessary
+ */
+#define for_each_sg(sglist, sg, nr, __i)       \
+       for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg))
+
 #endif /* _LINUX_SCATTERLIST_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to