libceph: rename ceph_calc_pg_primary()
authorIlya Dryomov <idryomov@gmail.com>
Thu, 28 Apr 2016 14:07:23 +0000 (16:07 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 25 May 2016 22:36:25 +0000 (00:36 +0200)
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>
fs/ceph/ioctl.c
include/linux/ceph/osdmap.h
net/ceph/osdmap.c

index cca7fff227253d9bc01f1d350ca764b2c1590d35..1831ad6cf066703bb5a2c343c02dd0b451c2ef6c 100644 (file)
@@ -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);
index 942189d311e09e909c5c9e7d4611af01a7f11db1..3fd978a1639b166fef4c547d47fe553db2696c74 100644 (file)
@@ -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);
index f5fc8fc63879866b9ed35849686c2a45a6f31c46..656384a8fd1e2df0f5a94e29f3ba965e66f8f4ba 100644 (file)
@@ -1896,13 +1896,14 @@ out:
 }
 
 /*
- * 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);