aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2017-06-15 10:30:53 -0400
committerIlya Dryomov <idryomov@gmail.com>2017-07-07 11:25:15 -0400
commitdc98ff7230e5ccf11c621dff0d590e83574a7184 (patch)
treebc98e0f8cf3c0d5800ac6b6d57519d99ffacfc6f /include/linux/ceph
parent8e48cf00c48fdefb01f70db81f31438cd0c29dcc (diff)
libceph: introduce ceph_spg, ceph_pg_to_primary_shard()
Store both raw pgid and actual spgid in ceph_osd_request_target. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r--include/linux/ceph/osd_client.h3
-rw-r--r--include/linux/ceph/osdmap.h10
2 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index ef630ebd1169..6114f7b02135 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -136,7 +136,8 @@ struct ceph_osd_request_target {
136 struct ceph_object_id target_oid; 136 struct ceph_object_id target_oid;
137 struct ceph_object_locator target_oloc; 137 struct ceph_object_locator target_oloc;
138 138
139 struct ceph_pg pgid; 139 struct ceph_pg pgid; /* last raw pg we mapped to */
140 struct ceph_spg spgid; /* last actual spg we mapped to */
140 u32 pg_num; 141 u32 pg_num;
141 u32 pg_num_mask; 142 u32 pg_num_mask;
142 struct ceph_osds acting; 143 struct ceph_osds acting;
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index 938656f70807..7ae5b416b4b6 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -24,6 +24,13 @@ struct ceph_pg {
24 uint32_t seed; 24 uint32_t seed;
25}; 25};
26 26
27#define CEPH_SPG_NOSHARD -1
28
29struct ceph_spg {
30 struct ceph_pg pgid;
31 s8 shard;
32};
33
27int ceph_pg_compare(const struct ceph_pg *lhs, const struct ceph_pg *rhs); 34int ceph_pg_compare(const struct ceph_pg *lhs, const struct ceph_pg *rhs);
28 35
29#define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id 36#define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id
@@ -271,6 +278,9 @@ void ceph_pg_to_up_acting_osds(struct ceph_osdmap *osdmap,
271 const struct ceph_pg *raw_pgid, 278 const struct ceph_pg *raw_pgid,
272 struct ceph_osds *up, 279 struct ceph_osds *up,
273 struct ceph_osds *acting); 280 struct ceph_osds *acting);
281bool ceph_pg_to_primary_shard(struct ceph_osdmap *osdmap,
282 const struct ceph_pg *raw_pgid,
283 struct ceph_spg *spgid);
274int ceph_pg_to_acting_primary(struct ceph_osdmap *osdmap, 284int ceph_pg_to_acting_primary(struct ceph_osdmap *osdmap,
275 const struct ceph_pg *raw_pgid); 285 const struct ceph_pg *raw_pgid);
276 286