diff options
author | Alex Elder <elder@inktank.com> | 2013-04-01 19:58:26 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:17:52 -0400 |
commit | ef4859d6479d19bcc65c3156cf3b7dd747355c29 (patch) | |
tree | 83a977e35c7dd32834d707f93173c1e00da06384 /net/ceph/osd_client.c | |
parent | 8058fd45039724695d5b67a574544452635d64a9 (diff) |
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) | |||
1268 | complete_all(&req->r_safe_completion); /* fsync waiter */ | 1268 | complete_all(&req->r_safe_completion); /* fsync waiter */ |
1269 | } | 1269 | } |
1270 | 1270 | ||
1271 | static int __decode_pgid(void **p, void *end, struct ceph_pg *pgid) | ||
1272 | { | ||
1273 | __u8 v; | ||
1274 | |||
1275 | ceph_decode_need(p, end, 1 + 8 + 4 + 4, bad); | ||
1276 | v = ceph_decode_8(p); | ||
1277 | if (v > 1) { | ||
1278 | pr_warning("do not understand pg encoding %d > 1", v); | ||
1279 | return -EINVAL; | ||
1280 | } | ||
1281 | pgid->pool = ceph_decode_64(p); | ||
1282 | pgid->seed = ceph_decode_32(p); | ||
1283 | *p += 4; | ||
1284 | return 0; | ||
1285 | |||
1286 | bad: | ||
1287 | pr_warning("incomplete pg encoding"); | ||
1288 | return -EINVAL; | ||
1289 | } | ||
1290 | |||
1291 | /* | 1271 | /* |
1292 | * handle osd op reply. either call the callback if it is specified, | 1272 | * handle osd op reply. either call the callback if it is specified, |
1293 | * or do the completion to wake up the waiting thread. | 1273 | * 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, | |||
1321 | ceph_decode_need(&p, end, object_len, bad); | 1301 | ceph_decode_need(&p, end, object_len, bad); |
1322 | p += object_len; | 1302 | p += object_len; |
1323 | 1303 | ||
1324 | err = __decode_pgid(&p, end, &pg); | 1304 | err = ceph_decode_pgid(&p, end, &pg); |
1325 | if (err) | 1305 | if (err) |
1326 | goto bad; | 1306 | goto bad; |
1327 | 1307 | ||