diff options
| -rw-r--r-- | include/linux/ceph/osdmap.h | 8 | ||||
| -rw-r--r-- | net/ceph/osd_client.c | 10 | ||||
| -rw-r--r-- | net/ceph/osdmap.c | 19 |
3 files changed, 13 insertions, 24 deletions
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index e71fb222c7c3..5675b1f09bc5 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
| @@ -279,10 +279,10 @@ bool ceph_osds_changed(const struct ceph_osds *old_acting, | |||
| 279 | const struct ceph_osds *new_acting, | 279 | const struct ceph_osds *new_acting, |
| 280 | bool any_change); | 280 | bool any_change); |
| 281 | 281 | ||
| 282 | int __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi, | 282 | void __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi, |
| 283 | const struct ceph_object_id *oid, | 283 | const struct ceph_object_id *oid, |
| 284 | const struct ceph_object_locator *oloc, | 284 | const struct ceph_object_locator *oloc, |
| 285 | struct ceph_pg *raw_pgid); | 285 | struct ceph_pg *raw_pgid); |
| 286 | int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap, | 286 | int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap, |
| 287 | const struct ceph_object_id *oid, | 287 | const struct ceph_object_id *oid, |
| 288 | const struct ceph_object_locator *oloc, | 288 | const struct ceph_object_locator *oloc, |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 05c4d27d25fe..f2584fe1246f 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
| @@ -1430,7 +1430,6 @@ static enum calc_target_result calc_target(struct ceph_osd_client *osdc, | |||
| 1430 | bool recovery_deletes = ceph_osdmap_flag(osdc, | 1430 | bool recovery_deletes = ceph_osdmap_flag(osdc, |
| 1431 | CEPH_OSDMAP_RECOVERY_DELETES); | 1431 | CEPH_OSDMAP_RECOVERY_DELETES); |
| 1432 | enum calc_target_result ct_res; | 1432 | enum calc_target_result ct_res; |
| 1433 | int ret; | ||
| 1434 | 1433 | ||
| 1435 | t->epoch = osdc->osdmap->epoch; | 1434 | t->epoch = osdc->osdmap->epoch; |
| 1436 | pi = ceph_pg_pool_by_id(osdc->osdmap, t->base_oloc.pool); | 1435 | pi = ceph_pg_pool_by_id(osdc->osdmap, t->base_oloc.pool); |
| @@ -1466,14 +1465,7 @@ static enum calc_target_result calc_target(struct ceph_osd_client *osdc, | |||
| 1466 | } | 1465 | } |
| 1467 | } | 1466 | } |
| 1468 | 1467 | ||
| 1469 | ret = __ceph_object_locator_to_pg(pi, &t->target_oid, &t->target_oloc, | 1468 | __ceph_object_locator_to_pg(pi, &t->target_oid, &t->target_oloc, &pgid); |
| 1470 | &pgid); | ||
| 1471 | if (ret) { | ||
| 1472 | WARN_ON(ret != -ENOENT); | ||
| 1473 | t->osd = CEPH_HOMELESS_OSD; | ||
| 1474 | ct_res = CALC_TARGET_POOL_DNE; | ||
| 1475 | goto out; | ||
| 1476 | } | ||
| 1477 | last_pgid.pool = pgid.pool; | 1469 | last_pgid.pool = pgid.pool; |
| 1478 | last_pgid.seed = ceph_stable_mod(pgid.seed, t->pg_num, t->pg_num_mask); | 1470 | last_pgid.seed = ceph_stable_mod(pgid.seed, t->pg_num, t->pg_num_mask); |
| 1479 | 1471 | ||
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 9645ffd6acfb..a7494f623451 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c | |||
| @@ -2145,10 +2145,10 @@ bool ceph_osds_changed(const struct ceph_osds *old_acting, | |||
| 2145 | * Should only be called with target_oid and target_oloc (as opposed to | 2145 | * Should only be called with target_oid and target_oloc (as opposed to |
| 2146 | * base_oid and base_oloc), since tiering isn't taken into account. | 2146 | * base_oid and base_oloc), since tiering isn't taken into account. |
| 2147 | */ | 2147 | */ |
| 2148 | int __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi, | 2148 | void __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi, |
| 2149 | const struct ceph_object_id *oid, | 2149 | const struct ceph_object_id *oid, |
| 2150 | const struct ceph_object_locator *oloc, | 2150 | const struct ceph_object_locator *oloc, |
| 2151 | struct ceph_pg *raw_pgid) | 2151 | struct ceph_pg *raw_pgid) |
| 2152 | { | 2152 | { |
| 2153 | WARN_ON(pi->id != oloc->pool); | 2153 | WARN_ON(pi->id != oloc->pool); |
| 2154 | 2154 | ||
| @@ -2164,11 +2164,8 @@ int __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi, | |||
| 2164 | int nsl = oloc->pool_ns->len; | 2164 | int nsl = oloc->pool_ns->len; |
| 2165 | size_t total = nsl + 1 + oid->name_len; | 2165 | size_t total = nsl + 1 + oid->name_len; |
| 2166 | 2166 | ||
| 2167 | if (total > sizeof(stack_buf)) { | 2167 | if (total > sizeof(stack_buf)) |
| 2168 | buf = kmalloc(total, GFP_NOIO); | 2168 | buf = kmalloc(total, GFP_NOIO | __GFP_NOFAIL); |
| 2169 | if (!buf) | ||
| 2170 | return -ENOMEM; | ||
| 2171 | } | ||
| 2172 | memcpy(buf, oloc->pool_ns->str, nsl); | 2169 | memcpy(buf, oloc->pool_ns->str, nsl); |
| 2173 | buf[nsl] = '\037'; | 2170 | buf[nsl] = '\037'; |
| 2174 | memcpy(buf + nsl + 1, oid->name, oid->name_len); | 2171 | memcpy(buf + nsl + 1, oid->name, oid->name_len); |
| @@ -2180,7 +2177,6 @@ int __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi, | |||
| 2180 | oid->name, nsl, oloc->pool_ns->str, | 2177 | oid->name, nsl, oloc->pool_ns->str, |
| 2181 | raw_pgid->pool, raw_pgid->seed); | 2178 | raw_pgid->pool, raw_pgid->seed); |
| 2182 | } | 2179 | } |
| 2183 | return 0; | ||
| 2184 | } | 2180 | } |
| 2185 | 2181 | ||
| 2186 | int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap, | 2182 | int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap, |
| @@ -2194,7 +2190,8 @@ int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap, | |||
| 2194 | if (!pi) | 2190 | if (!pi) |
| 2195 | return -ENOENT; | 2191 | return -ENOENT; |
| 2196 | 2192 | ||
| 2197 | return __ceph_object_locator_to_pg(pi, oid, oloc, raw_pgid); | 2193 | __ceph_object_locator_to_pg(pi, oid, oloc, raw_pgid); |
| 2194 | return 0; | ||
| 2198 | } | 2195 | } |
| 2199 | EXPORT_SYMBOL(ceph_object_locator_to_pg); | 2196 | EXPORT_SYMBOL(ceph_object_locator_to_pg); |
| 2200 | 2197 | ||
