|
@@ -1000,7 +1000,6 @@ int ceph_calc_object_layout(struct ceph_object_layout *ol,
|
|
{
|
|
{
|
|
unsigned num, num_mask;
|
|
unsigned num, num_mask;
|
|
struct ceph_pg pgid;
|
|
struct ceph_pg pgid;
|
|
- s32 preferred = (s32)le32_to_cpu(fl->fl_pg_preferred);
|
|
|
|
int poolid = le32_to_cpu(fl->fl_pg_pool);
|
|
int poolid = le32_to_cpu(fl->fl_pg_pool);
|
|
struct ceph_pg_pool_info *pool;
|
|
struct ceph_pg_pool_info *pool;
|
|
unsigned ps;
|
|
unsigned ps;
|
|
@@ -1011,23 +1010,13 @@ int ceph_calc_object_layout(struct ceph_object_layout *ol,
|
|
if (!pool)
|
|
if (!pool)
|
|
return -EIO;
|
|
return -EIO;
|
|
ps = ceph_str_hash(pool->v.object_hash, oid, strlen(oid));
|
|
ps = ceph_str_hash(pool->v.object_hash, oid, strlen(oid));
|
|
- if (preferred >= 0) {
|
|
|
|
- ps += preferred;
|
|
|
|
- num = le32_to_cpu(pool->v.lpg_num);
|
|
|
|
- num_mask = pool->lpg_num_mask;
|
|
|
|
- } else {
|
|
|
|
- num = le32_to_cpu(pool->v.pg_num);
|
|
|
|
- num_mask = pool->pg_num_mask;
|
|
|
|
- }
|
|
|
|
|
|
+ num = le32_to_cpu(pool->v.pg_num);
|
|
|
|
+ num_mask = pool->pg_num_mask;
|
|
|
|
|
|
pgid.ps = cpu_to_le16(ps);
|
|
pgid.ps = cpu_to_le16(ps);
|
|
- pgid.preferred = cpu_to_le16(preferred);
|
|
|
|
|
|
+ pgid.preferred = cpu_to_le16(-1);
|
|
pgid.pool = fl->fl_pg_pool;
|
|
pgid.pool = fl->fl_pg_pool;
|
|
- if (preferred >= 0)
|
|
|
|
- dout("calc_object_layout '%s' pgid %d.%xp%d\n", oid, poolid, ps,
|
|
|
|
- (int)preferred);
|
|
|
|
- else
|
|
|
|
- dout("calc_object_layout '%s' pgid %d.%x\n", oid, poolid, ps);
|
|
|
|
|
|
+ dout("calc_object_layout '%s' pgid %d.%x\n", oid, poolid, ps);
|
|
|
|
|
|
ol->ol_pgid = pgid;
|
|
ol->ol_pgid = pgid;
|
|
ol->ol_stripe_unit = fl->fl_object_stripe_unit;
|
|
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,
|
|
struct ceph_pg_pool_info *pool;
|
|
struct ceph_pg_pool_info *pool;
|
|
int ruleno;
|
|
int ruleno;
|
|
unsigned poolid, ps, pps, t;
|
|
unsigned poolid, ps, pps, t;
|
|
- int preferred;
|
|
|
|
|
|
|
|
poolid = le32_to_cpu(pgid.pool);
|
|
poolid = le32_to_cpu(pgid.pool);
|
|
ps = le16_to_cpu(pgid.ps);
|
|
ps = le16_to_cpu(pgid.ps);
|
|
- preferred = (s16)le16_to_cpu(pgid.preferred);
|
|
|
|
|
|
|
|
pool = __lookup_pg_pool(&osdmap->pg_pools, poolid);
|
|
pool = __lookup_pg_pool(&osdmap->pg_pools, poolid);
|
|
if (!pool)
|
|
if (!pool)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
/* pg_temp? */
|
|
/* pg_temp? */
|
|
- if (preferred >= 0)
|
|
|
|
- t = ceph_stable_mod(ps, le32_to_cpu(pool->v.lpg_num),
|
|
|
|
- pool->lpgp_num_mask);
|
|
|
|
- else
|
|
|
|
- t = ceph_stable_mod(ps, le32_to_cpu(pool->v.pg_num),
|
|
|
|
- pool->pgp_num_mask);
|
|
|
|
|
|
+ t = ceph_stable_mod(ps, le32_to_cpu(pool->v.pg_num),
|
|
|
|
+ pool->pgp_num_mask);
|
|
pgid.ps = cpu_to_le16(t);
|
|
pgid.ps = cpu_to_le16(t);
|
|
pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid);
|
|
pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid);
|
|
if (pg) {
|
|
if (pg) {
|
|
@@ -1080,23 +1063,13 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
- /* don't forcefeed bad device ids to crush */
|
|
|
|
- if (preferred >= osdmap->max_osd ||
|
|
|
|
- preferred >= osdmap->crush->max_devices)
|
|
|
|
- preferred = -1;
|
|
|
|
-
|
|
|
|
- if (preferred >= 0)
|
|
|
|
- pps = ceph_stable_mod(ps,
|
|
|
|
- le32_to_cpu(pool->v.lpgp_num),
|
|
|
|
- pool->lpgp_num_mask);
|
|
|
|
- else
|
|
|
|
- pps = ceph_stable_mod(ps,
|
|
|
|
- le32_to_cpu(pool->v.pgp_num),
|
|
|
|
- pool->pgp_num_mask);
|
|
|
|
|
|
+ pps = ceph_stable_mod(ps,
|
|
|
|
+ le32_to_cpu(pool->v.pgp_num),
|
|
|
|
+ pool->pgp_num_mask);
|
|
pps += poolid;
|
|
pps += poolid;
|
|
*num = crush_do_rule(osdmap->crush, ruleno, pps, osds,
|
|
*num = crush_do_rule(osdmap->crush, ruleno, pps, osds,
|
|
min_t(int, pool->v.size, *num),
|
|
min_t(int, pool->v.size, *num),
|
|
- preferred, osdmap->osd_weight);
|
|
|
|
|
|
+ -1, osdmap->osd_weight);
|
|
return osds;
|
|
return osds;
|
|
}
|
|
}
|
|
|
|
|