mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
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().
This commit is contained in:
parent
5360187e7a
commit
ff5f695e78
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124537
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user