summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_util.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2004-01-14 22:38:03 +0000
committertruckman <truckman@FreeBSD.org>2004-01-14 22:38:03 +0000
commitf76d668175b28f4720aaffb6aa97b784948f060a (patch)
treeb1b0e41288ae7dba51ef412556d46523bcafc9a2 /sys/compat/linux/linux_util.c
parent82162ee86dca5844501aff727a5a56a5b147d5a3 (diff)
downloadFreeBSD-src-f76d668175b28f4720aaffb6aa97b784948f060a.zip
FreeBSD-src-f76d668175b28f4720aaffb6aa97b784948f060a.tar.gz
VOP_GETATTR() wants the vnode passed to it to be locked. Instead
of adding the code to lock and unlock the vnodes and taking care to avoid deadlock, simplify linux_emul_convpath() by comparing the vnode pointers directly instead of comparing their va_fsid and va_fileid attributes. This allows the removal of the calls to VOP_GETATTR().
Diffstat (limited to 'sys/compat/linux/linux_util.c')
-rw-r--r--sys/compat/linux/linux_util.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c
index 25e31bc..7b8ddb7 100644
--- a/sys/compat/linux/linux_util.c
+++ b/sys/compat/linux/linux_util.c
@@ -96,8 +96,6 @@ linux_emul_convpath(td, path, pathseg, pbuf, cflag)
{
struct nameidata nd;
struct nameidata ndroot;
- struct vattr vat;
- struct vattr vatroot;
int error;
const char *prefix;
char *ptr, *buf, *cp;
@@ -169,17 +167,7 @@ linux_emul_convpath(td, path, pathseg, pbuf, cflag)
goto keeporig;
}
- if ((error = VOP_GETATTR(nd.ni_vp, &vat, td->td_ucred, td)) != 0) {
- goto bad;
- }
-
- if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, td->td_ucred, td))
- != 0) {
- goto bad;
- }
-
- if (vat.va_fsid == vatroot.va_fsid &&
- vat.va_fileid == vatroot.va_fileid) {
+ if (nd.ni_vp == ndroot.ni_vp) {
error = ENOENT;
goto bad;
}
OpenPOWER on IntegriCloud