diff options
author | mav <mav@FreeBSD.org> | 2014-06-08 09:40:26 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-06-08 09:40:26 +0000 |
commit | aa54e738fe2ad03844beb77d1e655206c829d0f3 (patch) | |
tree | 649ba977a4e006579b01fdb75fef67caed842b83 /sys/nfs | |
parent | 8269c2a4e56192b60c09e4f1beca74a4d03f56eb (diff) | |
download | FreeBSD-src-aa54e738fe2ad03844beb77d1e655206c829d0f3.zip FreeBSD-src-aa54e738fe2ad03844beb77d1e655206c829d0f3.tar.gz |
Introduce new per-thread lock to protect the list of requests.
This allows to slightly simplify svc_run_internal() code: if we processed
all the requests in a queue, then we know that new one will not appear.
MFC after: 2 weeks
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_fha.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/nfs/nfs_fha.c b/sys/nfs/nfs_fha.c index 2b29421..86f31ec 100644 --- a/sys/nfs/nfs_fha.c +++ b/sys/nfs/nfs_fha.c @@ -288,11 +288,7 @@ fha_hash_entry_add_op(struct fha_hash_entry *fhe, int locktype, int count) * Get the service thread currently associated with the fhe that is * appropriate to handle this operation. */ -SVCTHREAD * -fha_hash_entry_choose_thread(struct fha_params *softc, - struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread); - -SVCTHREAD * +static SVCTHREAD * fha_hash_entry_choose_thread(struct fha_params *softc, struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread) { @@ -428,13 +424,13 @@ fha_assign(SVCTHREAD *this_thread, struct svc_req *req, * Grab the pool lock here to not let chosen thread go away before * the new request inserted to its queue while we drop fhe lock. */ - mtx_lock(&(*softc->pool)->sp_lock); + mtx_lock(&thread->st_lock); mtx_unlock(fhe->mtx); return (thread); thist: req->rq_p1 = NULL; - mtx_lock(&(*softc->pool)->sp_lock); + mtx_lock(&this_thread->st_lock); return (this_thread); } |