Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
libceph: rename ceph_calc_pg_primary()
Browse files Browse the repository at this point in the history
Rename ceph_calc_pg_primary() to ceph_pg_to_acting_primary() to
emphasise that it returns acting primary.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
idryomov committed May 25, 2016
1 parent 6f3bfd4 commit f81f163
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fs/ceph/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
return r;
}

dl.osd = ceph_calc_pg_primary(osdc->osdmap, pgid);
dl.osd = ceph_pg_to_acting_primary(osdc->osdmap, &pgid);
if (dl.osd >= 0) {
struct ceph_entity_addr *a =
ceph_osd_addr(osdc->osdmap, dl.osd);
Expand Down
4 changes: 2 additions & 2 deletions include/linux/ceph/osdmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ void ceph_pg_to_up_acting_osds(struct ceph_osdmap *osdmap,
const struct ceph_pg *raw_pgid,
struct ceph_osds *up,
struct ceph_osds *acting);
extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap,
struct ceph_pg pgid);
int ceph_pg_to_acting_primary(struct ceph_osdmap *osdmap,
const struct ceph_pg *raw_pgid);

extern struct ceph_pg_pool_info *ceph_pg_pool_by_id(struct ceph_osdmap *map,
u64 id);
Expand Down
9 changes: 5 additions & 4 deletions net/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1896,13 +1896,14 @@ void ceph_pg_to_up_acting_osds(struct ceph_osdmap *osdmap,
}

/*
* Return primary osd for given pgid, or -1 if none.
* Return acting primary for given PG, or -1 if none.
*/
int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, struct ceph_pg pgid)
int ceph_pg_to_acting_primary(struct ceph_osdmap *osdmap,
const struct ceph_pg *raw_pgid)
{
struct ceph_osds up, acting;

ceph_pg_to_up_acting_osds(osdmap, &pgid, &up, &acting);
ceph_pg_to_up_acting_osds(osdmap, raw_pgid, &up, &acting);
return acting.primary;
}
EXPORT_SYMBOL(ceph_calc_pg_primary);
EXPORT_SYMBOL(ceph_pg_to_acting_primary);

0 comments on commit f81f163

Please sign in to comment.