• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/fs/ceph/

Lines Matching defs:osd

23 static void kick_requests(struct ceph_osd_client *osdc, struct ceph_osd *osd);
35 * are described by the osd map.
48 * fill osd op in request message.
119 * if @do_sync, include a 'startsync' command so that the osd will flush
240 * We keep osd requests in an rbtree, sorted by ->r_tid.
306 * If the osd connection drops, we need to resubmit all requests.
310 struct ceph_osd *osd = con->private;
313 if (!osd)
315 dout("osd_reset osd%d\n", osd->o_osd);
316 osdc = osd->o_osdc;
318 kick_requests(osdc, osd);
327 struct ceph_osd *osd;
329 osd = kzalloc(sizeof(*osd), GFP_NOFS);
330 if (!osd)
333 atomic_set(&osd->o_ref, 1);
334 osd->o_osdc = osdc;
335 INIT_LIST_HEAD(&osd->o_requests);
336 INIT_LIST_HEAD(&osd->o_osd_lru);
337 osd->o_incarnation = 1;
339 ceph_con_init(osdc->client->msgr, &osd->o_con);
340 osd->o_con.private = osd;
341 osd->o_con.ops = &osd_con_ops;
342 osd->o_con.peer_name.type = CEPH_ENTITY_TYPE_OSD;
344 INIT_LIST_HEAD(&osd->o_keepalive_item);
345 return osd;
348 static struct ceph_osd *get_osd(struct ceph_osd *osd)
350 if (atomic_inc_not_zero(&osd->o_ref)) {
351 dout("get_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref)-1,
352 atomic_read(&osd->o_ref));
353 return osd;
355 dout("get_osd %p FAIL\n", osd);
360 static void put_osd(struct ceph_osd *osd)
362 dout("put_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref),
363 atomic_read(&osd->o_ref) - 1);
364 if (atomic_dec_and_test(&osd->o_ref)) {
365 struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth;
367 if (osd->o_authorizer)
368 ac->ops->destroy_authorizer(ac, osd->o_authorizer);
369 kfree(osd);
374 * remove an osd from our map
376 static void __remove_osd(struct ceph_osd_client *osdc, struct ceph_osd *osd)
378 dout("__remove_osd %p\n", osd);
379 BUG_ON(!list_empty(&osd->o_requests));
380 rb_erase(&osd->o_node, &osdc->osds);
381 list_del_init(&osd->o_osd_lru);
382 ceph_con_close(&osd->o_con);
383 put_osd(osd);
387 struct ceph_osd *osd)
389 dout("__move_osd_to_lru %p\n", osd);
390 BUG_ON(!list_empty(&osd->o_osd_lru));
391 list_add_tail(&osd->o_osd_lru, &osdc->osd_lru);
392 osd->lru_ttl = jiffies + osdc->client->mount_args->osd_idle_ttl * HZ;
395 static void __remove_osd_from_lru(struct ceph_osd *osd)
397 dout("__remove_osd_from_lru %p\n", osd);
398 if (!list_empty(&osd->o_osd_lru))
399 list_del_init(&osd->o_osd_lru);
404 struct ceph_osd *osd, *nosd;
408 list_for_each_entry_safe(osd, nosd, &osdc->osd_lru, o_osd_lru) {
409 if (!remove_all && time_before(jiffies, osd->lru_ttl))
411 __remove_osd(osdc, osd);
417 * reset osd connect
419 static int __reset_osd(struct ceph_osd_client *osdc, struct ceph_osd *osd)
424 dout("__reset_osd %p osd%d\n", osd, osd->o_osd);
425 if (list_empty(&osd->o_requests)) {
426 __remove_osd(osdc, osd);
427 } else if (memcmp(&osdc->osdmap->osd_addr[osd->o_osd],
428 &osd->o_con.peer_addr,
429 sizeof(osd->o_con.peer_addr)) == 0 &&
430 !ceph_con_opened(&osd->o_con)) {
431 dout(" osd addr hasn't changed and connection never opened,"
434 list_for_each_entry(req, &osd->o_requests, r_osd_item)
438 ceph_con_close(&osd->o_con);
439 ceph_con_open(&osd->o_con, &osdc->osdmap->osd_addr[osd->o_osd]);
440 osd->o_incarnation++;
449 struct ceph_osd *osd = NULL;
453 osd = rb_entry(parent, struct ceph_osd, o_node);
454 if (new->o_osd < osd->o_osd)
456 else if (new->o_osd > osd->o_osd)
468 struct ceph_osd *osd;
472 osd = rb_entry(n, struct ceph_osd, o_node);
473 if (o < osd->o_osd)
475 else if (o > osd->o_osd)
478 return osd;
560 * Pick an osd (the first 'up' osd in the pg), allocate the osd struct
562 * no up osd, set r_osd to NULL.
598 dout("map_osds tid %llu pgid %d.%x osd%d (was osd%d)\n",
619 dout("map_osds osd %p is osd%d\n", req->r_osd, o);
631 err = 1; /* osd or pg changed */
655 dout("send_request %p tid %llu to osd%d flags %d\n",
673 * Timeout callback, called every N seconds when 1 or more osd
686 struct ceph_osd *osd;
720 * should mark the osd as failed and we should find out about
721 * it from an updated osd map.
734 osd = req->r_osd;
735 BUG_ON(!osd);
736 pr_warning(" tid %llu timed out on osd%d, will reset osd\n",
737 req->r_tid, osd->o_osd);
738 __kick_requests(osdc, osd);
744 * a connection with that osd (from the fault callback).
751 osd = req->r_osd;
752 BUG_ON(!osd);
753 dout(" tid %llu is slow, will send keepalive on osd%d\n",
754 req->r_tid, osd->o_osd);
755 list_move_tail(&osd->o_keepalive_item, &slow_osds);
758 osd = list_entry(slow_osds.next, struct ceph_osd,
760 list_del_init(&osd->o_keepalive_item);
761 ceph_con_keepalive(&osd->o_con);
788 * handle osd op reply. either call the callback if it is specified,
893 dout("kick_requests osd%d\n", kickosd ? kickosd->o_osd : -1);
900 struct ceph_osd *osd =
904 if (!ceph_osd_is_up(osdc->osdmap, osd->o_osd) ||
905 memcmp(&osd->o_con.peer_addr,
907 osd->o_osd),
909 __reset_osd(osdc, osd);
935 dout("tid %llu maps to no valid osd\n", req->r_tid);
941 dout("kicking %p tid %llu osd%d\n", req, req->r_tid,
955 * Resubmit osd requests whose osd or osd address has changed. Request
956 * a new osd map if osds are down, or we are otherwise unable to determine
961 * If @who is specified, resubmit requests for that specific osd.
981 * Process updated osd map.
1333 struct ceph_osd *osd = con->private;
1337 if (!osd)
1339 osdc = osd->o_osdc;
1365 struct ceph_osd *osd = con->private;
1366 struct ceph_osd_client *osdc = osd->o_osdc;
1379 pr_info("get_reply unknown tid %llu from osd%d\n", tid,
1380 osd->o_osd);
1432 struct ceph_osd *osd = con->private;
1442 pr_info("alloc_msg unexpected msg type %d from osd%d\n", type,
1443 osd->o_osd);
1454 struct ceph_osd *osd = con->private;
1455 if (get_osd(osd))
1462 struct ceph_osd *osd = con->private;
1463 put_osd(osd);