Skip to content

Commit 9b61764

Browse files
author
Jens Axboe
committed
[SG] Update block layer to use sg helpers
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent 82f66fb commit 9b61764

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

block/ll_rw_blk.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,15 +1354,19 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq,
13541354
else
13551355
sg = sg_next(sg);
13561356

1357-
memset(sg, 0, sizeof(*sg));
1358-
sg->page = bvec->bv_page;
1357+
sg_dma_len(sg) = 0;
1358+
sg_dma_address(sg) = 0;
1359+
sg_set_page(sg, bvec->bv_page);
13591360
sg->length = nbytes;
13601361
sg->offset = bvec->bv_offset;
13611362
nsegs++;
13621363
}
13631364
bvprv = bvec;
13641365
} /* segments in rq */
13651366

1367+
if (sg)
1368+
__sg_mark_end(sg);
1369+
13661370
return nsegs;
13671371
}
13681372

0 commit comments

Comments
 (0)