diff options
author | jhb <jhb@FreeBSD.org> | 2008-11-04 19:04:01 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-11-04 19:04:01 +0000 |
commit | 6c6f8c89e867271ab3baf15171419147ba85e088 (patch) | |
tree | b47a8cae4ebd0444298548735180256fabe8a0d6 /sys/dev | |
parent | 9f264a6a75c77b629a7483254b17b870d9d292a8 (diff) | |
download | FreeBSD-src-6c6f8c89e867271ab3baf15171419147ba85e088.zip FreeBSD-src-6c6f8c89e867271ab3baf15171419147ba85e088.tar.gz |
Remove unnecessary locking around vn_fullpath(). The vnode lock for the
vnode in question does not need to be held. All the data structures used
during the name lookup are protected by the global name cache lock.
Instead, the caller merely needs to ensure a reference is held on the
vnode (such as vhold()) to keep it from being freed.
In the case of procfs' <pid>/file entry, grab the process lock while we
gain a new reference (via vhold()) on p_textvp to fully close races with
execve(2).
For the kern.proc.vmmap sysctl handler, use a shared vnode lock around
the call to VOP_GETATTR() rather than an exclusive lock.
MFC after: 1 month
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_mod.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index f750d46..61c0735 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -680,9 +680,7 @@ pmc_getfilename(struct vnode *v, char **fullpath, char **freepath) *fullpath = "unknown"; *freepath = NULL; - vn_lock(v, LK_CANRECURSE | LK_EXCLUSIVE | LK_RETRY); vn_fullpath(curthread, v, fullpath, freepath); - VOP_UNLOCK(v, 0); } /* |