summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2006-06-16 05:09:28 +0000
committercsjp <csjp@FreeBSD.org>2006-06-16 05:09:28 +0000
commitbff7d924ba3362bac2a367258002a4ceeb322abb (patch)
tree6acb08125663f9dcaf2db62b0a1293efa35b8b4b
parent11681ee0b50fc0d186a88127ff15133ab12cede1 (diff)
downloadFreeBSD-src-bff7d924ba3362bac2a367258002a4ceeb322abb.zip
FreeBSD-src-bff7d924ba3362bac2a367258002a4ceeb322abb.tar.gz
Axe Giant from vn_fullpath(9). The vnode -> pathname lookup should be
filesystem agnostic. We are not touching any file system specific functions in this code path. Since we have a cache lock, there is really no need to keep Giant around here. This eliminates Giant acquisitions for any syscall which is auditing pathnames. Discussed with: jeff
-rw-r--r--sys/kern/vfs_cache.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index bbcca1d..c20fd96 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -771,11 +771,9 @@ vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf)
buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
fdp = td->td_proc->p_fd;
- mtx_lock(&Giant);
FILEDESC_LOCK(fdp);
error = vn_fullpath1(td, vn, fdp->fd_rdir, buf, retbuf, MAXPATHLEN);
FILEDESC_UNLOCK(fdp);
- mtx_unlock(&Giant);
if (!error)
*freebuf = buf;
@@ -795,8 +793,6 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
int error, i, slash_prefixed;
struct namecache *ncp;
- mtx_assert(&Giant, MA_OWNED);
-
bp = buf + buflen - 1;
*bp = '\0';
error = 0;
OpenPOWER on IntegriCloud