Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160217920
D57681.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D57681.diff
View Options
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -960,7 +960,7 @@
/* Set values passed into the program in registers. */
(*p->p_sysent->sv_setregs)(td, imgp, stack_base);
- VOP_MMAPPED(imgp->vp);
+ VOP_UPDATE_ATIME(imgp->vp, NULL);
SDT_PROBE1(proc, , , exec__success, args->fname);
diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src
--- a/sys/kern/vnode_if.src
+++ b/sys/kern/vnode_if.src
@@ -214,8 +214,9 @@
%% mmapped vp L L L
-vop_mmapped {
+vop_update_atime {
IN struct vnode *vp;
+ IN struct timespec *ts;
};
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -100,7 +100,7 @@
int flags, error;
ASSERT_VOP_ELOCKED(vp, "ffs_update");
- ufs_itimes(vp);
+ ufs_itimes(vp, NULL);
ip = VTOI(vp);
if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0)
return (0);
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -6896,7 +6896,7 @@
* from reaching the disk while we are eliminating those that
* have been truncated. This is a partially inlined ffs_update().
*/
- ufs_itimes(vp);
+ ufs_itimes(vp, NULL);
ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED);
dbn = fsbtodb(fs, ino_to_fsba(fs, ip->i_number));
error = ffs_breadz(ump, ump->um_devvp, dbn, dbn, (int)fs->fs_bsize,
diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h
--- a/sys/ufs/ufs/ufs_extern.h
+++ b/sys/ufs/ufs/ufs_extern.h
@@ -73,7 +73,7 @@
int ufs_getlbns(struct vnode *, ufs2_daddr_t, struct indir *, int *);
int ufs_inactive(struct vop_inactive_args *);
int ufs_init(struct vfsconf *);
-void ufs_itimes(struct vnode *vp);
+void ufs_itimes(struct vnode *vp, struct timespec *tsa);
int ufs_lookup(struct vop_cachedlookup_args *);
int ufs_need_inactive(struct vop_need_inactive_args *);
int ufs_readdir(struct vop_readdir_args *);
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -111,7 +111,7 @@
static vop_link_t ufs_link;
static int ufs_makeinode(int mode, struct vnode *, struct vnode **,
struct componentname *, const char *);
-static vop_mmapped_t ufs_mmapped;
+static vop_update_atime_t ufs_update_atime;
static vop_mkdir_t ufs_mkdir;
static vop_mknod_t ufs_mknod;
static vop_open_t ufs_open;
@@ -143,7 +143,7 @@
};
static void
-ufs_itimes_locked(struct vnode *vp)
+ufs_itimes_locked(struct vnode *vp, struct timespec *tsa)
{
struct inode *ip;
struct timespec ts;
@@ -166,8 +166,13 @@
UFS_INODE_SET_FLAG(ip, IN_LAZYACCESS);
vfs_timestamp(&ts);
if ((ip->i_flag & IN_ACCESS) != 0) {
- DIP_SET(ip, i_atime, ts.tv_sec);
- DIP_SET(ip, i_atimensec, ts.tv_nsec);
+ if (tsa != NULL) {
+ DIP_SET(ip, i_atime, tsa->tv_sec);
+ DIP_SET(ip, i_atimensec, tsa->tv_nsec);
+ } else {
+ DIP_SET(ip, i_atime, ts.tv_sec);
+ DIP_SET(ip, i_atimensec, ts.tv_nsec);
+ }
}
if ((ip->i_flag & IN_UPDATE) != 0) {
DIP_SET(ip, i_mtime, ts.tv_sec);
@@ -184,7 +189,7 @@
}
void
-ufs_itimes(struct vnode *vp)
+ufs_itimes(struct vnode *vp, struct timespec *tsa)
{
struct inode *ip;
@@ -193,7 +198,7 @@
return;
VI_LOCK(vp);
- ufs_itimes_locked(vp);
+ ufs_itimes_locked(vp, tsa);
VI_UNLOCK(vp);
}
@@ -356,7 +361,7 @@
{
struct vnode *vp = ap->a_vp;
- ufs_itimes(vp);
+ ufs_itimes(vp, NULL);
return (0);
}
@@ -523,7 +528,7 @@
return (error);
VI_LOCK(vp);
- ufs_itimes_locked(vp);
+ ufs_itimes_locked(vp, NULL);
if (I_IS_UFS1(ip)) {
sb->st_atim.tv_sec = ip->i_din1->di_atime;
sb->st_atim.tv_nsec = ip->i_din1->di_atimensec;
@@ -584,7 +589,7 @@
struct vattr *vap = ap->a_vap;
VI_LOCK(vp);
- ufs_itimes_locked(vp);
+ ufs_itimes_locked(vp, NULL);
if (I_IS_UFS1(ip)) {
vap->va_atime.tv_sec = ip->i_din1->di_atime;
vap->va_atime.tv_nsec = ip->i_din1->di_atimensec;
@@ -829,9 +834,10 @@
#endif /* UFS_ACL */
static int
-ufs_mmapped(
- struct vop_mmapped_args /* {
+ufs_update_atime(
+ struct vop_update_atime_args /* {
struct vnode *a_vp;
+ struct timespec *a_ts;
} */ *ap)
{
struct vnode *vp;
@@ -842,8 +848,16 @@
ip = VTOI(vp);
mp = vp->v_mount;
- if ((mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0)
- UFS_INODE_SET_FLAG_SHARED(ip, IN_ACCESS);
+ if ((mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) {
+ VI_LOCK(vp);
+ if ((ip->i_flag & IN_ACCESS) == 0) {
+ ip->i_flag |= IN_ACCESS;
+ vlazy(vp);
+ }
+ if (ap->a_ts != NULL)
+ ufs_itimes_locked(vp, ap->a_ts);
+ VI_UNLOCK(vp);
+ }
/*
* XXXKIB No UFS_UPDATE(ap->a_vp, 0) there.
*/
@@ -3006,7 +3020,7 @@
.vop_ioctl = ufs_ioctl,
.vop_link = ufs_link,
.vop_lookup = vfs_cache_lookup,
- .vop_mmapped = ufs_mmapped,
+ .vop_update_atime = ufs_update_atime,
.vop_mkdir = ufs_mkdir,
.vop_mknod = ufs_mknod,
.vop_need_inactive = ufs_need_inactive,
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -1391,7 +1391,7 @@
*objp = obj;
*flagsp = flags;
- VOP_MMAPPED(vp);
+ VOP_UPDATE_ATIME(vp, NULL);
done:
if (error != 0 && *writecounted) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 23, 7:05 AM (4 h, 15 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34234751
Default Alt Text
D57681.diff (5 KB)
Attached To
Mode
D57681: vfs: rename vop_mmapped() to vop_update_atime()
Attached
Detach File
Event Timeline
Log In to Comment