mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 21:56:31 +00:00
Performance micro-optimization: use sg_next_inline() instead of sg_next()
Now we have sg_next_inline(), so let's use it everywhere. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4761 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -3737,12 +3737,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page,
|
||||
sg->length = len;
|
||||
}
|
||||
|
||||
static inline struct scatterlist *sg_next(struct scatterlist *sg)
|
||||
{
|
||||
sg++;
|
||||
return sg;
|
||||
}
|
||||
|
||||
#ifndef for_each_sg
|
||||
/* See also commit 96b418c960af0d5c7185ff5c4af9376eb37ac9d3 */
|
||||
#define for_each_sg(sglist, sg, nr, __i) \
|
||||
|
||||
+2
-2
@@ -5768,7 +5768,7 @@ static int sg_copy_elem(struct scatterlist **pdst_sg, size_t *pdst_len,
|
||||
src_len -= n;
|
||||
dst_len -= n;
|
||||
if (dst_len == 0) {
|
||||
dst_sg = sg_next(dst_sg);
|
||||
dst_sg = sg_next_inline(dst_sg);
|
||||
if (dst_sg == NULL)
|
||||
goto out;
|
||||
dst_page = sg_page(dst_sg);
|
||||
@@ -5834,7 +5834,7 @@ static int sg_copy(struct scatterlist *dst_sg, struct scatterlist *src_sg,
|
||||
if (nents_to_copy == 0)
|
||||
goto out;
|
||||
|
||||
src_sg = sg_next(src_sg);
|
||||
src_sg = sg_next_inline(src_sg);
|
||||
} while (src_sg != NULL);
|
||||
|
||||
out:
|
||||
|
||||
+2
-2
@@ -3001,7 +3001,7 @@ static int srpt_map_sg_to_ib_sge(struct srpt_rdma_ch *ch,
|
||||
if (tsize > 0) {
|
||||
++j;
|
||||
if (j < count) {
|
||||
cur_sg = sg_next(cur_sg);
|
||||
cur_sg = sg_next_inline(cur_sg);
|
||||
dma_len = sg_dma_len(cur_sg);
|
||||
}
|
||||
}
|
||||
@@ -3056,7 +3056,7 @@ static int srpt_map_sg_to_ib_sge(struct srpt_rdma_ch *ch,
|
||||
if (tsize > 0) {
|
||||
++j;
|
||||
if (j < count) {
|
||||
cur_sg = sg_next(cur_sg);
|
||||
cur_sg = sg_next_inline(cur_sg);
|
||||
dma_len = sg_dma_len(cur_sg);
|
||||
dma_addr =
|
||||
sg_dma_address(cur_sg);
|
||||
|
||||
Reference in New Issue
Block a user