* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
req->rq_no_resend = req->rq_no_delay = 1;
ptlrpc_request_set_replen(req);
- ptlrpcd_add_req(req);
+ ptlrpcd_add_req(req, PSCOPE_OTHER);
RETURN(0);
}
struct ptlrpc_request *req;
struct ptlrpc_request_set *set;
struct list_head *iter;
+ struct obd_import *imp;
struct pinger_data *pd = &pinger_args;
int rc;
req->rq_no_resend = 1;
ptlrpc_request_set_replen(req);
req->rq_send_state = LUSTRE_IMP_FULL;
- req->rq_phase = RQ_PHASE_RPC;
+ ptlrpc_rqphase_move(req, RQ_PHASE_RPC);
req->rq_import_generation = generation;
ptlrpc_set_add_req(set, req);
} else {
}
do_check_set:
- rc = ptlrpc_check_set(set);
+ rc = ptlrpc_check_set(NULL, set);
/* not finished, and we are not expired, simply return */
if (!rc && cfs_time_before(curtime, cfs_time_add(pd->pd_this_ping,
if (req->rq_phase == RQ_PHASE_COMPLETE)
continue;
- req->rq_phase = RQ_PHASE_COMPLETE;
- atomic_dec(&req->rq_import->imp_inflight);
- set->set_remaining--;
- /* If it was disconnected, don't sweat it. */
- if (list_empty(&req->rq_import->imp_pinger_chain)) {
- ptlrpc_unregister_reply(req);
- continue;
- }
+ CDEBUG(D_RPCTRACE, "Pinger initiate expire request(%p)\n",
+ req);
- CDEBUG(D_RPCTRACE, "pinger initiate expire_one_request\n");
- ptlrpc_expire_one_request(req);
+ /* This will also unregister reply. */
+ ptlrpc_expire_one_request(req, 0);
+
+ /* We're done with this req, let's finally move it to complete
+ * phase and take care of inflights. */
+ ptlrpc_rqphase_move(req, RQ_PHASE_COMPLETE);
+ imp = req->rq_import;
+ spin_lock(&imp->imp_lock);
+ if (!list_empty(&req->rq_list)) {
+ list_del_init(&req->rq_list);
+ atomic_dec(&imp->imp_inflight);
+ }
+ spin_unlock(&imp->imp_lock);
+ set->set_remaining--;
}
mutex_up(&pinger_sem);