Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_vnops.c
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | else if ((fmode & (O_CREAT | O_DIRECTORY)) == O_CREAT) { | ||||
ndp->ni_cnd.cn_nameiop = CREATE; | ndp->ni_cnd.cn_nameiop = CREATE; | ||||
/* | /* | ||||
* Set NOCACHE to avoid flushing the cache when | * Set NOCACHE to avoid flushing the cache when | ||||
* rolling in many files at once. | * rolling in many files at once. | ||||
*/ | */ | ||||
ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF | NOCACHE; | ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF | NOCACHE; | ||||
if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0) | if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0) | ||||
ndp->ni_cnd.cn_flags |= FOLLOW; | ndp->ni_cnd.cn_flags |= FOLLOW; | ||||
if ((fmode & O_BENEATH) != 0) | |||||
ndp->ni_cnd.cn_flags |= BENEATH; | |||||
if (!(vn_open_flags & VN_OPEN_NOAUDIT)) | if (!(vn_open_flags & VN_OPEN_NOAUDIT)) | ||||
ndp->ni_cnd.cn_flags |= AUDITVNODE1; | ndp->ni_cnd.cn_flags |= AUDITVNODE1; | ||||
if (vn_open_flags & VN_OPEN_NOCAPCHECK) | if (vn_open_flags & VN_OPEN_NOCAPCHECK) | ||||
ndp->ni_cnd.cn_flags |= NOCAPCHECK; | ndp->ni_cnd.cn_flags |= NOCAPCHECK; | ||||
bwillwrite(); | bwillwrite(); | ||||
if ((error = namei(ndp)) != 0) | if ((error = namei(ndp)) != 0) | ||||
return (error); | return (error); | ||||
if (ndp->ni_vp == NULL) { | if (ndp->ni_vp == NULL) { | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | #endif | ||||
fmode &= ~O_CREAT; | fmode &= ~O_CREAT; | ||||
} | } | ||||
} else { | } else { | ||||
ndp->ni_cnd.cn_nameiop = LOOKUP; | ndp->ni_cnd.cn_nameiop = LOOKUP; | ||||
ndp->ni_cnd.cn_flags = ISOPEN | | ndp->ni_cnd.cn_flags = ISOPEN | | ||||
((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) | LOCKLEAF; | ((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) | LOCKLEAF; | ||||
if (!(fmode & FWRITE)) | if (!(fmode & FWRITE)) | ||||
ndp->ni_cnd.cn_flags |= LOCKSHARED; | ndp->ni_cnd.cn_flags |= LOCKSHARED; | ||||
if ((fmode & O_BENEATH) != 0) | |||||
ndp->ni_cnd.cn_flags |= BENEATH; | |||||
if (!(vn_open_flags & VN_OPEN_NOAUDIT)) | if (!(vn_open_flags & VN_OPEN_NOAUDIT)) | ||||
ndp->ni_cnd.cn_flags |= AUDITVNODE1; | ndp->ni_cnd.cn_flags |= AUDITVNODE1; | ||||
if (vn_open_flags & VN_OPEN_NOCAPCHECK) | if (vn_open_flags & VN_OPEN_NOCAPCHECK) | ||||
ndp->ni_cnd.cn_flags |= NOCAPCHECK; | ndp->ni_cnd.cn_flags |= NOCAPCHECK; | ||||
if ((error = namei(ndp)) != 0) | if ((error = namei(ndp)) != 0) | ||||
return (error); | return (error); | ||||
vp = ndp->ni_vp; | vp = ndp->ni_vp; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,212 Lines • Show Last 20 Lines |