diff options
author | dds <dds@FreeBSD.org> | 2005-10-12 06:56:00 +0000 |
---|---|---|
committer | dds <dds@FreeBSD.org> | 2005-10-12 06:56:00 +0000 |
commit | 0fb2e655fdaa468d5188d6e87ef07cb383149b5b (patch) | |
tree | b831f3d94b8f98284035c19c12732a3f1465d75b /sys/kern/kern_exec.c | |
parent | 66b195cfae1820593765c34e4917eb3a71d0204f (diff) | |
download | FreeBSD-src-0fb2e655fdaa468d5188d6e87ef07cb383149b5b.zip FreeBSD-src-0fb2e655fdaa468d5188d6e87ef07cb383149b5b.tar.gz |
Move execve's access time update functionality into a new
vfs_mark_atime() function, and use the new function for
performing efficient atime updates in mmap().
Reviewed by: bde
MFC after: 2 weeks
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 2b7dd32..d235b31 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -292,7 +292,7 @@ do_execve(td, args, mac_p) register_t *stack_base; int error, len, i; struct image_params image_params, *imgp; - struct vattr atimeattr, attr; + struct vattr attr; int (*img_first)(struct image_params *); struct pargs *oldargs = NULL, *newargs = NULL; struct sigacts *oldsigacts, *newsigacts; @@ -709,17 +709,7 @@ interpret: exec_setregs(td, imgp->entry_addr, (u_long)(uintptr_t)stack_base, imgp->ps_strings); - /* - * Here we should update the access time of the file. This must - * be implemented by the underlying filesystem in the same way as - * access timestamps for a VOP_READ() because we want to avoid - * blocking and/or I/O, and have not called vn_start_write(). - */ - if ((imgp->vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) { - VATTR_NULL(&atimeattr); - atimeattr.va_vaflags |= VA_EXECVE_ATIME; - (void)VOP_SETATTR(imgp->vp, &atimeattr, td->td_ucred, td); - } + vfs_mark_atime(imgp->vp, td); done1: /* |