Messages in this thread Patch in this message | | | Date | Tue, 23 Oct 2007 10:32:13 -0400 | From | "John Stoffel" <> | Subject | Re: [PATCH 02/10] [SG] Update block layer to use sg helpers |
| |
>>>>> "Jens" == Jens Axboe <jens.axboe@oracle.com> writes:
Jens> Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Jens> --- Jens> block/ll_rw_blk.c | 8 ++++++-- Jens> 1 files changed, 6 insertions(+), 2 deletions(-)
Jens> diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c Jens> index 8025d64..61c2e39 100644 Jens> --- a/block/ll_rw_blk.c Jens> +++ b/block/ll_rw_blk.c Jens> @@ -1354,8 +1354,9 @@ new_segment: Jens> else Jens> sg = sg_next(sg); Jens> - memset(sg, 0, sizeof(*sg)); Jens> - sg->page = bvec->bv_page; Jens> + sg_dma_len(sg) = 0; Jens> + sg_dma_address(sg) = 0;
Why don't you call these something like sg_set_dma_len() and sg_set_dma_address() instead, to make it clear these set the values and don't read them?
Jens> + sg_set_page(sg, bvec->bv_page);
Esp since you have the sg_set_page() right below it.
sg-> length = nbytes; sg-> offset = bvec->bv_offset; Jens> nsegs++; Jens> @@ -1363,6 +1364,9 @@ new_segment: Jens> bvprv = bvec; Jens> } /* segments in rq */ Jens> + if (sg) Jens> + __sg_mark_end(sg); Jens> + Jens> return nsegs; Jens> } Jens> -- Jens> 1.5.3.GIT
Jens> - Jens> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Jens> the body of a message to majordomo@vger.kernel.org Jens> More majordomo info at http://vger.kernel.org/majordomo-info.html Jens> Please read the FAQ at http://www.tux.org/lkml/
Jens> !DSPAM:471ce899205391598813817! - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |