diff options
author | mav <mav@FreeBSD.org> | 2014-06-22 18:01:40 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-06-22 18:01:40 +0000 |
commit | ad4e5fe06bf26964cbf5e3e5a1d6a6d85c9067c2 (patch) | |
tree | 0c21e786b3088670a512eab9e09a94fb59ed0c7d /sys/nfs | |
parent | 6b3b15bb3a423532a03456e659c25bfa47c307ba (diff) | |
download | FreeBSD-src-ad4e5fe06bf26964cbf5e3e5a1d6a6d85c9067c2.zip FreeBSD-src-ad4e5fe06bf26964cbf5e3e5a1d6a6d85c9067c2.tar.gz |
MFC r267221, r267278:
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.
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); } |