Lines Matching defs:cli
535 static int mdc_req_avail(struct client_obd *cli, struct mdc_cache_waiter *mcw)
539 client_obd_list_lock(&cli->cl_loi_list_lock);
541 client_obd_list_unlock(&cli->cl_loi_list_lock);
545 /* We record requests in flight in cli->cl_r_in_flight here.
548 int mdc_enter_request(struct client_obd *cli)
554 client_obd_list_lock(&cli->cl_loi_list_lock);
555 if (cli->cl_r_in_flight >= cli->cl_max_rpcs_in_flight) {
556 list_add_tail(&mcw.mcw_entry, &cli->cl_cache_waiters);
558 client_obd_list_unlock(&cli->cl_loi_list_lock);
559 rc = l_wait_event(mcw.mcw_waitq, mdc_req_avail(cli, &mcw),
562 client_obd_list_lock(&cli->cl_loi_list_lock);
564 cli->cl_r_in_flight--;
566 client_obd_list_unlock(&cli->cl_loi_list_lock);
569 cli->cl_r_in_flight++;
570 client_obd_list_unlock(&cli->cl_loi_list_lock);
575 void mdc_exit_request(struct client_obd *cli)
580 client_obd_list_lock(&cli->cl_loi_list_lock);
581 cli->cl_r_in_flight--;
582 list_for_each_safe(l, tmp, &cli->cl_cache_waiters) {
583 if (cli->cl_r_in_flight >= cli->cl_max_rpcs_in_flight) {
590 cli->cl_r_in_flight++;
595 client_obd_list_unlock(&cli->cl_loi_list_lock);