]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
libceph: define source request op functions
authorAlex Elder <elder@inktank.com>
Thu, 14 Mar 2013 01:50:00 +0000 (20:50 -0500)
committerAlex Elder <elder@inktank.com>
Thu, 4 Apr 2013 14:19:49 +0000 (09:19 -0500)
commit408e78cc4c379f83c338173d8872428f5dfe4cab
tree1f0fb54b1b16b2e28e6342fe1c9dfff3de09e60c
parent506ff60401d71f8c01aa970581e00e38a3da180d
libceph: define source request op functions

The rbd code has a function that allocates and populates a
ceph_osd_req_op structure (the in-core version of an osd request
operation).  When reviewed, Josh suggested two things: that the
big varargs function might be better split into type-specific
functions; and that this functionality really belongs in the osd
client rather than rbd.

This patch implements both of Josh's suggestions.  It breaks
up the rbd function into separate functions and defines them
in the osd client module as exported interfaces.  Unlike the
rbd version, however, the functions don't allocate an osd_req_op
structure; they are provided the address of one and that is
initialized instead.

The rbd function has been eliminated and calls to it have been
replaced by calls to the new routines.  The rbd code now now use a
stack (struct) variable to hold the op rather than allocating and
freeing it each time.

For now only the capabilities used by rbd are implemented.
Implementing all the other osd op types, and making the rest of the
code use it will be done separately, in the next few patches.

Note that only the extent, cls, and watch portions of the
ceph_osd_req_op structure are currently used.  Delete the others
(xattr, pgls, and snap) from its definition so nobody thinks it's
actually implemented or needed.  We can add it back again later
if needed, when we know it's been tested.

This (and a few follow-on patches) resolves:
    http://tracker.ceph.com/issues/3861

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