aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs/ufs/ufs_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ufs/ufs/ufs_vnops.c')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index e5047e9addbc..675c55cf2006 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -98,6 +98,7 @@ static vop_create_t ufs_create;
static vop_getattr_t ufs_getattr;
static vop_link_t ufs_link;
static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *);
+static vop_markatime_t ufs_markatime;
static vop_mkdir_t ufs_mkdir;
static vop_mknod_t ufs_mknod;
static vop_open_t ufs_open;
@@ -491,17 +492,6 @@ ufs_setattr(ap)
((int)vap->va_bytes != VNOVAL) || (vap->va_gen != VNOVAL)) {
return (EINVAL);
}
- /*
- * Mark for update the file's access time for vfs_mark_atime().
- * We are doing this here to avoid some of the checks done
- * below -- this operation is done by request of the kernel and
- * should bypass some security checks. Things like read-only
- * checks get handled by other levels (e.g., ffs_update()).
- */
- if (vap->va_vaflags & VA_MARK_ATIME) {
- ip->i_flag |= IN_ACCESS;
- return (0);
- }
if (vap->va_flags != VNOVAL) {
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
@@ -663,6 +653,25 @@ ufs_setattr(ap)
}
/*
+ * Mark this file's access time for update for vfs_mark_atime(). This
+ * is called from execve() and mmap().
+ */
+static int
+ufs_markatime(ap)
+ struct vop_markatime_args /* {
+ struct vnode *a_vp;
+ } */ *ap;
+{
+ struct vnode *vp = ap->a_vp;
+ struct inode *ip = VTOI(vp);
+
+ VI_LOCK(vp);
+ ip->i_flag |= IN_ACCESS;
+ VI_UNLOCK(vp);
+ return (0);
+}
+
+/*
* Change the mode on a file.
* Inode must be locked before calling.
*/
@@ -2013,7 +2022,7 @@ ufs_strategy(ap)
bp->b_error = error;
bp->b_ioflags |= BIO_ERROR;
bufdone(bp);
- return (error);
+ return (0);
}
if ((long)bp->b_blkno == -1)
vfs_bio_clrbuf(bp);
@@ -2468,6 +2477,7 @@ struct vop_vector ufs_vnodeops = {
.vop_inactive = ufs_inactive,
.vop_link = ufs_link,
.vop_lookup = vfs_cache_lookup,
+ .vop_markatime = ufs_markatime,
.vop_mkdir = ufs_mkdir,
.vop_mknod = ufs_mknod,
.vop_open = ufs_open,
@@ -2507,6 +2517,7 @@ struct vop_vector ufs_fifoops = {
.vop_getattr = ufs_getattr,
.vop_inactive = ufs_inactive,
.vop_kqfilter = ufsfifo_kqfilter,
+ .vop_markatime = ufs_markatime,
.vop_print = ufs_print,
.vop_read = VOP_PANIC,
.vop_reclaim = ufs_reclaim,