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
1328 struct ceph_osd_linger_request *lreq = in close_osd() local
1333 dout(" reassigning lreq %p linger_id %llu\n", lreq, in close_osd()
1334 lreq->linger_id); in close_osd()
1335 unlink_linger(osd, lreq); in close_osd()
1336 link_linger(&osdc->homeless_osd, lreq); in close_osd()
2718 struct ceph_osd_linger_request *lreq = in linger_release() local
2721 dout("%s lreq %p reg_req %p ping_req %p\n", __func__, lreq, in linger_release()
2722 lreq->reg_req, lreq->ping_req); in linger_release()
2723 WARN_ON(!RB_EMPTY_NODE(&lreq->node)); in linger_release()
2724 WARN_ON(!RB_EMPTY_NODE(&lreq->osdc_node)); in linger_release()
2725 WARN_ON(!RB_EMPTY_NODE(&lreq->mc_node)); in linger_release()
2726 WARN_ON(!list_empty(&lreq->scan_item)); in linger_release()
2727 WARN_ON(!list_empty(&lreq->pending_lworks)); in linger_release()
2728 WARN_ON(lreq->osd); in linger_release()
2730 if (lreq->reg_req) in linger_release()
2731 ceph_osdc_put_request(lreq->reg_req); in linger_release()
2732 if (lreq->ping_req) in linger_release()
2733 ceph_osdc_put_request(lreq->ping_req); in linger_release()
2734 target_destroy(&lreq->t); in linger_release()
2735 kfree(lreq); in linger_release()
2738 static void linger_put(struct ceph_osd_linger_request *lreq) in linger_put() argument
2740 if (lreq) in linger_put()
2741 kref_put(&lreq->kref, linger_release); in linger_put()
2745 linger_get(struct ceph_osd_linger_request *lreq) in linger_get() argument
2747 kref_get(&lreq->kref); in linger_get()
2748 return lreq; in linger_get()
2754 struct ceph_osd_linger_request *lreq; in linger_alloc() local
2756 lreq = kzalloc(sizeof(*lreq), GFP_NOIO); in linger_alloc()
2757 if (!lreq) in linger_alloc()
2760 kref_init(&lreq->kref); in linger_alloc()
2761 mutex_init(&lreq->lock); in linger_alloc()
2762 RB_CLEAR_NODE(&lreq->node); in linger_alloc()
2763 RB_CLEAR_NODE(&lreq->osdc_node); in linger_alloc()
2764 RB_CLEAR_NODE(&lreq->mc_node); in linger_alloc()
2765 INIT_LIST_HEAD(&lreq->scan_item); in linger_alloc()
2766 INIT_LIST_HEAD(&lreq->pending_lworks); in linger_alloc()
2767 init_completion(&lreq->reg_commit_wait); in linger_alloc()
2768 init_completion(&lreq->notify_finish_wait); in linger_alloc()
2770 lreq->osdc = osdc; in linger_alloc()
2771 target_init(&lreq->t); in linger_alloc()
2773 dout("%s lreq %p\n", __func__, lreq); in linger_alloc()
2774 return lreq; in linger_alloc()
2787 struct ceph_osd_linger_request *lreq) in DEFINE_RB_INSDEL_FUNCS()
2790 WARN_ON(!lreq->linger_id || lreq->osd); in DEFINE_RB_INSDEL_FUNCS()
2792 osd->o_osd, lreq, lreq->linger_id); in DEFINE_RB_INSDEL_FUNCS()
2800 insert_linger(&osd->o_linger_requests, lreq); in DEFINE_RB_INSDEL_FUNCS()
2801 lreq->osd = osd; in DEFINE_RB_INSDEL_FUNCS()
2805 struct ceph_osd_linger_request *lreq) in unlink_linger() argument
2808 WARN_ON(lreq->osd != osd); in unlink_linger()
2810 osd->o_osd, lreq, lreq->linger_id); in unlink_linger()
2812 lreq->osd = NULL; in unlink_linger()
2813 erase_linger(&osd->o_linger_requests, lreq); in unlink_linger()
2822 static bool __linger_registered(struct ceph_osd_linger_request *lreq) in __linger_registered() argument
2824 verify_osdc_locked(lreq->osdc); in __linger_registered()
2826 return !RB_EMPTY_NODE(&lreq->osdc_node); in __linger_registered()
2829 static bool linger_registered(struct ceph_osd_linger_request *lreq) in linger_registered() argument
2831 struct ceph_osd_client *osdc = lreq->osdc; in linger_registered()
2835 registered = __linger_registered(lreq); in linger_registered()
2841 static void linger_register(struct ceph_osd_linger_request *lreq) in linger_register() argument
2843 struct ceph_osd_client *osdc = lreq->osdc; in linger_register()
2846 WARN_ON(lreq->linger_id); in linger_register()
2848 linger_get(lreq); in linger_register()
2849 lreq->linger_id = ++osdc->last_linger_id; in linger_register()
2850 insert_linger_osdc(&osdc->linger_requests, lreq); in linger_register()
2853 static void linger_unregister(struct ceph_osd_linger_request *lreq) in linger_unregister() argument
2855 struct ceph_osd_client *osdc = lreq->osdc; in linger_unregister()
2859 erase_linger_osdc(&osdc->linger_requests, lreq); in linger_unregister()
2860 linger_put(lreq); in linger_unregister()
2865 struct ceph_osd_linger_request *lreq = req->r_priv; in cancel_linger_request() local
2869 linger_put(lreq); in cancel_linger_request()
2874 struct ceph_osd_linger_request *lreq; member
2893 static struct linger_work *lwork_alloc(struct ceph_osd_linger_request *lreq, in lwork_alloc() argument
2904 lwork->lreq = linger_get(lreq); in lwork_alloc()
2911 struct ceph_osd_linger_request *lreq = lwork->lreq; in lwork_free() local
2913 mutex_lock(&lreq->lock); in lwork_free()
2915 mutex_unlock(&lreq->lock); in lwork_free()
2917 linger_put(lreq); in lwork_free()
2923 struct ceph_osd_linger_request *lreq = lwork->lreq; in lwork_queue() local
2924 struct ceph_osd_client *osdc = lreq->osdc; in lwork_queue()
2926 verify_lreq_locked(lreq); in lwork_queue()
2930 list_add_tail(&lwork->pending_item, &lreq->pending_lworks); in lwork_queue()
2937 struct ceph_osd_linger_request *lreq = lwork->lreq; in do_watch_notify() local
2939 if (!linger_registered(lreq)) { in do_watch_notify()
2940 dout("%s lreq %p not registered\n", __func__, lreq); in do_watch_notify()
2944 WARN_ON(!lreq->is_watch); in do_watch_notify()
2946 __func__, lreq, lwork->notify.notify_id, lwork->notify.notifier_id, in do_watch_notify()
2948 lreq->wcb(lreq->data, lwork->notify.notify_id, lreq->linger_id, in do_watch_notify()
2960 struct ceph_osd_linger_request *lreq = lwork->lreq; in do_watch_error() local
2962 if (!linger_registered(lreq)) { in do_watch_error()
2963 dout("%s lreq %p not registered\n", __func__, lreq); in do_watch_error()
2967 dout("%s lreq %p err %d\n", __func__, lreq, lwork->error.err); in do_watch_error()
2968 lreq->errcb(lreq->data, lreq->linger_id, lwork->error.err); in do_watch_error()
2974 static void queue_watch_error(struct ceph_osd_linger_request *lreq) in queue_watch_error() argument
2978 lwork = lwork_alloc(lreq, do_watch_error); in queue_watch_error()
2984 lwork->error.err = lreq->last_error; in queue_watch_error()
2988 static void linger_reg_commit_complete(struct ceph_osd_linger_request *lreq, in linger_reg_commit_complete() argument
2991 if (!completion_done(&lreq->reg_commit_wait)) { in linger_reg_commit_complete()
2992 lreq->reg_commit_error = (result <= 0 ? result : 0); in linger_reg_commit_complete()
2993 complete_all(&lreq->reg_commit_wait); in linger_reg_commit_complete()
2999 struct ceph_osd_linger_request *lreq = req->r_priv; in linger_commit_cb() local
3001 mutex_lock(&lreq->lock); in linger_commit_cb()
3002 dout("%s lreq %p linger_id %llu result %d\n", __func__, lreq, in linger_commit_cb()
3003 lreq->linger_id, req->r_result); in linger_commit_cb()
3004 linger_reg_commit_complete(lreq, req->r_result); in linger_commit_cb()
3005 lreq->committed = true; in linger_commit_cb()
3007 if (!lreq->is_watch) { in linger_commit_cb()
3017 lreq->notify_id = ceph_decode_64(&p); in linger_commit_cb()
3018 dout("lreq %p notify_id %llu\n", lreq, in linger_commit_cb()
3019 lreq->notify_id); in linger_commit_cb()
3021 dout("lreq %p no notify_id\n", lreq); in linger_commit_cb()
3025 mutex_unlock(&lreq->lock); in linger_commit_cb()
3026 linger_put(lreq); in linger_commit_cb()
3044 struct ceph_osd_linger_request *lreq = req->r_priv; in linger_reconnect_cb() local
3046 mutex_lock(&lreq->lock); in linger_reconnect_cb()
3048 lreq, lreq->linger_id, req->r_result, lreq->last_error); in linger_reconnect_cb()
3050 if (!lreq->last_error) { in linger_reconnect_cb()
3051 lreq->last_error = normalize_watch_error(req->r_result); in linger_reconnect_cb()
3052 queue_watch_error(lreq); in linger_reconnect_cb()
3056 mutex_unlock(&lreq->lock); in linger_reconnect_cb()
3057 linger_put(lreq); in linger_reconnect_cb()
3060 static void send_linger(struct ceph_osd_linger_request *lreq) in send_linger() argument
3062 struct ceph_osd_request *req = lreq->reg_req; in send_linger()
3066 dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id); in send_linger()
3072 target_copy(&req->r_t, &lreq->t); in send_linger()
3073 req->r_mtime = lreq->mtime; in send_linger()
3075 mutex_lock(&lreq->lock); in send_linger()
3076 if (lreq->is_watch && lreq->committed) { in send_linger()
3078 op->watch.cookie != lreq->linger_id); in send_linger()
3080 op->watch.gen = ++lreq->register_gen; in send_linger()
3081 dout("lreq %p reconnect register_gen %u\n", lreq, in send_linger()
3085 if (!lreq->is_watch) in send_linger()
3086 lreq->notify_id = 0; in send_linger()
3089 dout("lreq %p register\n", lreq); in send_linger()
3092 mutex_unlock(&lreq->lock); in send_linger()
3094 req->r_priv = linger_get(lreq); in send_linger()
3102 struct ceph_osd_linger_request *lreq = req->r_priv; in linger_ping_cb() local
3104 mutex_lock(&lreq->lock); in linger_ping_cb()
3106 __func__, lreq, lreq->linger_id, req->r_result, lreq->ping_sent, in linger_ping_cb()
3107 lreq->last_error); in linger_ping_cb()
3108 if (lreq->register_gen == req->r_ops[0].watch.gen) { in linger_ping_cb()
3110 lreq->watch_valid_thru = lreq->ping_sent; in linger_ping_cb()
3111 } else if (!lreq->last_error) { in linger_ping_cb()
3112 lreq->last_error = normalize_watch_error(req->r_result); in linger_ping_cb()
3113 queue_watch_error(lreq); in linger_ping_cb()
3116 dout("lreq %p register_gen %u ignoring old pong %u\n", lreq, in linger_ping_cb()
3117 lreq->register_gen, req->r_ops[0].watch.gen); in linger_ping_cb()
3120 mutex_unlock(&lreq->lock); in linger_ping_cb()
3121 linger_put(lreq); in linger_ping_cb()
3124 static void send_linger_ping(struct ceph_osd_linger_request *lreq) in send_linger_ping() argument
3126 struct ceph_osd_client *osdc = lreq->osdc; in send_linger_ping()
3127 struct ceph_osd_request *req = lreq->ping_req; in send_linger_ping()
3135 lreq->ping_sent = jiffies; in send_linger_ping()
3137 __func__, lreq, lreq->linger_id, lreq->ping_sent, in send_linger_ping()
3138 lreq->register_gen); in send_linger_ping()
3144 target_copy(&req->r_t, &lreq->t); in send_linger_ping()
3147 op->watch.cookie != lreq->linger_id || in send_linger_ping()
3149 op->watch.gen = lreq->register_gen; in send_linger_ping()
3151 req->r_priv = linger_get(lreq); in send_linger_ping()
3157 link_request(lreq->osd, req); in send_linger_ping()
3161 static void linger_submit(struct ceph_osd_linger_request *lreq) in linger_submit() argument
3163 struct ceph_osd_client *osdc = lreq->osdc; in linger_submit()
3167 linger_register(lreq); in linger_submit()
3168 if (lreq->is_watch) { in linger_submit()
3169 lreq->reg_req->r_ops[0].watch.cookie = lreq->linger_id; in linger_submit()
3170 lreq->ping_req->r_ops[0].watch.cookie = lreq->linger_id; in linger_submit()
3172 lreq->reg_req->r_ops[0].notify.cookie = lreq->linger_id; in linger_submit()
3175 calc_target(osdc, &lreq->t, false); in linger_submit()
3176 osd = lookup_create_osd(osdc, lreq->t.osd, true); in linger_submit()
3177 link_linger(osd, lreq); in linger_submit()
3179 send_linger(lreq); in linger_submit()
3183 static void cancel_linger_map_check(struct ceph_osd_linger_request *lreq) in cancel_linger_map_check() argument
3185 struct ceph_osd_client *osdc = lreq->osdc; in cancel_linger_map_check()
3191 lreq->linger_id); in cancel_linger_map_check()
3195 WARN_ON(lookup_lreq != lreq); in cancel_linger_map_check()
3196 erase_linger_mc(&osdc->linger_map_checks, lreq); in cancel_linger_map_check()
3197 linger_put(lreq); in cancel_linger_map_check()
3203 static void __linger_cancel(struct ceph_osd_linger_request *lreq) in __linger_cancel() argument
3205 if (lreq->is_watch && lreq->ping_req->r_osd) in __linger_cancel()
3206 cancel_linger_request(lreq->ping_req); in __linger_cancel()
3207 if (lreq->reg_req->r_osd) in __linger_cancel()
3208 cancel_linger_request(lreq->reg_req); in __linger_cancel()
3209 cancel_linger_map_check(lreq); in __linger_cancel()
3210 unlink_linger(lreq->osd, lreq); in __linger_cancel()
3211 linger_unregister(lreq); in __linger_cancel()
3214 static void linger_cancel(struct ceph_osd_linger_request *lreq) in linger_cancel() argument
3216 struct ceph_osd_client *osdc = lreq->osdc; in linger_cancel()
3219 if (__linger_registered(lreq)) in linger_cancel()
3220 __linger_cancel(lreq); in linger_cancel()
3224 static void send_linger_map_check(struct ceph_osd_linger_request *lreq);
3226 static void check_linger_pool_dne(struct ceph_osd_linger_request *lreq) in check_linger_pool_dne() argument
3228 struct ceph_osd_client *osdc = lreq->osdc; in check_linger_pool_dne()
3234 if (lreq->register_gen) { in check_linger_pool_dne()
3235 lreq->map_dne_bound = map->epoch; in check_linger_pool_dne()
3237 lreq, lreq->linger_id); in check_linger_pool_dne()
3240 __func__, lreq, lreq->linger_id, lreq->map_dne_bound, in check_linger_pool_dne()
3244 if (lreq->map_dne_bound) { in check_linger_pool_dne()
3245 if (map->epoch >= lreq->map_dne_bound) { in check_linger_pool_dne()
3248 lreq->linger_id); in check_linger_pool_dne()
3249 linger_reg_commit_complete(lreq, -ENOENT); in check_linger_pool_dne()
3250 __linger_cancel(lreq); in check_linger_pool_dne()
3253 send_linger_map_check(lreq); in check_linger_pool_dne()
3260 struct ceph_osd_linger_request *lreq; in linger_map_check_cb() local
3266 lreq = lookup_linger_mc(&osdc->linger_map_checks, linger_id); in linger_map_check_cb()
3267 if (!lreq) { in linger_map_check_cb()
3273 __func__, lreq, lreq->linger_id, lreq->map_dne_bound, in linger_map_check_cb()
3275 if (!lreq->map_dne_bound) in linger_map_check_cb()
3276 lreq->map_dne_bound = greq->u.newest; in linger_map_check_cb()
3277 erase_linger_mc(&osdc->linger_map_checks, lreq); in linger_map_check_cb()
3278 check_linger_pool_dne(lreq); in linger_map_check_cb()
3280 linger_put(lreq); in linger_map_check_cb()
3285 static void send_linger_map_check(struct ceph_osd_linger_request *lreq) in send_linger_map_check() argument
3287 struct ceph_osd_client *osdc = lreq->osdc; in send_linger_map_check()
3294 lreq->linger_id); in send_linger_map_check()
3296 WARN_ON(lookup_lreq != lreq); in send_linger_map_check()
3300 linger_get(lreq); in send_linger_map_check()
3301 insert_linger_mc(&osdc->linger_map_checks, lreq); in send_linger_map_check()
3303 linger_map_check_cb, lreq->linger_id); in send_linger_map_check()
3307 static int linger_reg_commit_wait(struct ceph_osd_linger_request *lreq) in linger_reg_commit_wait() argument
3311 dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id); in linger_reg_commit_wait()
3312 ret = wait_for_completion_interruptible(&lreq->reg_commit_wait); in linger_reg_commit_wait()
3313 return ret ?: lreq->reg_commit_error; in linger_reg_commit_wait()
3316 static int linger_notify_finish_wait(struct ceph_osd_linger_request *lreq) in linger_notify_finish_wait() argument
3320 dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id); in linger_notify_finish_wait()
3321 ret = wait_for_completion_interruptible(&lreq->notify_finish_wait); in linger_notify_finish_wait()
3322 return ret ?: lreq->notify_finish_error; in linger_notify_finish_wait()
3372 struct ceph_osd_linger_request *lreq = in handle_timeout() local
3376 lreq, lreq->linger_id, osd->o_osd); in handle_timeout()
3379 mutex_lock(&lreq->lock); in handle_timeout()
3380 if (lreq->is_watch && lreq->committed && !lreq->last_error) in handle_timeout()
3381 send_linger_ping(lreq); in handle_timeout()
3382 mutex_unlock(&lreq->lock); in handle_timeout()
3806 recalc_linger_target(struct ceph_osd_linger_request *lreq) in recalc_linger_target() argument
3808 struct ceph_osd_client *osdc = lreq->osdc; in recalc_linger_target()
3811 ct_res = calc_target(osdc, &lreq->t, true); in recalc_linger_target()
3815 osd = lookup_create_osd(osdc, lreq->t.osd, true); in recalc_linger_target()
3816 if (osd != lreq->osd) { in recalc_linger_target()
3817 unlink_linger(lreq->osd, lreq); in recalc_linger_target()
3818 link_linger(osd, lreq); in recalc_linger_target()
3840 struct ceph_osd_linger_request *lreq = in scan_requests() local
3846 dout("%s lreq %p linger_id %llu\n", __func__, lreq, in scan_requests()
3847 lreq->linger_id); in scan_requests()
3848 ct_res = recalc_linger_target(lreq); in scan_requests()
3853 pool_cleared_full(osdc, lreq->t.base_oloc.pool)); in scan_requests()
3859 cancel_linger_map_check(lreq); in scan_requests()
3865 if (list_empty(&lreq->scan_item)) in scan_requests()
3866 list_add_tail(&lreq->scan_item, need_resend_linger); in scan_requests()
3869 list_del_init(&lreq->scan_item); in scan_requests()
3870 check_linger_pool_dne(lreq); in scan_requests()
3980 struct ceph_osd_linger_request *lreq, *nlreq; in kick_requests() local
4018 list_for_each_entry_safe(lreq, nlreq, need_resend_linger, scan_item) { in kick_requests()
4019 if (!osd_homeless(lreq->osd)) in kick_requests()
4020 send_linger(lreq); in kick_requests()
4022 list_del_init(&lreq->scan_item); in kick_requests()
4166 struct ceph_osd_linger_request *lreq = in kick_osd_requests() local
4169 send_linger(lreq); in kick_osd_requests()
4460 struct ceph_osd_linger_request *lreq; in handle_watch_notify() local
4489 lreq = lookup_linger_osdc(&osdc->linger_requests, cookie); in handle_watch_notify()
4490 if (!lreq) { in handle_watch_notify()
4496 mutex_lock(&lreq->lock); in handle_watch_notify()
4498 opcode, cookie, lreq, lreq->is_watch); in handle_watch_notify()
4500 if (!lreq->last_error) { in handle_watch_notify()
4501 lreq->last_error = -ENOTCONN; in handle_watch_notify()
4502 queue_watch_error(lreq); in handle_watch_notify()
4504 } else if (!lreq->is_watch) { in handle_watch_notify()
4506 if (lreq->notify_id && lreq->notify_id != notify_id) { in handle_watch_notify()
4507 dout("lreq %p notify_id %llu != %llu, ignoring\n", lreq, in handle_watch_notify()
4508 lreq->notify_id, notify_id); in handle_watch_notify()
4509 } else if (!completion_done(&lreq->notify_finish_wait)) { in handle_watch_notify()
4514 if (lreq->preply_pages) { in handle_watch_notify()
4517 *lreq->preply_pages = data->pages; in handle_watch_notify()
4518 *lreq->preply_len = data->length; in handle_watch_notify()
4522 lreq->notify_finish_error = return_code; in handle_watch_notify()
4523 complete_all(&lreq->notify_finish_wait); in handle_watch_notify()
4527 lwork = lwork_alloc(lreq, do_watch_notify); in handle_watch_notify()
4542 mutex_unlock(&lreq->lock); in handle_watch_notify()
4655 alloc_linger_request(struct ceph_osd_linger_request *lreq) in alloc_linger_request() argument
4659 req = ceph_osdc_alloc_request(lreq->osdc, NULL, 1, false, GFP_NOIO); in alloc_linger_request()
4663 ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); in alloc_linger_request()
4664 ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); in alloc_linger_request()
4669 alloc_watch_request(struct ceph_osd_linger_request *lreq, u8 watch_opcode) in alloc_watch_request() argument
4673 req = alloc_linger_request(lreq); in alloc_watch_request()
4702 struct ceph_osd_linger_request *lreq; in ceph_osdc_watch() local
4705 lreq = linger_alloc(osdc); in ceph_osdc_watch()
4706 if (!lreq) in ceph_osdc_watch()
4709 lreq->is_watch = true; in ceph_osdc_watch()
4710 lreq->wcb = wcb; in ceph_osdc_watch()
4711 lreq->errcb = errcb; in ceph_osdc_watch()
4712 lreq->data = data; in ceph_osdc_watch()
4713 lreq->watch_valid_thru = jiffies; in ceph_osdc_watch()
4715 ceph_oid_copy(&lreq->t.base_oid, oid); in ceph_osdc_watch()
4716 ceph_oloc_copy(&lreq->t.base_oloc, oloc); in ceph_osdc_watch()
4717 lreq->t.flags = CEPH_OSD_FLAG_WRITE; in ceph_osdc_watch()
4718 ktime_get_real_ts64(&lreq->mtime); in ceph_osdc_watch()
4720 lreq->reg_req = alloc_watch_request(lreq, CEPH_OSD_WATCH_OP_WATCH); in ceph_osdc_watch()
4721 if (!lreq->reg_req) { in ceph_osdc_watch()
4726 lreq->ping_req = alloc_watch_request(lreq, CEPH_OSD_WATCH_OP_PING); in ceph_osdc_watch()
4727 if (!lreq->ping_req) { in ceph_osdc_watch()
4732 linger_submit(lreq); in ceph_osdc_watch()
4733 ret = linger_reg_commit_wait(lreq); in ceph_osdc_watch()
4735 linger_cancel(lreq); in ceph_osdc_watch()
4739 return lreq; in ceph_osdc_watch()
4742 linger_put(lreq); in ceph_osdc_watch()
4755 struct ceph_osd_linger_request *lreq) in ceph_osdc_unwatch() argument
4765 ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); in ceph_osdc_unwatch()
4766 ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); in ceph_osdc_unwatch()
4769 osd_req_op_watch_init(req, 0, lreq->linger_id, in ceph_osdc_unwatch()
4777 linger_cancel(lreq); in ceph_osdc_unwatch()
4778 linger_put(lreq); in ceph_osdc_unwatch()
4902 struct ceph_osd_linger_request *lreq; in ceph_osdc_notify() local
4912 lreq = linger_alloc(osdc); in ceph_osdc_notify()
4913 if (!lreq) in ceph_osdc_notify()
4916 lreq->preply_pages = preply_pages; in ceph_osdc_notify()
4917 lreq->preply_len = preply_len; in ceph_osdc_notify()
4919 ceph_oid_copy(&lreq->t.base_oid, oid); in ceph_osdc_notify()
4920 ceph_oloc_copy(&lreq->t.base_oloc, oloc); in ceph_osdc_notify()
4921 lreq->t.flags = CEPH_OSD_FLAG_READ; in ceph_osdc_notify()
4923 lreq->reg_req = alloc_linger_request(lreq); in ceph_osdc_notify()
4924 if (!lreq->reg_req) { in ceph_osdc_notify()
4933 ret = osd_req_op_notify_init(lreq->reg_req, 0, 0, 1, timeout, in ceph_osdc_notify()
4944 ceph_osd_data_pages_init(osd_req_op_data(lreq->reg_req, 0, notify, in ceph_osdc_notify()
4948 ret = ceph_osdc_alloc_messages(lreq->reg_req, GFP_NOIO); in ceph_osdc_notify()
4952 linger_submit(lreq); in ceph_osdc_notify()
4953 ret = linger_reg_commit_wait(lreq); in ceph_osdc_notify()
4955 ret = linger_notify_finish_wait(lreq); in ceph_osdc_notify()
4957 dout("lreq %p failed to initiate notify %d\n", lreq, ret); in ceph_osdc_notify()
4959 linger_cancel(lreq); in ceph_osdc_notify()
4961 linger_put(lreq); in ceph_osdc_notify()
4972 struct ceph_osd_linger_request *lreq) in ceph_osdc_watch_check() argument
4978 mutex_lock(&lreq->lock); in ceph_osdc_watch_check()
4979 stamp = lreq->watch_valid_thru; in ceph_osdc_watch_check()
4980 if (!list_empty(&lreq->pending_lworks)) { in ceph_osdc_watch_check()
4982 list_first_entry(&lreq->pending_lworks, in ceph_osdc_watch_check()
4991 lreq, lreq->linger_id, age, lreq->last_error); in ceph_osdc_watch_check()
4993 ret = lreq->last_error ?: 1 + jiffies_to_msecs(age); in ceph_osdc_watch_check()
4995 mutex_unlock(&lreq->lock); in ceph_osdc_watch_check()