rbd: rearrange some code for consistency
authorAlex Elder <elder@inktank.com>
Fri, 5 Apr 2013 06:27:12 +0000 (01:27 -0500)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:18:18 +0000 (21:18 -0700)
commit2169238dd3a01bc06670fb9c85635cbe97338ff8
tree7b946ba910db35027fadd075bbf8f5b15e8503bf
parent44cd188d48a95e42651c59ff552d45cc8c667f2c
rbd: rearrange some code for consistency

This patch just trivially moves around some code for consistency.

In preparation for initializing osd request data fields in
ceph_osdc_build_request(), I wanted to verify that rbd did in fact
call that immediately before it called ceph_osdc_start_request().
It was true (although image requests are built in a group and then
started as a group).  But I made the changes here just to make
it more obvious, by making all of the calls follow a common
sequence:
osd_req_op_<optype>_init();
ceph_osd_data_<type>_init()
osd_req_op_<optype>_<datafield>()
rbd_osd_req_format()
...
ret = rbd_obj_request_submit()

I moved the initialization of the callback for image object requests
into rbd_img_request_fill_bio(), again, for consistency.  To avoid
a forward reference, I moved the definition of rbd_img_obj_callback()
up in the file.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c