Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/p9fs/p9fs_vnops.c
| Show First 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | if (error > 0 && error != ENOENT) { | ||||
| P9_DEBUG(VOPS, "%s: Cache lookup error %d \n", __func__, error); | P9_DEBUG(VOPS, "%s: Cache lookup error %d \n", __func__, error); | ||||
| goto out; | goto out; | ||||
| } | } | ||||
| if (error == -1) { | if (error == -1) { | ||||
| vp = *vpp; | vp = *vpp; | ||||
| /* Check if the entry in cache is stale or not */ | /* Check if the entry in cache is stale or not */ | ||||
| if ((p9fs_node_cmp(vp, &newfid->qid) == 0) && | if ((p9fs_node_cmp(vp, &newfid->qid) == 0) && | ||||
| ((error = VOP_GETATTR(vp, &vattr, cnp->cn_cred)) == 0)) { | ((error = VOP_GETATTR(vp, 0, &vattr, cnp->cn_cred)) == 0)) { | ||||
| goto out; | goto out; | ||||
| } | } | ||||
| /* | /* | ||||
| * This case, we have an error coming from getattr, | * This case, we have an error coming from getattr, | ||||
| * act accordingly. | * act accordingly. | ||||
| */ | */ | ||||
| cache_purge(vp); | cache_purge(vp); | ||||
| if (dvp != vp) | if (dvp != vp) | ||||
| vput(vp); | vput(vp); | ||||
| else | else | ||||
| vrele(vp); | vrele(vp); | ||||
| *vpp = NULLVP; | *vpp = NULLVP; | ||||
| } else if (error == ENOENT) { | } else if (error == ENOENT) { | ||||
| if (VN_IS_DOOMED(dvp)) | if (VN_IS_DOOMED(dvp)) | ||||
| goto out; | goto out; | ||||
| if (VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0) { | if (VOP_GETATTR(dvp, 0, &vattr, cnp->cn_cred) == 0) { | ||||
| error = ENOENT; | error = ENOENT; | ||||
| goto out; | goto out; | ||||
| } | } | ||||
| cache_purge_negative(dvp); | cache_purge_negative(dvp); | ||||
| } | } | ||||
| /* Reset values */ | /* Reset values */ | ||||
| error = 0; | error = 0; | ||||
| vp = NULLVP; | vp = NULLVP; | ||||
| ▲ Show 20 Lines • Show All 454 Lines • ▼ Show 20 Lines | p9fs_access(struct vop_access_args *ap) | ||||
| vp = ap->a_vp; | vp = ap->a_vp; | ||||
| accmode = ap->a_accmode; | accmode = ap->a_accmode; | ||||
| cred = ap->a_cred; | cred = ap->a_cred; | ||||
| P9_DEBUG(VOPS, "%s: vp %p\n", __func__, vp); | P9_DEBUG(VOPS, "%s: vp %p\n", __func__, vp); | ||||
| /* make sure getattr is working correctly and is defined.*/ | /* make sure getattr is working correctly and is defined.*/ | ||||
| error = VOP_GETATTR(vp, &vap, cred); | error = VOP_GETATTR(vp, 0, &vap, cred); | ||||
| if (error != 0) | if (error != 0) | ||||
| return (error); | return (error); | ||||
| error = p9fs_check_possible(vp, &vap, accmode); | error = p9fs_check_possible(vp, &vap, accmode); | ||||
| if (error != 0) | if (error != 0) | ||||
| return (error); | return (error); | ||||
| /* Call the Generic Access check in VOPS*/ | /* Call the Generic Access check in VOPS*/ | ||||
| ▲ Show 20 Lines • Show All 1,408 Lines • Show Last 20 Lines | |||||