Lines Matching refs:lreq
52 struct ceph_osd_linger_request *lreq);
54 struct ceph_osd_linger_request *lreq);
85 static inline void verify_lreq_locked(struct ceph_osd_linger_request *lreq) in verify_lreq_locked() argument
87 WARN_ON(!mutex_is_locked(&lreq->lock)); in verify_lreq_locked()
93 static inline void verify_lreq_locked(struct ceph_osd_linger_request *lreq) { } in verify_lreq_locked() argument
1237 struct ceph_osd_linger_request *lreq = in close_osd() local
1242 dout(" reassigning lreq %p linger_id %llu\n", lreq, in close_osd()
1243 lreq->linger_id); in close_osd()
1244 unlink_linger(osd, lreq); in close_osd()
1245 link_linger(&osdc->homeless_osd, lreq); in close_osd()
2554 struct ceph_osd_linger_request *lreq = in linger_release() local
2557 dout("%s lreq %p reg_req %p ping_req %p\n", __func__, lreq, in linger_release()
2558 lreq->reg_req, lreq->ping_req); in linger_release()
2559 WARN_ON(!RB_EMPTY_NODE(&lreq->node)); in linger_release()
2560 WARN_ON(!RB_EMPTY_NODE(&lreq->osdc_node)); in linger_release()
2561 WARN_ON(!RB_EMPTY_NODE(&lreq->mc_node)); in linger_release()
2562 WARN_ON(!list_empty(&lreq->scan_item)); in linger_release()
2563 WARN_ON(!list_empty(&lreq->pending_lworks)); in linger_release()
2564 WARN_ON(lreq->osd); in linger_release()
2566 if (lreq->reg_req) in linger_release()
2567 ceph_osdc_put_request(lreq->reg_req); in linger_release()
2568 if (lreq->ping_req) in linger_release()
2569 ceph_osdc_put_request(lreq->ping_req); in linger_release()
2570 target_destroy(&lreq->t); in linger_release()
2571 kfree(lreq); in linger_release()
2574 static void linger_put(struct ceph_osd_linger_request *lreq) in linger_put() argument
2576 if (lreq) in linger_put()
2577 kref_put(&lreq->kref, linger_release); in linger_put()
2581 linger_get(struct ceph_osd_linger_request *lreq) in linger_get() argument
2583 kref_get(&lreq->kref); in linger_get()
2584 return lreq; in linger_get()
2590 struct ceph_osd_linger_request *lreq; in linger_alloc() local
2592 lreq = kzalloc(sizeof(*lreq), GFP_NOIO); in linger_alloc()
2593 if (!lreq) in linger_alloc()
2596 kref_init(&lreq->kref); in linger_alloc()
2597 mutex_init(&lreq->lock); in linger_alloc()
2598 RB_CLEAR_NODE(&lreq->node); in linger_alloc()
2599 RB_CLEAR_NODE(&lreq->osdc_node); in linger_alloc()
2600 RB_CLEAR_NODE(&lreq->mc_node); in linger_alloc()
2601 INIT_LIST_HEAD(&lreq->scan_item); in linger_alloc()
2602 INIT_LIST_HEAD(&lreq->pending_lworks); in linger_alloc()
2603 init_completion(&lreq->reg_commit_wait); in linger_alloc()
2604 init_completion(&lreq->notify_finish_wait); in linger_alloc()
2606 lreq->osdc = osdc; in linger_alloc()
2607 target_init(&lreq->t); in linger_alloc()
2609 dout("%s lreq %p\n", __func__, lreq); in linger_alloc()
2610 return lreq; in linger_alloc()
2623 struct ceph_osd_linger_request *lreq) in DEFINE_RB_INSDEL_FUNCS()
2626 WARN_ON(!lreq->linger_id || lreq->osd); in DEFINE_RB_INSDEL_FUNCS()
2628 osd->o_osd, lreq, lreq->linger_id); in DEFINE_RB_INSDEL_FUNCS()
2636 insert_linger(&osd->o_linger_requests, lreq); in DEFINE_RB_INSDEL_FUNCS()
2637 lreq->osd = osd; in DEFINE_RB_INSDEL_FUNCS()
2641 struct ceph_osd_linger_request *lreq) in unlink_linger() argument
2644 WARN_ON(lreq->osd != osd); in unlink_linger()
2646 osd->o_osd, lreq, lreq->linger_id); in unlink_linger()
2648 lreq->osd = NULL; in unlink_linger()
2649 erase_linger(&osd->o_linger_requests, lreq); in unlink_linger()
2658 static bool __linger_registered(struct ceph_osd_linger_request *lreq) in __linger_registered() argument
2660 verify_osdc_locked(lreq->osdc); in __linger_registered()
2662 return !RB_EMPTY_NODE(&lreq->osdc_node); in __linger_registered()
2665 static bool linger_registered(struct ceph_osd_linger_request *lreq) in linger_registered() argument
2667 struct ceph_osd_client *osdc = lreq->osdc; in linger_registered()
2671 registered = __linger_registered(lreq); in linger_registered()
2677 static void linger_register(struct ceph_osd_linger_request *lreq) in linger_register() argument
2679 struct ceph_osd_client *osdc = lreq->osdc; in linger_register()
2682 WARN_ON(lreq->linger_id); in linger_register()
2684 linger_get(lreq); in linger_register()
2685 lreq->linger_id = ++osdc->last_linger_id; in linger_register()
2686 insert_linger_osdc(&osdc->linger_requests, lreq); in linger_register()
2689 static void linger_unregister(struct ceph_osd_linger_request *lreq) in linger_unregister() argument
2691 struct ceph_osd_client *osdc = lreq->osdc; in linger_unregister()
2695 erase_linger_osdc(&osdc->linger_requests, lreq); in linger_unregister()
2696 linger_put(lreq); in linger_unregister()
2701 struct ceph_osd_linger_request *lreq = req->r_priv; in cancel_linger_request() local
2705 linger_put(lreq); in cancel_linger_request()
2710 struct ceph_osd_linger_request *lreq; member
2729 static struct linger_work *lwork_alloc(struct ceph_osd_linger_request *lreq, in lwork_alloc() argument
2740 lwork->lreq = linger_get(lreq); in lwork_alloc()
2747 struct ceph_osd_linger_request *lreq = lwork->lreq; in lwork_free() local
2749 mutex_lock(&lreq->lock); in lwork_free()
2751 mutex_unlock(&lreq->lock); in lwork_free()
2753 linger_put(lreq); in lwork_free()
2759 struct ceph_osd_linger_request *lreq = lwork->lreq; in lwork_queue() local
2760 struct ceph_osd_client *osdc = lreq->osdc; in lwork_queue()
2762 verify_lreq_locked(lreq); in lwork_queue()
2766 list_add_tail(&lwork->pending_item, &lreq->pending_lworks); in lwork_queue()
2773 struct ceph_osd_linger_request *lreq = lwork->lreq; in do_watch_notify() local
2775 if (!linger_registered(lreq)) { in do_watch_notify()
2776 dout("%s lreq %p not registered\n", __func__, lreq); in do_watch_notify()
2780 WARN_ON(!lreq->is_watch); in do_watch_notify()
2782 __func__, lreq, lwork->notify.notify_id, lwork->notify.notifier_id, in do_watch_notify()
2784 lreq->wcb(lreq->data, lwork->notify.notify_id, lreq->linger_id, in do_watch_notify()
2796 struct ceph_osd_linger_request *lreq = lwork->lreq; in do_watch_error() local
2798 if (!linger_registered(lreq)) { in do_watch_error()
2799 dout("%s lreq %p not registered\n", __func__, lreq); in do_watch_error()
2803 dout("%s lreq %p err %d\n", __func__, lreq, lwork->error.err); in do_watch_error()
2804 lreq->errcb(lreq->data, lreq->linger_id, lwork->error.err); in do_watch_error()
2810 static void queue_watch_error(struct ceph_osd_linger_request *lreq) in queue_watch_error() argument
2814 lwork = lwork_alloc(lreq, do_watch_error); in queue_watch_error()
2820 lwork->error.err = lreq->last_error; in queue_watch_error()
2824 static void linger_reg_commit_complete(struct ceph_osd_linger_request *lreq, in linger_reg_commit_complete() argument
2827 if (!completion_done(&lreq->reg_commit_wait)) { in linger_reg_commit_complete()
2828 lreq->reg_commit_error = (result <= 0 ? result : 0); in linger_reg_commit_complete()
2829 complete_all(&lreq->reg_commit_wait); in linger_reg_commit_complete()
2835 struct ceph_osd_linger_request *lreq = req->r_priv; in linger_commit_cb() local
2837 mutex_lock(&lreq->lock); in linger_commit_cb()
2838 dout("%s lreq %p linger_id %llu result %d\n", __func__, lreq, in linger_commit_cb()
2839 lreq->linger_id, req->r_result); in linger_commit_cb()
2840 linger_reg_commit_complete(lreq, req->r_result); in linger_commit_cb()
2841 lreq->committed = true; in linger_commit_cb()
2843 if (!lreq->is_watch) { in linger_commit_cb()
2853 lreq->notify_id = ceph_decode_64(&p); in linger_commit_cb()
2854 dout("lreq %p notify_id %llu\n", lreq, in linger_commit_cb()
2855 lreq->notify_id); in linger_commit_cb()
2857 dout("lreq %p no notify_id\n", lreq); in linger_commit_cb()
2861 mutex_unlock(&lreq->lock); in linger_commit_cb()
2862 linger_put(lreq); in linger_commit_cb()
2880 struct ceph_osd_linger_request *lreq = req->r_priv; in linger_reconnect_cb() local
2882 mutex_lock(&lreq->lock); in linger_reconnect_cb()
2884 lreq, lreq->linger_id, req->r_result, lreq->last_error); in linger_reconnect_cb()
2886 if (!lreq->last_error) { in linger_reconnect_cb()
2887 lreq->last_error = normalize_watch_error(req->r_result); in linger_reconnect_cb()
2888 queue_watch_error(lreq); in linger_reconnect_cb()
2892 mutex_unlock(&lreq->lock); in linger_reconnect_cb()
2893 linger_put(lreq); in linger_reconnect_cb()
2896 static void send_linger(struct ceph_osd_linger_request *lreq) in send_linger() argument
2898 struct ceph_osd_request *req = lreq->reg_req; in send_linger()
2902 dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id); in send_linger()
2908 ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); in send_linger()
2909 ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); in send_linger()
2910 req->r_flags = lreq->t.flags; in send_linger()
2911 req->r_mtime = lreq->mtime; in send_linger()
2913 mutex_lock(&lreq->lock); in send_linger()
2914 if (lreq->is_watch && lreq->committed) { in send_linger()
2916 op->watch.cookie != lreq->linger_id); in send_linger()
2918 op->watch.gen = ++lreq->register_gen; in send_linger()
2919 dout("lreq %p reconnect register_gen %u\n", lreq, in send_linger()
2923 if (!lreq->is_watch) in send_linger()
2924 lreq->notify_id = 0; in send_linger()
2927 dout("lreq %p register\n", lreq); in send_linger()
2930 mutex_unlock(&lreq->lock); in send_linger()
2932 req->r_priv = linger_get(lreq); in send_linger()
2940 struct ceph_osd_linger_request *lreq = req->r_priv; in linger_ping_cb() local
2942 mutex_lock(&lreq->lock); in linger_ping_cb()
2944 __func__, lreq, lreq->linger_id, req->r_result, lreq->ping_sent, in linger_ping_cb()
2945 lreq->last_error); in linger_ping_cb()
2946 if (lreq->register_gen == req->r_ops[0].watch.gen) { in linger_ping_cb()
2948 lreq->watch_valid_thru = lreq->ping_sent; in linger_ping_cb()
2949 } else if (!lreq->last_error) { in linger_ping_cb()
2950 lreq->last_error = normalize_watch_error(req->r_result); in linger_ping_cb()
2951 queue_watch_error(lreq); in linger_ping_cb()
2954 dout("lreq %p register_gen %u ignoring old pong %u\n", lreq, in linger_ping_cb()
2955 lreq->register_gen, req->r_ops[0].watch.gen); in linger_ping_cb()
2958 mutex_unlock(&lreq->lock); in linger_ping_cb()
2959 linger_put(lreq); in linger_ping_cb()
2962 static void send_linger_ping(struct ceph_osd_linger_request *lreq) in send_linger_ping() argument
2964 struct ceph_osd_client *osdc = lreq->osdc; in send_linger_ping()
2965 struct ceph_osd_request *req = lreq->ping_req; in send_linger_ping()
2973 lreq->ping_sent = jiffies; in send_linger_ping()
2975 __func__, lreq, lreq->linger_id, lreq->ping_sent, in send_linger_ping()
2976 lreq->register_gen); in send_linger_ping()
2982 target_copy(&req->r_t, &lreq->t); in send_linger_ping()
2985 op->watch.cookie != lreq->linger_id || in send_linger_ping()
2987 op->watch.gen = lreq->register_gen; in send_linger_ping()
2989 req->r_priv = linger_get(lreq); in send_linger_ping()
2995 link_request(lreq->osd, req); in send_linger_ping()
2999 static void linger_submit(struct ceph_osd_linger_request *lreq) in linger_submit() argument
3001 struct ceph_osd_client *osdc = lreq->osdc; in linger_submit()
3004 calc_target(osdc, &lreq->t, NULL, false); in linger_submit()
3005 osd = lookup_create_osd(osdc, lreq->t.osd, true); in linger_submit()
3006 link_linger(osd, lreq); in linger_submit()
3008 send_linger(lreq); in linger_submit()
3011 static void cancel_linger_map_check(struct ceph_osd_linger_request *lreq) in cancel_linger_map_check() argument
3013 struct ceph_osd_client *osdc = lreq->osdc; in cancel_linger_map_check()
3019 lreq->linger_id); in cancel_linger_map_check()
3023 WARN_ON(lookup_lreq != lreq); in cancel_linger_map_check()
3024 erase_linger_mc(&osdc->linger_map_checks, lreq); in cancel_linger_map_check()
3025 linger_put(lreq); in cancel_linger_map_check()
3031 static void __linger_cancel(struct ceph_osd_linger_request *lreq) in __linger_cancel() argument
3033 if (lreq->is_watch && lreq->ping_req->r_osd) in __linger_cancel()
3034 cancel_linger_request(lreq->ping_req); in __linger_cancel()
3035 if (lreq->reg_req->r_osd) in __linger_cancel()
3036 cancel_linger_request(lreq->reg_req); in __linger_cancel()
3037 cancel_linger_map_check(lreq); in __linger_cancel()
3038 unlink_linger(lreq->osd, lreq); in __linger_cancel()
3039 linger_unregister(lreq); in __linger_cancel()
3042 static void linger_cancel(struct ceph_osd_linger_request *lreq) in linger_cancel() argument
3044 struct ceph_osd_client *osdc = lreq->osdc; in linger_cancel()
3047 if (__linger_registered(lreq)) in linger_cancel()
3048 __linger_cancel(lreq); in linger_cancel()
3052 static void send_linger_map_check(struct ceph_osd_linger_request *lreq);
3054 static void check_linger_pool_dne(struct ceph_osd_linger_request *lreq) in check_linger_pool_dne() argument
3056 struct ceph_osd_client *osdc = lreq->osdc; in check_linger_pool_dne()
3062 if (lreq->register_gen) { in check_linger_pool_dne()
3063 lreq->map_dne_bound = map->epoch; in check_linger_pool_dne()
3065 lreq, lreq->linger_id); in check_linger_pool_dne()
3068 __func__, lreq, lreq->linger_id, lreq->map_dne_bound, in check_linger_pool_dne()
3072 if (lreq->map_dne_bound) { in check_linger_pool_dne()
3073 if (map->epoch >= lreq->map_dne_bound) { in check_linger_pool_dne()
3076 lreq->linger_id); in check_linger_pool_dne()
3077 linger_reg_commit_complete(lreq, -ENOENT); in check_linger_pool_dne()
3078 __linger_cancel(lreq); in check_linger_pool_dne()
3081 send_linger_map_check(lreq); in check_linger_pool_dne()
3088 struct ceph_osd_linger_request *lreq; in linger_map_check_cb() local
3094 lreq = lookup_linger_mc(&osdc->linger_map_checks, linger_id); in linger_map_check_cb()
3095 if (!lreq) { in linger_map_check_cb()
3101 __func__, lreq, lreq->linger_id, lreq->map_dne_bound, in linger_map_check_cb()
3103 if (!lreq->map_dne_bound) in linger_map_check_cb()
3104 lreq->map_dne_bound = greq->u.newest; in linger_map_check_cb()
3105 erase_linger_mc(&osdc->linger_map_checks, lreq); in linger_map_check_cb()
3106 check_linger_pool_dne(lreq); in linger_map_check_cb()
3108 linger_put(lreq); in linger_map_check_cb()
3113 static void send_linger_map_check(struct ceph_osd_linger_request *lreq) in send_linger_map_check() argument
3115 struct ceph_osd_client *osdc = lreq->osdc; in send_linger_map_check()
3122 lreq->linger_id); in send_linger_map_check()
3124 WARN_ON(lookup_lreq != lreq); in send_linger_map_check()
3128 linger_get(lreq); in send_linger_map_check()
3129 insert_linger_mc(&osdc->linger_map_checks, lreq); in send_linger_map_check()
3131 linger_map_check_cb, lreq->linger_id); in send_linger_map_check()
3135 static int linger_reg_commit_wait(struct ceph_osd_linger_request *lreq) in linger_reg_commit_wait() argument
3139 dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id); in linger_reg_commit_wait()
3140 ret = wait_for_completion_interruptible(&lreq->reg_commit_wait); in linger_reg_commit_wait()
3141 return ret ?: lreq->reg_commit_error; in linger_reg_commit_wait()
3144 static int linger_notify_finish_wait(struct ceph_osd_linger_request *lreq) in linger_notify_finish_wait() argument
3148 dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id); in linger_notify_finish_wait()
3149 ret = wait_for_completion_interruptible(&lreq->notify_finish_wait); in linger_notify_finish_wait()
3150 return ret ?: lreq->notify_finish_error; in linger_notify_finish_wait()
3200 struct ceph_osd_linger_request *lreq = in handle_timeout() local
3204 lreq, lreq->linger_id, osd->o_osd); in handle_timeout()
3207 mutex_lock(&lreq->lock); in handle_timeout()
3208 if (lreq->is_watch && lreq->committed && !lreq->last_error) in handle_timeout()
3209 send_linger_ping(lreq); in handle_timeout()
3210 mutex_unlock(&lreq->lock); in handle_timeout()
3615 recalc_linger_target(struct ceph_osd_linger_request *lreq) in recalc_linger_target() argument
3617 struct ceph_osd_client *osdc = lreq->osdc; in recalc_linger_target()
3620 ct_res = calc_target(osdc, &lreq->t, NULL, true); in recalc_linger_target()
3624 osd = lookup_create_osd(osdc, lreq->t.osd, true); in recalc_linger_target()
3625 if (osd != lreq->osd) { in recalc_linger_target()
3626 unlink_linger(lreq->osd, lreq); in recalc_linger_target()
3627 link_linger(osd, lreq); in recalc_linger_target()
3649 struct ceph_osd_linger_request *lreq = in scan_requests() local
3655 dout("%s lreq %p linger_id %llu\n", __func__, lreq, in scan_requests()
3656 lreq->linger_id); in scan_requests()
3657 ct_res = recalc_linger_target(lreq); in scan_requests()
3662 pool_cleared_full(osdc, lreq->t.base_oloc.pool)); in scan_requests()
3668 cancel_linger_map_check(lreq); in scan_requests()
3674 if (list_empty(&lreq->scan_item)) in scan_requests()
3675 list_add_tail(&lreq->scan_item, need_resend_linger); in scan_requests()
3678 list_del_init(&lreq->scan_item); in scan_requests()
3679 check_linger_pool_dne(lreq); in scan_requests()
3790 struct ceph_osd_linger_request *lreq, *nlreq; in kick_requests() local
3828 list_for_each_entry_safe(lreq, nlreq, need_resend_linger, scan_item) { in kick_requests()
3829 if (!osd_homeless(lreq->osd)) in kick_requests()
3830 send_linger(lreq); in kick_requests()
3832 list_del_init(&lreq->scan_item); in kick_requests()
3976 struct ceph_osd_linger_request *lreq = in kick_osd_requests() local
3979 send_linger(lreq); in kick_osd_requests()
4270 struct ceph_osd_linger_request *lreq; in handle_watch_notify() local
4299 lreq = lookup_linger_osdc(&osdc->linger_requests, cookie); in handle_watch_notify()
4300 if (!lreq) { in handle_watch_notify()
4306 mutex_lock(&lreq->lock); in handle_watch_notify()
4308 opcode, cookie, lreq, lreq->is_watch); in handle_watch_notify()
4310 if (!lreq->last_error) { in handle_watch_notify()
4311 lreq->last_error = -ENOTCONN; in handle_watch_notify()
4312 queue_watch_error(lreq); in handle_watch_notify()
4314 } else if (!lreq->is_watch) { in handle_watch_notify()
4316 if (lreq->notify_id && lreq->notify_id != notify_id) { in handle_watch_notify()
4317 dout("lreq %p notify_id %llu != %llu, ignoring\n", lreq, in handle_watch_notify()
4318 lreq->notify_id, notify_id); in handle_watch_notify()
4319 } else if (!completion_done(&lreq->notify_finish_wait)) { in handle_watch_notify()
4326 if (lreq->preply_pages) { in handle_watch_notify()
4329 *lreq->preply_pages = data->pages; in handle_watch_notify()
4330 *lreq->preply_len = data->length; in handle_watch_notify()
4336 lreq->notify_finish_error = return_code; in handle_watch_notify()
4337 complete_all(&lreq->notify_finish_wait); in handle_watch_notify()
4341 lwork = lwork_alloc(lreq, do_watch_notify); in handle_watch_notify()
4356 mutex_unlock(&lreq->lock); in handle_watch_notify()
4469 alloc_linger_request(struct ceph_osd_linger_request *lreq) in alloc_linger_request() argument
4473 req = ceph_osdc_alloc_request(lreq->osdc, NULL, 1, false, GFP_NOIO); in alloc_linger_request()
4477 ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); in alloc_linger_request()
4478 ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); in alloc_linger_request()
4499 struct ceph_osd_linger_request *lreq; in ceph_osdc_watch() local
4502 lreq = linger_alloc(osdc); in ceph_osdc_watch()
4503 if (!lreq) in ceph_osdc_watch()
4506 lreq->is_watch = true; in ceph_osdc_watch()
4507 lreq->wcb = wcb; in ceph_osdc_watch()
4508 lreq->errcb = errcb; in ceph_osdc_watch()
4509 lreq->data = data; in ceph_osdc_watch()
4510 lreq->watch_valid_thru = jiffies; in ceph_osdc_watch()
4512 ceph_oid_copy(&lreq->t.base_oid, oid); in ceph_osdc_watch()
4513 ceph_oloc_copy(&lreq->t.base_oloc, oloc); in ceph_osdc_watch()
4514 lreq->t.flags = CEPH_OSD_FLAG_WRITE; in ceph_osdc_watch()
4515 ktime_get_real_ts64(&lreq->mtime); in ceph_osdc_watch()
4517 lreq->reg_req = alloc_linger_request(lreq); in ceph_osdc_watch()
4518 if (!lreq->reg_req) { in ceph_osdc_watch()
4523 lreq->ping_req = alloc_linger_request(lreq); in ceph_osdc_watch()
4524 if (!lreq->ping_req) { in ceph_osdc_watch()
4530 linger_register(lreq); /* before osd_req_op_* */ in ceph_osdc_watch()
4531 osd_req_op_watch_init(lreq->reg_req, 0, lreq->linger_id, in ceph_osdc_watch()
4533 osd_req_op_watch_init(lreq->ping_req, 0, lreq->linger_id, in ceph_osdc_watch()
4535 linger_submit(lreq); in ceph_osdc_watch()
4538 ret = linger_reg_commit_wait(lreq); in ceph_osdc_watch()
4540 linger_cancel(lreq); in ceph_osdc_watch()
4544 return lreq; in ceph_osdc_watch()
4547 linger_put(lreq); in ceph_osdc_watch()
4560 struct ceph_osd_linger_request *lreq) in ceph_osdc_unwatch() argument
4570 ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); in ceph_osdc_unwatch()
4571 ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); in ceph_osdc_unwatch()
4574 osd_req_op_watch_init(req, 0, lreq->linger_id, in ceph_osdc_unwatch()
4582 linger_cancel(lreq); in ceph_osdc_unwatch()
4583 linger_put(lreq); in ceph_osdc_unwatch()
4709 struct ceph_osd_linger_request *lreq; in ceph_osdc_notify() local
4719 lreq = linger_alloc(osdc); in ceph_osdc_notify()
4720 if (!lreq) in ceph_osdc_notify()
4723 lreq->preply_pages = preply_pages; in ceph_osdc_notify()
4724 lreq->preply_len = preply_len; in ceph_osdc_notify()
4726 ceph_oid_copy(&lreq->t.base_oid, oid); in ceph_osdc_notify()
4727 ceph_oloc_copy(&lreq->t.base_oloc, oloc); in ceph_osdc_notify()
4728 lreq->t.flags = CEPH_OSD_FLAG_READ; in ceph_osdc_notify()
4730 lreq->reg_req = alloc_linger_request(lreq); in ceph_osdc_notify()
4731 if (!lreq->reg_req) { in ceph_osdc_notify()
4744 linger_register(lreq); /* before osd_req_op_* */ in ceph_osdc_notify()
4745 ret = osd_req_op_notify_init(lreq->reg_req, 0, lreq->linger_id, 1, in ceph_osdc_notify()
4748 linger_unregister(lreq); in ceph_osdc_notify()
4753 ceph_osd_data_pages_init(osd_req_op_data(lreq->reg_req, 0, notify, in ceph_osdc_notify()
4756 linger_submit(lreq); in ceph_osdc_notify()
4759 ret = linger_reg_commit_wait(lreq); in ceph_osdc_notify()
4761 ret = linger_notify_finish_wait(lreq); in ceph_osdc_notify()
4763 dout("lreq %p failed to initiate notify %d\n", lreq, ret); in ceph_osdc_notify()
4765 linger_cancel(lreq); in ceph_osdc_notify()
4767 linger_put(lreq); in ceph_osdc_notify()
4778 struct ceph_osd_linger_request *lreq) in ceph_osdc_watch_check() argument
4784 mutex_lock(&lreq->lock); in ceph_osdc_watch_check()
4785 stamp = lreq->watch_valid_thru; in ceph_osdc_watch_check()
4786 if (!list_empty(&lreq->pending_lworks)) { in ceph_osdc_watch_check()
4788 list_first_entry(&lreq->pending_lworks, in ceph_osdc_watch_check()
4797 lreq, lreq->linger_id, age, lreq->last_error); in ceph_osdc_watch_check()
4799 ret = lreq->last_error ?: 1 + jiffies_to_msecs(age); in ceph_osdc_watch_check()
4801 mutex_unlock(&lreq->lock); in ceph_osdc_watch_check()