Viacheslav Dubeyko <Slava.Dubeyko@xxxxxxx> wrote: > > > > + if (ceph_databuf_insert_frag(dbuf, 0, sizeof(*header), > > > > GFP_KERNEL) < 0) > > > > + goto out; > > > > + if (ceph_databuf_insert_frag(dbuf, 1, PAGE_SIZE, GFP_KERNEL) > > > > < 0) > > > > goto out; > > > > > > > > + iov_iter_bvec(&iter, ITER_DEST, &dbuf->bvec[1], 1, len); > > > > > > Is it correct &dbuf->bvec[1]? Why do we work with item #1? I think it > > > looks confusing. > > > > Because you have a protocol element (in dbuf->bvec[0]) and a buffer (in > > dbuf->bvec[1]). > > It sounds to me that we need to have two declarations (something like this): > > #define PROTOCOL_ELEMENT_INDEX 0 > #define BUFFER_INDEX 1 But that's specific to this particular usage. There may or may not be a frag/page allocated to a protocol element and there may or may not be buffer parts and may be multiple buffer parts. There could even be multiple pages allocated to protocol elements. David