From nobody Tue Jun 23 22:12:46 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4glK7m2LzQz6jD75 for ; Tue, 23 Jun 2026 22:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4glK7m1qlhz3Whr for ; Tue, 23 Jun 2026 22:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782252772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6y4fpuONpE0c9vZu7UVQ1xfBmdL09rSeY6A7gLRdPgY=; b=jPtzVe0pB7RQ3h7aV7s98c69NtAU1lrcFptXjRwnt9poFdidmkwI8qgszOGJ0lk+Ax4ZG+ wC95S9kE5McpUTZ0kfJ+dXEkHJ/r+inbZvIcU1mzu7gu6s3GtxYXnebmnckBP4fQLYvNHN cofgRHlJBINZPa4Gw0BH4GQvcrpjn18HSpvmodpgqbdqoK9fYSQ9pkVnOCV7BFsIKlGC7+ Ozkgd5yXh7JAs5TpRvhpBd+MhilhDRQRrdhDJhlJMUhh3RIKuhTD0xZVGzcXKkXV3JM9C7 5mX1rKCQZXTQUPdvXLbtB5x94jovqr5NFfqY+JZu59PMa7QrLBOhrs1jOPfIkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782252772; a=rsa-sha256; cv=none; b=dsr9bmQSDiZr0fT/ylz0LVqTtNlOvlEfyHU6qvf4EldKFey5Df7l91zARaeJ4tJU2DJwXA W3L/Vgky6kEW2wtXijUNrEvKnPapRm4OhV9HqZNGQFkR0my1cG4W6k5CdzslyH/2bj63A9 I3eEet6SxFMIfN+psJHO3YzUdN5lTeAjzWfOHo2Y/c5IboDZYJ1QZYQSqP19/ySdb0vHQy /lVh2HjmCg0TNLn+TqXqJDNgkAEYqK1e8ghe8zhCS5SBlIge4oTM4SpQcae9seuqXycs5W ZCaO92yvLKrUShGBapGnK8pbVgCPjZhPxIzACWONNKUqBkXwZ0YZzGqi20SlGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782252772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6y4fpuONpE0c9vZu7UVQ1xfBmdL09rSeY6A7gLRdPgY=; b=kkJJqlOpg7tyC0K3UM6UQP8/JvtBQewjG5F3LGoRVrkXKuTWUzH2mYlxl/FZ8qLKetnTYI GOqIFQg0Qq60cw3SiVsZ1DIsv5WMEZhYK7D4S3E0xGp6oki06ORndIEjov/YEXk6Eh+s5U nsEYEDwbiP9+8u3SCjoJaTiLz6G7pjSs6CMzeD2Mtk8RExBqGLlLithTSVccnzderkMO+l aAnZ2WPZ4eQtiAIiT4Fl8QJArh+IZgvUJaKE5latO48HhOYfuujQkS97aEVbNif7ltacaR DtjtFH+fXaSgZgzKWFsVzTl3uA4acM5lxLsvbWbQSInI64rtLcwAFBP+wZsdMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4glK7m0SqKzt2C for ; Tue, 23 Jun 2026 22:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22463 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 23 Jun 2026 22:12:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8177936ac293 - main - vfs: rename vop_mmapped() to vop_update_atime() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8177936ac293210251390e44d109ece0f3868df9 Auto-Submitted: auto-generated Date: Tue, 23 Jun 2026 22:12:46 +0000 Message-Id: <6a3b04de.22463.6d55a3ae@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8177936ac293210251390e44d109ece0f3868df9 commit 8177936ac293210251390e44d109ece0f3868df9 Author: Konstantin Belousov AuthorDate: 2026-06-19 19:52:45 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-23 22:11:55 +0000 vfs: rename vop_mmapped() to vop_update_atime() This reflects the actual functionality of the VOP. While there, add the explicit struct timespec argument for the VOP allowing the caller to set specific atime, not just request an update for it. Requested by: rmacklem Reviewed by: rmacklem Discussed with: jah Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57681 --- sys/kern/kern_exec.c | 2 +- sys/kern/vnode_if.src | 3 ++- sys/ufs/ffs/ffs_inode.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 2 +- sys/ufs/ufs/ufs_extern.h | 2 +- sys/ufs/ufs/ufs_vnops.c | 42 ++++++++++++++++++++++++++++-------------- sys/vm/vm_mmap.c | 2 +- 7 files changed, 35 insertions(+), 20 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index f19c62cd16e3..b6f2848f800c 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1036,7 +1036,7 @@ interpret: /* 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 index 78ba1aa7afda..d20ff39b314e 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -214,8 +214,9 @@ vop_setattr { %% 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 index f47cfd08f75a..3b2e7846b085 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -100,7 +100,7 @@ ffs_update(struct vnode *vp, int waitfor) 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 index 297c8257bd22..00df2cd920d3 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -6896,7 +6896,7 @@ softdep_journal_freeblocks( * 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 index 111fb1cb40b3..7b9215654e03 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -73,7 +73,7 @@ int ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *, 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 index 4abbd4ee807f..1d04e1b2785f 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -111,7 +111,7 @@ static vop_ioctl_t ufs_ioctl; 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 struct odirtemplate omastertemplate = { }; 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_itimes_locked(struct vnode *vp) 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 @@ out: } void -ufs_itimes(struct vnode *vp) +ufs_itimes(struct vnode *vp, struct timespec *tsa) { struct inode *ip; @@ -193,7 +198,7 @@ ufs_itimes(struct vnode *vp) return; VI_LOCK(vp); - ufs_itimes_locked(vp); + ufs_itimes_locked(vp, tsa); VI_UNLOCK(vp); } @@ -356,7 +361,7 @@ ufs_close( { struct vnode *vp = ap->a_vp; - ufs_itimes(vp); + ufs_itimes(vp, NULL); return (0); } @@ -523,7 +528,7 @@ ufs_stat(struct vop_stat_args *ap) 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 @@ ufs_getattr( 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 @@ out: #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 @@ ufs_mmapped( 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 @@ struct vop_vector ufs_vnodeops = { .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 index 8d71bce67d58..6ddfa02bda9e 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1391,7 +1391,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, *objp = obj; *flagsp = flags; - VOP_MMAPPED(vp); + VOP_UPDATE_ATIME(vp, NULL); done: if (error != 0 && *writecounted) {