X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flustre_net.h;h=f34a272430982af4be29cc08ac757df2d240e017;hb=babf0232273467b7199ec9a7c36047b1968913df;hp=7dad281360eb522ffca89ecbc6adfb31210287e7;hpb=7a18fe124c215ad7ab1806abd62bea9c7b9592c6;p=fs%2Flustre-release.git diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 7dad281..f34a272 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -2501,8 +2501,10 @@ ptlrpc_client_recv(struct ptlrpc_request *req) return req->rq_receiving_reply; } +#define ptlrpc_cli_wait_unlink(req) __ptlrpc_cli_wait_unlink(req, NULL) + static inline int -ptlrpc_client_recv_or_unlink(struct ptlrpc_request *req) +__ptlrpc_cli_wait_unlink(struct ptlrpc_request *req, bool *discard) { int rc; @@ -2516,6 +2518,15 @@ ptlrpc_client_recv_or_unlink(struct ptlrpc_request *req) return 1; } + if (discard) { + *discard = false; + if (req->rq_reply_unlinked && req->rq_req_unlinked == 0) { + *discard = true; + spin_unlock(&req->rq_lock); + return 1; /* Should call again after LNetMDUnlink */ + } + } + rc = !req->rq_req_unlinked || !req->rq_reply_unlinked || req->rq_receiving_reply; spin_unlock(&req->rq_lock);