@@ -200,7 +200,6 @@ struct ceph_msg_data_cursor {
#ifdef CONFIG_BLOCK
struct ceph_bio_iter bio_iter;
#endif /* CONFIG_BLOCK */
- struct bvec_iter bvec_iter;
struct { /* pages */
unsigned int page_offset; /* offset in page */
unsigned short page_index; /* index in array */
@@ -885,35 +885,25 @@ static void ceph_msg_data_bvecs_cursor_init(struct ceph_msg_data_cursor *cursor,
size_t length)
{
struct ceph_msg_data *data = cursor->data;
- struct bio_vec *bvecs = data->bvec_pos.bvecs;
cursor->resid = min_t(size_t, length, data->bvec_pos.iter.bi_size);
- cursor->bvec_iter = data->bvec_pos.iter;
- cursor->bvec_iter.bi_size = cursor->resid;
- BUG_ON(cursor->resid < bvec_iter_len(bvecs, cursor->bvec_iter));
+ iov_iter_bvec(&cursor->iter, cursor->direction, data->bvec_pos.bvecs,
+ data->num_bvecs, cursor->resid);
}
static void ceph_msg_data_bvecs_next(struct ceph_msg_data_cursor *cursor)
{
- struct bio_vec bv = bvec_iter_bvec(cursor->data->bvec_pos.bvecs,
- cursor->bvec_iter);
-
- ceph_msg_data_set_iter(cursor, bv.bv_page,
- bv.bv_offset, bv.bv_len);
+ /* Nothing here */
}
static void ceph_msg_data_bvecs_advance(struct ceph_msg_data_cursor *cursor,
size_t bytes)
{
- struct bio_vec *bvecs = cursor->data->bvec_pos.bvecs;
-
BUG_ON(bytes > cursor->resid);
- BUG_ON(bytes > bvec_iter_len(bvecs, cursor->bvec_iter));
+ BUG_ON(bytes > iov_iter_count(&cursor->iter));
cursor->resid -= bytes;
- bvec_iter_advance(bvecs, &cursor->bvec_iter, bytes);
-
- BUG_ON(cursor->resid < bvec_iter_len(bvecs, cursor->bvec_iter));
+ iov_iter_advance(&cursor->iter, bytes);
}
/*
Now pages are not visible for the bvecs data and iov_iter API is used instead. Signed-off-by: Roman Penyaev <rpenyaev@suse.de> --- include/linux/ceph/messenger.h | 1 - net/ceph/messenger.c | 20 +++++--------------- 2 files changed, 5 insertions(+), 16 deletions(-)