• Home
  • Raw
  • Download

Lines Matching full:osd

36  * do with the T10 OSD extensions to SCSI.)  Ceph OSDs are simply
41 * are described by the osd map.
43 * We keep track of pending OSD requests (read, write), resubmit
46 * channel with an OSD is reset.
49 static void link_request(struct ceph_osd *osd, struct ceph_osd_request *req);
50 static void unlink_request(struct ceph_osd *osd, struct ceph_osd_request *req);
51 static void link_linger(struct ceph_osd *osd,
53 static void unlink_linger(struct ceph_osd *osd,
55 static void clear_backoffs(struct ceph_osd *osd);
77 static inline void verify_osd_locked(struct ceph_osd *osd) in verify_osd_locked() argument
79 struct ceph_osd_client *osdc = osd->o_osdc; in verify_osd_locked()
81 WARN_ON(!(mutex_is_locked(&osd->lock) && in verify_osd_locked()
92 static inline void verify_osd_locked(struct ceph_osd *osd) { } in verify_osd_locked() argument
101 * fill osd op in request message.
455 t->osd = CEPH_HOMELESS_OSD; in target_init()
484 dest->osd = src->osd; in target_copy()
722 * oid, oloc and OSD op opcode(s) must be filled in before this function
736 * This is an osd op init function for opcodes that have no data or
1056 pr_err("unsupported osd opcode %s\n", in osd_req_encode_op()
1187 * We keep osd requests in an rbtree, sorted by ->r_tid.
1193 * Call @fn on each OSD request as long as @fn returns 0. in DEFINE_RB_FUNCS()
1202 struct ceph_osd *osd = rb_entry(n, struct ceph_osd, o_node); in DEFINE_RB_FUNCS() local
1204 for (p = rb_first(&osd->o_requests); p; ) { in DEFINE_RB_FUNCS()
1224 static bool osd_homeless(struct ceph_osd *osd) in osd_homeless() argument
1226 return osd->o_osd == CEPH_HOMELESS_OSD; in osd_homeless()
1229 static bool osd_registered(struct ceph_osd *osd) in osd_registered() argument
1231 verify_osdc_locked(osd->o_osdc); in osd_registered()
1233 return !RB_EMPTY_NODE(&osd->o_node); in osd_registered()
1237 * Assumes @osd is zero-initialized.
1239 static void osd_init(struct ceph_osd *osd) in osd_init() argument
1241 refcount_set(&osd->o_ref, 1); in osd_init()
1242 RB_CLEAR_NODE(&osd->o_node); in osd_init()
1243 spin_lock_init(&osd->o_requests_lock); in osd_init()
1244 osd->o_requests = RB_ROOT; in osd_init()
1245 osd->o_linger_requests = RB_ROOT; in osd_init()
1246 osd->o_backoff_mappings = RB_ROOT; in osd_init()
1247 osd->o_backoffs_by_id = RB_ROOT; in osd_init()
1248 INIT_LIST_HEAD(&osd->o_osd_lru); in osd_init()
1249 INIT_LIST_HEAD(&osd->o_keepalive_item); in osd_init()
1250 osd->o_incarnation = 1; in osd_init()
1251 mutex_init(&osd->lock); in osd_init()
1261 static void osd_cleanup(struct ceph_osd *osd) in osd_cleanup() argument
1263 WARN_ON(!RB_EMPTY_NODE(&osd->o_node)); in osd_cleanup()
1264 WARN_ON(!RB_EMPTY_ROOT(&osd->o_requests)); in osd_cleanup()
1265 WARN_ON(!RB_EMPTY_ROOT(&osd->o_linger_requests)); in osd_cleanup()
1266 WARN_ON(!RB_EMPTY_ROOT(&osd->o_backoff_mappings)); in osd_cleanup()
1267 WARN_ON(!RB_EMPTY_ROOT(&osd->o_backoffs_by_id)); in osd_cleanup()
1268 WARN_ON(!list_empty(&osd->o_osd_lru)); in osd_cleanup()
1269 WARN_ON(!list_empty(&osd->o_keepalive_item)); in osd_cleanup()
1271 ceph_init_sparse_read(&osd->o_sparse_read); in osd_cleanup()
1273 if (osd->o_auth.authorizer) { in osd_cleanup()
1274 WARN_ON(osd_homeless(osd)); in osd_cleanup()
1275 ceph_auth_destroy_authorizer(osd->o_auth.authorizer); in osd_cleanup()
1284 struct ceph_osd *osd; in create_osd() local
1288 osd = kzalloc(sizeof(*osd), GFP_NOIO | __GFP_NOFAIL); in create_osd()
1289 osd_init(osd); in create_osd()
1290 osd->o_osdc = osdc; in create_osd()
1291 osd->o_osd = onum; in create_osd()
1292 osd->o_sparse_op_idx = -1; in create_osd()
1294 ceph_init_sparse_read(&osd->o_sparse_read); in create_osd()
1296 ceph_con_init(&osd->o_con, osd, &osd_con_ops, &osdc->client->msgr); in create_osd()
1298 return osd; in create_osd()
1301 static struct ceph_osd *get_osd(struct ceph_osd *osd) in get_osd() argument
1303 if (refcount_inc_not_zero(&osd->o_ref)) { in get_osd()
1304 dout("get_osd %p %d -> %d\n", osd, refcount_read(&osd->o_ref)-1, in get_osd()
1305 refcount_read(&osd->o_ref)); in get_osd()
1306 return osd; in get_osd()
1308 dout("get_osd %p FAIL\n", osd); in get_osd()
1313 static void put_osd(struct ceph_osd *osd) in put_osd() argument
1315 dout("put_osd %p %d -> %d\n", osd, refcount_read(&osd->o_ref), in put_osd()
1316 refcount_read(&osd->o_ref) - 1); in put_osd()
1317 if (refcount_dec_and_test(&osd->o_ref)) { in put_osd()
1318 osd_cleanup(osd); in put_osd()
1319 kfree(osd); in put_osd()
1323 DEFINE_RB_FUNCS(osd, struct ceph_osd, o_osd, o_node) in DEFINE_RB_FUNCS() argument
1325 static void __move_osd_to_lru(struct ceph_osd *osd) in DEFINE_RB_FUNCS()
1327 struct ceph_osd_client *osdc = osd->o_osdc; in DEFINE_RB_FUNCS()
1329 dout("%s osd %p osd%d\n", __func__, osd, osd->o_osd); in DEFINE_RB_FUNCS()
1330 BUG_ON(!list_empty(&osd->o_osd_lru)); in DEFINE_RB_FUNCS()
1333 list_add_tail(&osd->o_osd_lru, &osdc->osd_lru); in DEFINE_RB_FUNCS()
1336 osd->lru_ttl = jiffies + osdc->client->options->osd_idle_ttl; in DEFINE_RB_FUNCS()
1339 static void maybe_move_osd_to_lru(struct ceph_osd *osd) in maybe_move_osd_to_lru() argument
1341 if (RB_EMPTY_ROOT(&osd->o_requests) && in maybe_move_osd_to_lru()
1342 RB_EMPTY_ROOT(&osd->o_linger_requests)) in maybe_move_osd_to_lru()
1343 __move_osd_to_lru(osd); in maybe_move_osd_to_lru()
1346 static void __remove_osd_from_lru(struct ceph_osd *osd) in __remove_osd_from_lru() argument
1348 struct ceph_osd_client *osdc = osd->o_osdc; in __remove_osd_from_lru()
1350 dout("%s osd %p osd%d\n", __func__, osd, osd->o_osd); in __remove_osd_from_lru()
1353 if (!list_empty(&osd->o_osd_lru)) in __remove_osd_from_lru()
1354 list_del_init(&osd->o_osd_lru); in __remove_osd_from_lru()
1362 static void close_osd(struct ceph_osd *osd) in close_osd() argument
1364 struct ceph_osd_client *osdc = osd->o_osdc; in close_osd()
1368 dout("%s osd %p osd%d\n", __func__, osd, osd->o_osd); in close_osd()
1370 ceph_con_close(&osd->o_con); in close_osd()
1372 for (n = rb_first(&osd->o_requests); n; ) { in close_osd()
1379 unlink_request(osd, req); in close_osd()
1382 for (n = rb_first(&osd->o_linger_requests); n; ) { in close_osd()
1390 unlink_linger(osd, lreq); in close_osd()
1393 clear_backoffs(osd); in close_osd()
1395 __remove_osd_from_lru(osd); in close_osd()
1396 erase_osd(&osdc->osds, osd); in close_osd()
1397 put_osd(osd); in close_osd()
1401 * reset osd connect
1403 static int reopen_osd(struct ceph_osd *osd) in reopen_osd() argument
1407 dout("%s osd %p osd%d\n", __func__, osd, osd->o_osd); in reopen_osd()
1409 if (RB_EMPTY_ROOT(&osd->o_requests) && in reopen_osd()
1410 RB_EMPTY_ROOT(&osd->o_linger_requests)) { in reopen_osd()
1411 close_osd(osd); in reopen_osd()
1415 peer_addr = &osd->o_osdc->osdmap->osd_addr[osd->o_osd]; in reopen_osd()
1416 if (!memcmp(peer_addr, &osd->o_con.peer_addr, sizeof (*peer_addr)) && in reopen_osd()
1417 !ceph_con_opened(&osd->o_con)) { in reopen_osd()
1420 dout("osd addr hasn't changed and connection never opened, " in reopen_osd()
1423 for (n = rb_first(&osd->o_requests); n; n = rb_next(n)) { in reopen_osd()
1432 ceph_con_close(&osd->o_con); in reopen_osd()
1433 ceph_con_open(&osd->o_con, CEPH_ENTITY_TYPE_OSD, osd->o_osd, peer_addr); in reopen_osd()
1434 osd->o_incarnation++; in reopen_osd()
1442 struct ceph_osd *osd; in lookup_create_osd() local
1450 osd = lookup_osd(&osdc->osds, o); in lookup_create_osd()
1452 osd = &osdc->homeless_osd; in lookup_create_osd()
1453 if (!osd) { in lookup_create_osd()
1457 osd = create_osd(osdc, o); in lookup_create_osd()
1458 insert_osd(&osdc->osds, osd); in lookup_create_osd()
1459 ceph_con_open(&osd->o_con, CEPH_ENTITY_TYPE_OSD, osd->o_osd, in lookup_create_osd()
1460 &osdc->osdmap->osd_addr[osd->o_osd]); in lookup_create_osd()
1463 dout("%s osdc %p osd%d -> osd %p\n", __func__, osdc, o, osd); in lookup_create_osd()
1464 return osd; in lookup_create_osd()
1468 * Create request <-> OSD session relation.
1470 * @req has to be assigned a tid, @osd may be homeless.
1472 static void link_request(struct ceph_osd *osd, struct ceph_osd_request *req) in link_request() argument
1474 verify_osd_locked(osd); in link_request()
1476 dout("%s osd %p osd%d req %p tid %llu\n", __func__, osd, osd->o_osd, in link_request()
1479 if (!osd_homeless(osd)) in link_request()
1480 __remove_osd_from_lru(osd); in link_request()
1482 atomic_inc(&osd->o_osdc->num_homeless); in link_request()
1484 get_osd(osd); in link_request()
1485 spin_lock(&osd->o_requests_lock); in link_request()
1486 insert_request(&osd->o_requests, req); in link_request()
1487 spin_unlock(&osd->o_requests_lock); in link_request()
1488 req->r_osd = osd; in link_request()
1491 static void unlink_request(struct ceph_osd *osd, struct ceph_osd_request *req) in unlink_request() argument
1493 verify_osd_locked(osd); in unlink_request()
1494 WARN_ON(req->r_osd != osd); in unlink_request()
1495 dout("%s osd %p osd%d req %p tid %llu\n", __func__, osd, osd->o_osd, in unlink_request()
1499 spin_lock(&osd->o_requests_lock); in unlink_request()
1500 erase_request(&osd->o_requests, req); in unlink_request()
1501 spin_unlock(&osd->o_requests_lock); in unlink_request()
1502 put_osd(osd); in unlink_request()
1504 if (!osd_homeless(osd)) in unlink_request()
1505 maybe_move_osd_to_lru(osd); in unlink_request()
1507 atomic_dec(&osd->o_osdc->num_homeless); in unlink_request()
1564 dout("%s picked osd%d, primary osd%d\n", __func__, in pick_random_replica()
1594 dout("%s picked osd%d with locality %d, primary osd%d\n", __func__, in pick_closest_replica()
1626 t->osd = CEPH_HOMELESS_OSD; in calc_target()
1651 t->osd = CEPH_HOMELESS_OSD; in calc_target()
1714 t->osd = acting.osds[pos]; in calc_target()
1717 t->osd = acting.primary; in calc_target()
1728 dout("%s t %p -> %d%d%d%d ct_res %d osd%d\n", __func__, t, unpaused, in calc_target()
1729 legacy_change, force_resend, split, ct_res, t->osd); in calc_target()
1756 * ceph_pg_mapping. Used to track OSD backoffs -- a backoff [range] is
1984 * Each backoff has a unique id within its OSD session.
1988 static void clear_backoffs(struct ceph_osd *osd) in DEFINE_RB_FUNCS()
1990 while (!RB_EMPTY_ROOT(&osd->o_backoff_mappings)) { in DEFINE_RB_FUNCS()
1992 rb_entry(rb_first(&osd->o_backoff_mappings), in DEFINE_RB_FUNCS()
2001 erase_backoff_by_id(&osd->o_backoffs_by_id, backoff); in DEFINE_RB_FUNCS()
2004 erase_spg_mapping(&osd->o_backoff_mappings, spg); in DEFINE_RB_FUNCS()
2035 struct ceph_osd *osd = req->r_osd; in should_plug_request() local
2040 spg = lookup_spg_mapping(&osd->o_backoff_mappings, &req->r_t.spgid); in should_plug_request()
2049 dout("%s req %p tid %llu backoff osd%d spgid %llu.%xs%d id %llu\n", in should_plug_request()
2050 __func__, req, req->r_tid, osd->o_osd, backoff->spgid.pgid.pool, in should_plug_request()
2245 /* luminous OSD -- encode features and be done */ in encode_request_finish()
2267 * Pre-luminous OSD -- reencode v8 into v4 using @head in encode_request_finish()
2335 struct ceph_osd *osd = req->r_osd; in send_request() local
2337 verify_osd_locked(osd); in send_request()
2338 WARN_ON(osd->o_osd != req->r_t.osd); in send_request()
2359 dout("%s req %p tid %llu to pgid %llu.%x spgid %llu.%xs%d osd%d e%u flags 0x%x attempt %d\n", in send_request()
2362 req->r_t.spgid.shard, osd->o_osd, req->r_t.epoch, req->r_flags, in send_request()
2369 req->r_sent = osd->o_incarnation; in send_request()
2371 ceph_con_send(&osd->o_con, ceph_msg_get(req->r_request)); in send_request()
2401 struct ceph_osd *osd; in __submit_request() local
2415 osd = lookup_create_osd(osdc, req->r_t.osd, wrlocked); in __submit_request()
2416 if (IS_ERR(osd)) { in __submit_request()
2417 WARN_ON(PTR_ERR(osd) != -EAGAIN || wrlocked); in __submit_request()
2456 } else if (!osd_homeless(osd)) { in __submit_request()
2462 mutex_lock(&osd->lock); in __submit_request()
2469 link_request(osd, req); in __submit_request()
2474 mutex_unlock(&osd->lock); in __submit_request()
2526 * If an OSD has failed or returned and a request has been sent in finish_request()
2794 WARN_ON(lreq->osd); in linger_release()
2851 * Create linger request <-> OSD session relation. in DEFINE_RB_INSDEL_FUNCS()
2853 * @lreq has to be registered, @osd may be homeless. in DEFINE_RB_INSDEL_FUNCS()
2855 static void link_linger(struct ceph_osd *osd, in DEFINE_RB_INSDEL_FUNCS()
2858 verify_osd_locked(osd); in DEFINE_RB_INSDEL_FUNCS()
2859 WARN_ON(!lreq->linger_id || lreq->osd); in DEFINE_RB_INSDEL_FUNCS()
2860 dout("%s osd %p osd%d lreq %p linger_id %llu\n", __func__, osd, in DEFINE_RB_INSDEL_FUNCS()
2861 osd->o_osd, lreq, lreq->linger_id); in DEFINE_RB_INSDEL_FUNCS()
2863 if (!osd_homeless(osd)) in DEFINE_RB_INSDEL_FUNCS()
2864 __remove_osd_from_lru(osd); in DEFINE_RB_INSDEL_FUNCS()
2866 atomic_inc(&osd->o_osdc->num_homeless); in DEFINE_RB_INSDEL_FUNCS()
2868 get_osd(osd); in DEFINE_RB_INSDEL_FUNCS()
2869 insert_linger(&osd->o_linger_requests, lreq); in DEFINE_RB_INSDEL_FUNCS()
2870 lreq->osd = osd; in DEFINE_RB_INSDEL_FUNCS()
2873 static void unlink_linger(struct ceph_osd *osd, in unlink_linger() argument
2876 verify_osd_locked(osd); in unlink_linger()
2877 WARN_ON(lreq->osd != osd); in unlink_linger()
2878 dout("%s osd %p osd%d lreq %p linger_id %llu\n", __func__, osd, in unlink_linger()
2879 osd->o_osd, lreq, lreq->linger_id); in unlink_linger()
2881 lreq->osd = NULL; in unlink_linger()
2882 erase_linger(&osd->o_linger_requests, lreq); in unlink_linger()
2883 put_osd(osd); in unlink_linger()
2885 if (!osd_homeless(osd)) in unlink_linger()
2886 maybe_move_osd_to_lru(osd); in unlink_linger()
2888 atomic_dec(&osd->o_osdc->num_homeless); in unlink_linger()
3271 link_request(lreq->osd, req); in send_linger_ping()
3278 struct ceph_osd *osd; in linger_submit() local
3284 osd = lookup_create_osd(osdc, lreq->t.osd, true); in linger_submit()
3285 link_linger(osd, lreq); in linger_submit()
3318 unlink_linger(lreq->osd, lreq); in __linger_cancel()
3441 * Timeout callback, called every N seconds. When 1 or more OSD
3443 * (tag + timestamp) to its OSD to ensure any communications channel
3462 * a connection with that osd (from the fault callback). in handle_timeout()
3465 struct ceph_osd *osd = rb_entry(n, struct ceph_osd, o_node); in handle_timeout() local
3468 for (p = rb_first(&osd->o_requests); p; ) { in handle_timeout()
3475 dout(" req %p tid %llu on osd%d is laggy\n", in handle_timeout()
3476 req, req->r_tid, osd->o_osd); in handle_timeout()
3481 pr_err_ratelimited("tid %llu on osd%d timeout\n", in handle_timeout()
3482 req->r_tid, osd->o_osd); in handle_timeout()
3486 for (p = rb_first(&osd->o_linger_requests); p; p = rb_next(p)) { in handle_timeout()
3490 dout(" lreq %p linger_id %llu is served by osd%d\n", in handle_timeout()
3491 lreq, lreq->linger_id, osd->o_osd); in handle_timeout()
3501 list_move_tail(&osd->o_keepalive_item, &slow_osds); in handle_timeout()
3512 pr_err_ratelimited("tid %llu on osd%d timeout\n", in handle_timeout()
3523 struct ceph_osd *osd = list_first_entry(&slow_osds, in handle_timeout() local
3526 list_del_init(&osd->o_keepalive_item); in handle_timeout()
3527 ceph_con_keepalive(&osd->o_con); in handle_timeout()
3541 struct ceph_osd *osd, *nosd; in handle_osds_timeout() local
3545 list_for_each_entry_safe(osd, nosd, &osdc->osd_lru, o_osd_lru) { in handle_osds_timeout()
3546 if (time_before(jiffies, osd->lru_ttl)) in handle_osds_timeout()
3549 WARN_ON(!RB_EMPTY_ROOT(&osd->o_requests)); in handle_osds_timeout()
3550 WARN_ON(!RB_EMPTY_ROOT(&osd->o_linger_requests)); in handle_osds_timeout()
3551 close_osd(osd); in handle_osds_timeout()
3766 static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg) in handle_reply() argument
3768 struct ceph_osd_client *osdc = osd->o_osdc; in handle_reply()
3779 if (!osd_registered(osd)) { in handle_reply()
3780 dout("%s osd%d unknown\n", __func__, osd->o_osd); in handle_reply()
3783 WARN_ON(osd->o_osd != le64_to_cpu(msg->hdr.src.num)); in handle_reply()
3785 mutex_lock(&osd->lock); in handle_reply()
3786 req = lookup_request(&osd->o_requests, tid); in handle_reply()
3788 dout("%s osd%d tid %llu unknown\n", __func__, osd->o_osd, tid); in handle_reply()
3820 unlink_request(osd, req); in handle_reply()
3821 mutex_unlock(&osd->lock); in handle_reply()
3838 unlink_request(osd, req); in handle_reply()
3839 mutex_unlock(&osd->lock); in handle_reply()
3884 mutex_unlock(&osd->lock); in handle_reply()
3893 mutex_unlock(&osd->lock); in handle_reply()
3929 struct ceph_osd *osd; in recalc_linger_target() local
3931 osd = lookup_create_osd(osdc, lreq->t.osd, true); in recalc_linger_target()
3932 if (osd != lreq->osd) { in recalc_linger_target()
3933 unlink_linger(lreq->osd, lreq); in recalc_linger_target()
3934 link_linger(osd, lreq); in recalc_linger_target()
3942 * Requeue requests whose mapping to an OSD has changed.
3944 static void scan_requests(struct ceph_osd *osd, in scan_requests() argument
3951 struct ceph_osd_client *osdc = osd->o_osdc; in scan_requests()
3955 for (n = rb_first(&osd->o_linger_requests); n; ) { in scan_requests()
3991 for (n = rb_first(&osd->o_requests); n; ) { in scan_requests()
4013 unlink_request(osd, req); in scan_requests()
4078 struct ceph_osd *osd = rb_entry(n, struct ceph_osd, o_node); in handle_one_map() local
4082 scan_requests(osd, skipped_map, was_full, true, need_resend, in handle_one_map()
4084 if (!ceph_osd_is_up(osdc->osdmap, osd->o_osd) || in handle_one_map()
4085 memcmp(&osd->o_con.peer_addr, in handle_one_map()
4086 ceph_osd_addr(osdc->osdmap, osd->o_osd), in handle_one_map()
4088 close_osd(osd); in handle_one_map()
4121 struct ceph_osd *osd; in kick_requests() local
4126 osd = lookup_create_osd(osdc, req->r_t.osd, true); in kick_requests()
4127 link_request(osd, req); in kick_requests()
4129 if (!osd_homeless(osd) && !req->r_t.paused) in kick_requests()
4137 if (!osd_homeless(lreq->osd)) in kick_requests()
4145 * Process updated osd map.
4262 * Resubmit requests pending on the given osd.
4264 static void kick_osd_requests(struct ceph_osd *osd) in kick_osd_requests() argument
4268 clear_backoffs(osd); in kick_osd_requests()
4270 for (n = rb_first(&osd->o_requests); n; ) { in kick_osd_requests()
4283 for (n = rb_first(&osd->o_linger_requests); n; n = rb_next(n)) { in kick_osd_requests()
4292 * If the osd connection drops, we need to resubmit all requests.
4296 struct ceph_osd *osd = con->private; in osd_fault() local
4297 struct ceph_osd_client *osdc = osd->o_osdc; in osd_fault()
4299 dout("%s osd %p osd%d\n", __func__, osd, osd->o_osd); in osd_fault()
4302 if (!osd_registered(osd)) { in osd_fault()
4303 dout("%s osd%d unknown\n", __func__, osd->o_osd); in osd_fault()
4307 if (!reopen_osd(osd)) in osd_fault()
4308 kick_osd_requests(osd); in osd_fault()
4412 static void handle_backoff_block(struct ceph_osd *osd, struct MOSDBackoff *m) in handle_backoff_block() argument
4418 dout("%s osd%d spgid %llu.%xs%d id %llu\n", __func__, osd->o_osd, in handle_backoff_block()
4421 spg = lookup_spg_mapping(&osd->o_backoff_mappings, &m->spgid); in handle_backoff_block()
4429 insert_spg_mapping(&osd->o_backoff_mappings, spg); in handle_backoff_block()
4445 insert_backoff_by_id(&osd->o_backoffs_by_id, backoff); in handle_backoff_block()
4448 * Ack with original backoff's epoch so that the OSD can in handle_backoff_block()
4456 ceph_con_send(&osd->o_con, msg); in handle_backoff_block()
4471 static void handle_backoff_unblock(struct ceph_osd *osd, in handle_backoff_unblock() argument
4478 dout("%s osd%d spgid %llu.%xs%d id %llu\n", __func__, osd->o_osd, in handle_backoff_unblock()
4481 backoff = lookup_backoff_by_id(&osd->o_backoffs_by_id, m->id); in handle_backoff_unblock()
4483 pr_err("%s osd%d spgid %llu.%xs%d id %llu backoff dne\n", in handle_backoff_unblock()
4484 __func__, osd->o_osd, m->spgid.pgid.pool, in handle_backoff_unblock()
4491 pr_err("%s osd%d spgid %llu.%xs%d id %llu bad range?\n", in handle_backoff_unblock()
4492 __func__, osd->o_osd, m->spgid.pgid.pool, in handle_backoff_unblock()
4497 spg = lookup_spg_mapping(&osd->o_backoff_mappings, &backoff->spgid); in handle_backoff_unblock()
4501 erase_backoff_by_id(&osd->o_backoffs_by_id, backoff); in handle_backoff_unblock()
4505 erase_spg_mapping(&osd->o_backoff_mappings, spg); in handle_backoff_unblock()
4509 for (n = rb_first(&osd->o_requests); n; n = rb_next(n)) { in handle_backoff_unblock()
4516 * have split on the OSD. in handle_backoff_unblock()
4529 static void handle_backoff(struct ceph_osd *osd, struct ceph_msg *msg) in handle_backoff() argument
4531 struct ceph_osd_client *osdc = osd->o_osdc; in handle_backoff()
4536 if (!osd_registered(osd)) { in handle_backoff()
4537 dout("%s osd%d unknown\n", __func__, osd->o_osd); in handle_backoff()
4541 WARN_ON(osd->o_osd != le64_to_cpu(msg->hdr.src.num)); in handle_backoff()
4543 mutex_lock(&osd->lock); in handle_backoff()
4553 handle_backoff_block(osd, &m); in handle_backoff()
4556 handle_backoff_unblock(osd, &m); in handle_backoff()
4559 pr_err("%s osd%d unknown op %d\n", __func__, osd->o_osd, m.op); in handle_backoff()
4566 mutex_unlock(&osd->lock); in handle_backoff()
4571 * Process osd watch notifications
4743 struct ceph_osd *osd = rb_entry(n, struct ceph_osd, o_node); in ceph_osdc_sync() local
4745 mutex_lock(&osd->lock); in ceph_osdc_sync()
4746 for (p = rb_first(&osd->o_requests); p; p = rb_next(p)) { in ceph_osdc_sync()
4757 mutex_unlock(&osd->lock); in ceph_osdc_sync()
4766 mutex_unlock(&osd->lock); in ceph_osdc_sync()
5170 * Execute an OSD class method on an object.
5227 * reset all osd connections
5235 struct ceph_osd *osd = rb_entry(n, struct ceph_osd, o_node); in ceph_osdc_reopen_osds() local
5238 if (!reopen_osd(osd)) in ceph_osdc_reopen_osds()
5239 kick_osd_requests(osd); in ceph_osdc_reopen_osds()
5326 struct ceph_osd *osd = rb_entry(rb_first(&osdc->osds), in ceph_osdc_stop() local
5328 close_osd(osd); in ceph_osdc_stop()
5409 struct ceph_osd *osd = con->private; in osd_dispatch() local
5410 struct ceph_osd_client *osdc = osd->o_osdc; in osd_dispatch()
5418 handle_reply(osd, msg); in osd_dispatch()
5421 handle_backoff(osd, msg); in osd_dispatch()
5462 struct ceph_osd *osd = con->private; in get_reply() local
5463 struct ceph_osd_client *osdc = osd->o_osdc; in get_reply()
5472 if (!osd_registered(osd)) { in get_reply()
5473 dout("%s osd%d unknown, skipping\n", __func__, osd->o_osd); in get_reply()
5477 WARN_ON(osd->o_osd != le64_to_cpu(hdr->src.num)); in get_reply()
5479 mutex_lock(&osd->lock); in get_reply()
5480 req = lookup_request(&osd->o_requests, tid); in get_reply()
5482 dout("%s osd%d tid %llu unknown, skipping\n", __func__, in get_reply()
5483 osd->o_osd, tid); in get_reply()
5491 pr_warn("%s osd%d tid %llu front %d > preallocated %d\n", in get_reply()
5492 __func__, osd->o_osd, req->r_tid, front_len, in get_reply()
5504 pr_warn("%s osd%d tid %llu data %d > preallocated %zu, skipping\n", in get_reply()
5505 __func__, osd->o_osd, req->r_tid, data_len, in get_reply()
5518 mutex_unlock(&osd->lock); in get_reply()
5555 struct ceph_osd *osd = con->private; in osd_alloc_msg() local
5567 pr_warn("%s osd%d unknown msg type %d, skipping\n", __func__, in osd_alloc_msg()
5568 osd->o_osd, type); in osd_alloc_msg()
5579 struct ceph_osd *osd = con->private; in osd_get_con() local
5580 if (get_osd(osd)) in osd_get_con()
5587 struct ceph_osd *osd = con->private; in osd_put_con() local
5588 put_osd(osd); in osd_put_con()
5887 dout("%s: OSD returned 0x%x extents in a single reply!\n", in osd_sparse_read()