Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_subr.c
Show First 20 Lines • Show All 5,950 Lines • ▼ Show 20 Lines | vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off) | ||||
*ap->a_cookies = realloc(*ap->a_cookies, | *ap->a_cookies = realloc(*ap->a_cookies, | ||||
(*ap->a_ncookies + 1) * sizeof(u_long), M_TEMP, M_WAITOK | M_ZERO); | (*ap->a_ncookies + 1) * sizeof(u_long), M_TEMP, M_WAITOK | M_ZERO); | ||||
(*ap->a_cookies)[*ap->a_ncookies] = off; | (*ap->a_cookies)[*ap->a_ncookies] = off; | ||||
*ap->a_ncookies += 1; | *ap->a_ncookies += 1; | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Mark for update the access time of the file if the filesystem | |||||
* supports VOP_MARKATIME. This functionality is used by execve and | |||||
* mmap, so we want to avoid the I/O implied by directly setting | |||||
* va_atime for the sake of efficiency. | |||||
*/ | |||||
void | |||||
vfs_mark_atime(struct vnode *vp, struct ucred *cred) | |||||
{ | |||||
struct mount *mp; | |||||
mp = vp->v_mount; | |||||
ASSERT_VOP_LOCKED(vp, "vfs_mark_atime"); | |||||
if (mp != NULL && (mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) | |||||
(void)VOP_MARKATIME(vp); | |||||
} | |||||
/* | |||||
* The purpose of this routine is to remove granularity from accmode_t, | * The purpose of this routine is to remove granularity from accmode_t, | ||||
* reducing it into standard unix access bits - VEXEC, VREAD, VWRITE, | * reducing it into standard unix access bits - VEXEC, VREAD, VWRITE, | ||||
* VADMIN and VAPPEND. | * VADMIN and VAPPEND. | ||||
* | * | ||||
* If it returns 0, the caller is supposed to continue with the usual | * If it returns 0, the caller is supposed to continue with the usual | ||||
* access checks using 'accmode' as modified by this routine. If it | * access checks using 'accmode' as modified by this routine. If it | ||||
* returns nonzero value, the caller is supposed to return that value | * returns nonzero value, the caller is supposed to return that value | ||||
* as errno. | * as errno. | ||||
▲ Show 20 Lines • Show All 419 Lines • Show Last 20 Lines |