diff options
author | Alex Elder <elder@inktank.com> | 2013-04-01 18:58:26 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-01 21:17:52 -0700 |
commit | ef4859d6479d19bcc65c3156cf3b7dd747355c29 (patch) | |
tree | 83a977e35c7dd32834d707f93173c1e00da06384 /net/ceph/osd_client.c | |
parent | 8058fd45039724695d5b67a574544452635d64a9 (diff) | |
download | linux-stable-ef4859d6479d19bcc65c3156cf3b7dd747355c29.tar.gz linux-stable-ef4859d6479d19bcc65c3156cf3b7dd747355c29.tar.bz2 linux-stable-ef4859d6479d19bcc65c3156cf3b7dd747355c29.zip |
libceph: define ceph_decode_pgid() only once
There are two basically identical definitions of __decode_pgid()
in libceph, one in "net/ceph/osdmap.c" and the other in
"net/ceph/osd_client.c". Get rid of both, and instead define
a single inline version in "include/linux/ceph/osdmap.h".
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r-- | net/ceph/osd_client.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 69ef6539ca14..ca79cad50840 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1268,26 +1268,6 @@ static void complete_request(struct ceph_osd_request *req) complete_all(&req->r_safe_completion); /* fsync waiter */ } -static int __decode_pgid(void **p, void *end, struct ceph_pg *pgid) -{ - __u8 v; - - ceph_decode_need(p, end, 1 + 8 + 4 + 4, bad); - v = ceph_decode_8(p); - if (v > 1) { - pr_warning("do not understand pg encoding %d > 1", v); - return -EINVAL; - } - pgid->pool = ceph_decode_64(p); - pgid->seed = ceph_decode_32(p); - *p += 4; - return 0; - -bad: - pr_warning("incomplete pg encoding"); - return -EINVAL; -} - /* * handle osd op reply. either call the callback if it is specified, * or do the completion to wake up the waiting thread. @@ -1321,7 +1301,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, ceph_decode_need(&p, end, object_len, bad); p += object_len; - err = __decode_pgid(&p, end, &pg); + err = ceph_decode_pgid(&p, end, &pg); if (err) goto bad; |