Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libceph: export osd_req_op_data() macro

We already have one exported wrapper around it for extent.osd_data and
rbd_object_map_update_finish() needs another one for cls.request_data.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Reviewed-by: Jeff Layton <jlayton@kernel.org>

+8 -8
+8
include/linux/ceph/osd_client.h
··· 389 389 void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb); 390 390 void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err); 391 391 392 + #define osd_req_op_data(oreq, whch, typ, fld) \ 393 + ({ \ 394 + struct ceph_osd_request *__oreq = (oreq); \ 395 + unsigned int __whch = (whch); \ 396 + BUG_ON(__whch >= __oreq->r_num_ops); \ 397 + &__oreq->r_ops[__whch].typ.fld; \ 398 + }) 399 + 392 400 extern void osd_req_op_init(struct ceph_osd_request *osd_req, 393 401 unsigned int which, u16 opcode, u32 flags); 394 402
-8
net/ceph/osd_client.c
··· 171 171 osd_data->num_bvecs = num_bvecs; 172 172 } 173 173 174 - #define osd_req_op_data(oreq, whch, typ, fld) \ 175 - ({ \ 176 - struct ceph_osd_request *__oreq = (oreq); \ 177 - unsigned int __whch = (whch); \ 178 - BUG_ON(__whch >= __oreq->r_num_ops); \ 179 - &__oreq->r_ops[__whch].typ.fld; \ 180 - }) 181 - 182 174 static struct ceph_osd_data * 183 175 osd_req_op_raw_data_in(struct ceph_osd_request *osd_req, unsigned int which) 184 176 {