Ask For Comment: add new API related to sg_miter_start in scatter list

From: Hillf Danton
Date: Sun Oct 03 2010 - 09:10:12 EST


Like sg_miter_start, the new API also init the __offset element of miter
with given parameter.
Then the precesure of sg_miter_start, sg_miter_next and sg_miter_stop
could be carried out as smoothly as sg_copy_buffer does, with
all __xyz elements of miter untouched outside miter.

Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
---

--- o/linux-2.6.36-rc4/include/linux/scatterlist.h 2010-09-13
07:07:38.000000000 +0800
+++ m/linux-2.6.36-rc4/include/linux/scatterlist.h 2010-10-03
20:45:12.000000000 +0800
@@ -264,4 +264,18 @@ void sg_miter_start(struct sg_mapping_it
bool sg_miter_next(struct sg_mapping_iter *miter);
void sg_miter_stop(struct sg_mapping_iter *miter);

+/*
+ * like sg_miter_start, plus setting the offset in sg
+ */
+static void
+sg_miter_start_offset(struct sg_mapping_iter *miter,
+ struct scatterlist *sgl,
+ unsigned int nents,
+ unsigned int flags,
+ unsigned int offset)
+{
+ sg_miter_start(miter, sgl, nents, flags);
+ miter->__offset = offset;
+}
+
#endif /* _LINUX_SCATTERLIST_H */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/