|
@@ -330,6 +330,31 @@ static void nlmsvc_freegrantargs(struct nlm_rqst *call)
|
|
|
kfree(call->a_args.lock.oh.data);
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * Deferred lock request handling for non-blocking lock
|
|
|
+ */
|
|
|
+static u32
|
|
|
+nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block)
|
|
|
+{
|
|
|
+ u32 status = nlm_lck_denied_nolocks;
|
|
|
+
|
|
|
+ block->b_flags |= B_QUEUED;
|
|
|
+
|
|
|
+ nlmsvc_insert_block(block, NLM_TIMEOUT);
|
|
|
+
|
|
|
+ block->b_cache_req = &rqstp->rq_chandle;
|
|
|
+ if (rqstp->rq_chandle.defer) {
|
|
|
+ block->b_deferred_req =
|
|
|
+ rqstp->rq_chandle.defer(block->b_cache_req);
|
|
|
+ if (block->b_deferred_req != NULL)
|
|
|
+ status = nlm_drop_reply;
|
|
|
+ }
|
|
|
+ dprintk("lockd: nlmsvc_defer_lock_rqst block %p flags %d status %d\n",
|
|
|
+ block, block->b_flags, status);
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* Attempt to establish a lock, and if it can't be granted, block it
|
|
|
* if required.
|