aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-05-07 18:33:36 -0400
committerSage Weil <sage@inktank.com>2012-05-07 18:33:36 -0400
commit3469ac1aa3a2f1e2586a412923c414779a0af854 (patch)
treeb271456518130622e6d394cf50939c132f1a1d0d /net/ceph
parentcd9d9f5df6098c50726200d4185e9e8da32785b3 (diff)
ceph: drop support for preferred_osd pgs
This was an ill-conceived feature that has been removed from Ceph. Do this gracefully: - reject attempts to specify a preferred_osd via the ioctl - stop exposing this information via virtual xattrs - always fill in -1 for requests, in case we talk to an older server - don't calculate preferred_osd placements/pgids Reviewed-by: Alex Elder <elder@inktank.com> Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/osdmap.c47
1 files changed, 10 insertions, 37 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index 29ad46ec9dcf..7d39f3cb4947 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -1000,7 +1000,6 @@ int ceph_calc_object_layout(struct ceph_object_layout *ol,
1000{ 1000{
1001 unsigned num, num_mask; 1001 unsigned num, num_mask;
1002 struct ceph_pg pgid; 1002 struct ceph_pg pgid;
1003 s32 preferred = (s32)le32_to_cpu(fl->fl_pg_preferred);
1004 int poolid = le32_to_cpu(fl->fl_pg_pool); 1003 int poolid = le32_to_cpu(fl->fl_pg_pool);
1005 struct ceph_pg_pool_info *pool; 1004 struct ceph_pg_pool_info *pool;
1006 unsigned ps; 1005 unsigned ps;
@@ -1011,23 +1010,13 @@ int ceph_calc_object_layout(struct ceph_object_layout *ol,
1011 if (!pool) 1010 if (!pool)
1012 return -EIO; 1011 return -EIO;
1013 ps = ceph_str_hash(pool->v.object_hash, oid, strlen(oid)); 1012 ps = ceph_str_hash(pool->v.object_hash, oid, strlen(oid));
1014 if (preferred >= 0) { 1013 num = le32_to_cpu(pool->v.pg_num);
1015 ps += preferred; 1014 num_mask = pool->pg_num_mask;
1016 num = le32_to_cpu(pool->v.lpg_num);
1017 num_mask = pool->lpg_num_mask;
1018 } else {
1019 num = le32_to_cpu(pool->v.pg_num);
1020 num_mask = pool->pg_num_mask;
1021 }
1022 1015
1023 pgid.ps = cpu_to_le16(ps); 1016 pgid.ps = cpu_to_le16(ps);
1024 pgid.preferred = cpu_to_le16(preferred); 1017 pgid.preferred = cpu_to_le16(-1);
1025 pgid.pool = fl->fl_pg_pool; 1018 pgid.pool = fl->fl_pg_pool;
1026 if (preferred >= 0) 1019 dout("calc_object_layout '%s' pgid %d.%x\n", oid, poolid, ps);
1027 dout("calc_object_layout '%s' pgid %d.%xp%d\n", oid, poolid, ps,
1028 (int)preferred);
1029 else
1030 dout("calc_object_layout '%s' pgid %d.%x\n", oid, poolid, ps);
1031 1020
1032 ol->ol_pgid = pgid; 1021 ol->ol_pgid = pgid;
1033 ol->ol_stripe_unit = fl->fl_object_stripe_unit; 1022 ol->ol_stripe_unit = fl->fl_object_stripe_unit;
@@ -1046,23 +1035,17 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
1046 struct ceph_pg_pool_info *pool; 1035 struct ceph_pg_pool_info *pool;
1047 int ruleno; 1036 int ruleno;
1048 unsigned poolid, ps, pps, t; 1037 unsigned poolid, ps, pps, t;
1049 int preferred;
1050 1038
1051 poolid = le32_to_cpu(pgid.pool); 1039 poolid = le32_to_cpu(pgid.pool);
1052 ps = le16_to_cpu(pgid.ps); 1040 ps = le16_to_cpu(pgid.ps);
1053 preferred = (s16)le16_to_cpu(pgid.preferred);
1054 1041
1055 pool = __lookup_pg_pool(&osdmap->pg_pools, poolid); 1042 pool = __lookup_pg_pool(&osdmap->pg_pools, poolid);
1056 if (!pool) 1043 if (!pool)
1057 return NULL; 1044 return NULL;
1058 1045
1059 /* pg_temp? */ 1046 /* pg_temp? */
1060 if (preferred >= 0) 1047 t = ceph_stable_mod(ps, le32_to_cpu(pool->v.pg_num),
1061 t = ceph_stable_mod(ps, le32_to_cpu(pool->v.lpg_num), 1048 pool->pgp_num_mask);
1062 pool->lpgp_num_mask);
1063 else
1064 t = ceph_stable_mod(ps, le32_to_cpu(pool->v.pg_num),
1065 pool->pgp_num_mask);
1066 pgid.ps = cpu_to_le16(t); 1049 pgid.ps = cpu_to_le16(t);
1067 pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid); 1050 pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid);
1068 if (pg) { 1051 if (pg) {
@@ -1080,23 +1063,13 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
1080 return NULL; 1063 return NULL;
1081 } 1064 }
1082 1065
1083 /* don't forcefeed bad device ids to crush */ 1066 pps = ceph_stable_mod(ps,
1084 if (preferred >= osdmap->max_osd || 1067 le32_to_cpu(pool->v.pgp_num),
1085 preferred >= osdmap->crush->max_devices) 1068 pool->pgp_num_mask);
1086 preferred = -1;
1087
1088 if (preferred >= 0)
1089 pps = ceph_stable_mod(ps,
1090 le32_to_cpu(pool->v.lpgp_num),
1091 pool->lpgp_num_mask);
1092 else
1093 pps = ceph_stable_mod(ps,
1094 le32_to_cpu(pool->v.pgp_num),
1095 pool->pgp_num_mask);
1096 pps += poolid; 1069 pps += poolid;
1097 *num = crush_do_rule(osdmap->crush, ruleno, pps, osds, 1070 *num = crush_do_rule(osdmap->crush, ruleno, pps, osds,
1098 min_t(int, pool->v.size, *num), 1071 min_t(int, pool->v.size, *num),
1099 preferred, osdmap->osd_weight); 1072 -1, osdmap->osd_weight);
1100 return osds; 1073 return osds;
1101} 1074}
1102 1075