提交 80f162ff 编写于 作者: M Ming Lei 提交者: Jens Axboe

block: mark 1st parameter of bvec_iter_advance as const

bvec_iter_advance() only writes the parameter of iterator,
so the base address of bvec can be marked as const safely.

Without the change, we can see compiling warning in the
following patch for implementing iterate_bvec(): lib/iov_iter.c
with bvec iterator.
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NMing Lei <ming.lei@canonical.com>
Tested-by: NHannes Reinecke <hare@suse.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 0781e79e
......@@ -66,7 +66,8 @@ struct bvec_iter {
.bv_offset = bvec_iter_offset((bvec), (iter)), \
})
static inline void bvec_iter_advance(struct bio_vec *bv, struct bvec_iter *iter,
static inline void bvec_iter_advance(const struct bio_vec *bv,
struct bvec_iter *iter,
unsigned bytes)
{
WARN_ONCE(bytes > iter->bi_size,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部