Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347597
b: refs/heads/master
c: 72afc71
h: refs/heads/master
i:
  347595: 78231a9
v: v3
  • Loading branch information
Alex Elder committed Nov 1, 2012
1 parent 18392ee commit 2fde4a3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86b00e0da6be7bbc16412f126c5b548ac5d91d50
refs/heads/master: 72afc71ffca0f444ee0e1ef8c7e34ab209bb48b3
1 change: 1 addition & 0 deletions trunk/include/linux/ceph/osdmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap,
struct ceph_pg pgid);

extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);
extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);

#endif
16 changes: 16 additions & 0 deletions trunk/net/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,22 @@ static struct ceph_pg_pool_info *__lookup_pg_pool(struct rb_root *root, int id)
return NULL;
}

const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id)
{
struct ceph_pg_pool_info *pi;

if (id == CEPH_NOPOOL)
return NULL;

if (WARN_ON_ONCE(id > (u64) INT_MAX))
return NULL;

pi = __lookup_pg_pool(&map->pg_pools, (int) id);

return pi ? pi->name : NULL;
}
EXPORT_SYMBOL(ceph_pg_pool_name_by_id);

int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name)
{
struct rb_node *rbp;
Expand Down

0 comments on commit 2fde4a3

Please sign in to comment.