Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_vnops.c
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | else if ((fmode & (O_CREAT | O_DIRECTORY)) == O_CREAT) { | ||||
* 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) | if ((fmode & O_BENEATH) != 0) | ||||
ndp->ni_cnd.cn_flags |= BENEATH; | ndp->ni_cnd.cn_flags |= BENEATH; | ||||
if ((fmode & O_RBENEATH) != 0) | |||||
ndp->ni_cnd.cn_flags |= RBENEATH; | |||||
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 ((vn_open_flags & VN_OPEN_INVFS) == 0) | if ((vn_open_flags & VN_OPEN_INVFS) == 0) | ||||
bwillwrite(); | bwillwrite(); | ||||
if ((error = namei(ndp)) != 0) | if ((error = namei(ndp)) != 0) | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 46 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) | if ((fmode & O_BENEATH) != 0) | ||||
markj: It looks like there is extra ws following `|=`. | |||||
Done Inline ActionsIt was a tab. kib: It was a tab. | |||||
ndp->ni_cnd.cn_flags |= BENEATH; | ndp->ni_cnd.cn_flags |= BENEATH; | ||||
if ((fmode & O_RBENEATH) != 0) | |||||
ndp->ni_cnd.cn_flags |= RBENEATH; | |||||
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; | ||||
Done Inline ActionsPerhaps factor the common bits for LOOKUP and CREATE into a subroutine. markj: Perhaps factor the common bits for LOOKUP and CREATE into a subroutine. | |||||
if ((error = namei(ndp)) != 0) | if ((error = namei(ndp)) != 0) | ||||
return (error); | return (error); | ||||
vp = ndp->ni_vp; | vp = ndp->ni_vp; | ||||
} | } | ||||
error = vn_open_vnode(vp, fmode, cred, td, fp); | error = vn_open_vnode(vp, fmode, cred, td, fp); | ||||
if (error) | if (error) | ||||
goto bad; | goto bad; | ||||
*flagp = fmode; | *flagp = fmode; | ||||
▲ Show 20 Lines • Show All 2,972 Lines • Show Last 20 Lines |
It looks like there is extra ws following |=.