The patch titled Subject: scatterlist: add sg_nents has been removed from the -mm tree. Its filename was scatterlist-add-sg_nents.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Maxim Levitsky <maximlevitsky@xxxxxxxxx> Subject: scatterlist: add sg_nents Useful helper to know the number of entries in scatterlist. Signed-off-by: Maxim Levitsky <maximlevitsky@xxxxxxxxx> Cc: Alex Dubov <oakad@xxxxxxxxx> Acked-by: Tejun Heo <tj@xxxxxxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/scatterlist.h | 1 + lib/scatterlist.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff -puN include/linux/scatterlist.h~scatterlist-add-sg_nents include/linux/scatterlist.h --- a/include/linux/scatterlist.h~scatterlist-add-sg_nents +++ a/include/linux/scatterlist.h @@ -201,6 +201,7 @@ static inline void *sg_virt(struct scatt return page_address(sg_page(sg)) + sg->offset; } +int sg_nents(struct scatterlist *sg); struct scatterlist *sg_next(struct scatterlist *); struct scatterlist *sg_last(struct scatterlist *s, unsigned int); void sg_init_table(struct scatterlist *, unsigned int); diff -puN lib/scatterlist.c~scatterlist-add-sg_nents lib/scatterlist.c --- a/lib/scatterlist.c~scatterlist-add-sg_nents +++ a/lib/scatterlist.c @@ -39,6 +39,28 @@ struct scatterlist *sg_next(struct scatt EXPORT_SYMBOL(sg_next); /** + * sg_nents - return total count of entries in scatterlist + * @sg: The scatterlist + * + * Description: + * Allows to know how many entries are in sg, taking into acount + * chaining as well + * + **/ +int sg_nents(struct scatterlist *sg) +{ + int nents = 0; + while (sg) { + nents++; + sg = sg_next(sg); + } + + return nents; +} +EXPORT_SYMBOL(sg_nents); + + +/** * sg_last - return the last scatterlist entry in a list * @sgl: First entry in the scatterlist * @nents: Number of entries in the scatterlist _ Patches currently in -mm which might be from maximlevitsky@xxxxxxxxx are linux-next.patch scatterlist-atomic-sg_mapping_iter-no-longer-needs-disabled-irqs.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html