Reduce nesting in vn_access.

No functional changes.
This commit is contained in:
Mateusz Guzik 2014-10-22 01:53:00 +00:00
parent 2c383f119e
commit a39d200bb9

View File

@ -1994,8 +1994,9 @@ vn_access(vp, user_flags, cred, td)
int error;
/* Flags == 0 means only check for existence. */
error = 0;
if (user_flags) {
if (user_flags == 0)
return (0);
accmode = 0;
if (user_flags & R_OK)
accmode |= VREAD;
@ -2010,7 +2011,6 @@ vn_access(vp, user_flags, cred, td)
#endif
if ((accmode & VWRITE) == 0 || (error = vn_writechk(vp)) == 0)
error = VOP_ACCESS(vp, accmode, cred, td);
}
return (error);
}