diff options
author | mohans <mohans@FreeBSD.org> | 2006-11-27 23:26:06 +0000 |
---|---|---|
committer | mohans <mohans@FreeBSD.org> | 2006-11-27 23:26:06 +0000 |
commit | ef00496038337374d5b4e46970df97b80d4efda4 (patch) | |
tree | f850d524c1070c4f97c7f082fac784e9a0b8a11b /sys/nfsclient | |
parent | 964f1eb261205cb8d846bf8fbd4bf900713139a5 (diff) | |
download | FreeBSD-src-ef00496038337374d5b4e46970df97b80d4efda4.zip FreeBSD-src-ef00496038337374d5b4e46970df97b80d4efda4.tar.gz |
bde@ pointed out that tprintf() acquires Giant so callers of tprintf() don't
have to explicitly acquire Giant (although they need to be aware of this and
not hold any locks at that point). Remove the acquisitions of Giant in the
NFS client wrapping tprintf().
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 90e8375..1e1aa5a 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -1387,6 +1387,10 @@ nfs_timer(void *arg) (rep->r_rexmit > 2 || (rep->r_flags & R_RESENDERR)) && rep->r_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) { rep->r_lastmsg = now.tv_sec; + /* + * Pin down the request and drop locks for the acquisition + * of Giant from tprintf() in nfs_down(). + */ rep->r_flags |= R_PIN_REQ; mtx_unlock(&rep->r_mtx); mtx_unlock(&nmp->nm_mtx); @@ -1839,8 +1843,6 @@ nfs_msg(struct thread *td, const char *server, const char *msg, int error) { struct proc *p; - GIANT_REQUIRED; /* tprintf */ - p = td ? td->td_proc : NULL; if (error) { tprintf(p, LOG_INFO, "nfs server %s: %s, error %d\n", server, @@ -1883,9 +1885,7 @@ nfs_down(rep, nmp, td, msg, error, flags) if (rep) rep->r_flags |= R_TPRINTFMSG; mtx_unlock(&rep->r_mtx); - mtx_lock(&Giant); nfs_msg(td, nmp->nm_mountp->mnt_stat.f_mntfromname, msg, error); - mtx_unlock(&Giant); } void @@ -1901,9 +1901,7 @@ nfs_up(rep, nmp, td, msg, flags) mtx_lock(&rep->r_mtx); if ((rep->r_flags & R_TPRINTFMSG) != 0) { mtx_unlock(&rep->r_mtx); - mtx_lock(&Giant); nfs_msg(td, nmp->nm_mountp->mnt_stat.f_mntfromname, msg, 0); - mtx_unlock(&Giant); } else mtx_unlock(&rep->r_mtx); |