Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Change the sementics of the last parameter from a boolea...
details: https://anonhg.NetBSD.org/src/rev/a1958bededd0
branches: trunk
changeset: 486138:a1958bededd0
user: perseant <perseant%NetBSD.org@localhost>
date: Sat May 13 23:43:06 2000 +0000
description:
Change the sementics of the last parameter from a boolean ("waitfor") to
a set of flags ("flags"). Two flags are defined, UPDATE_WAIT and
UPDATE_DIROP.
Under the old semantics, VOP_UPDATE would block if waitfor were set,
under the assumption that directory operations should be done
synchronously. At least LFS and FFS+softdep do not make this
assumption; FFS+softdep got around the problem by enclosing all relevant
calls to VOP_UPDATE in a "if(!DOINGSOFTDEP(vp))", while LFS simply
ignored waitfor, one of the reasons why NFS-serving an LFS filesystem
did not work properly.
Under the new semantics, the UPDATE_DIROP flag is a hint to the
fs-specific update routine that the call comes from a dirop routine, and
should be wait for, or not, accordingly.
Closes PR#8996.
diffstat:
sys/kern/vnode_if.c | 2 +-
sys/kern/vnode_if.src | 4 ++--
sys/miscfs/genfs/genfs_vnops.c | 4 ++--
sys/msdosfs/msdosfs_denode.c | 4 ++--
sys/msdosfs/msdosfs_vnops.c | 6 +++---
sys/sys/vnode.h | 5 ++++-
sys/sys/vnode_if.h | 10 +++++-----
sys/ufs/ext2fs/ext2fs_inode.c | 17 +++++++++--------
sys/ufs/ext2fs/ext2fs_readwrite.c | 6 +++---
sys/ufs/ext2fs/ext2fs_vnops.c | 20 +++++++++++---------
sys/ufs/ffs/ffs_inode.c | 27 +++++++++++++++++----------
sys/ufs/ffs/ffs_vnops.c | 5 +++--
sys/ufs/lfs/lfs.h | 18 +-----------------
sys/ufs/lfs/lfs_inode.c | 11 ++++++-----
sys/ufs/lfs/lfs_vnops.c | 4 ++--
sys/ufs/ufs/ufs_lookup.c | 4 ++--
sys/ufs/ufs/ufs_readwrite.c | 6 +++---
sys/ufs/ufs/ufs_vnops.c | 19 ++++++++++---------
18 files changed, 86 insertions(+), 86 deletions(-)
diffs (truncated from 656 to 300 lines):
diff -r 236757a6d7b3 -r a1958bededd0 sys/kern/vnode_if.c
--- a/sys/kern/vnode_if.c Sat May 13 21:11:45 2000 +0000
+++ b/sys/kern/vnode_if.c Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vnode_if.c,v 1.21 1999/12/07 23:58:28 thorpej Exp $ */
+/* $NetBSD: vnode_if.c,v 1.22 2000/05/13 23:43:06 perseant Exp $ */
/*
* Warning: This file is generated automatically.
diff -r 236757a6d7b3 -r a1958bededd0 sys/kern/vnode_if.src
--- a/sys/kern/vnode_if.src Sat May 13 21:11:45 2000 +0000
+++ b/sys/kern/vnode_if.src Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: vnode_if.src,v 1.23 1999/12/07 23:57:49 thorpej Exp $
+# $NetBSD: vnode_if.src,v 1.24 2000/05/13 23:43:07 perseant Exp $
#
# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
@@ -535,7 +535,7 @@
IN struct vnode *vp;
IN struct timespec *access;
IN struct timespec *modify;
- IN int waitfor;
+ IN int flags;
};
#
diff -r 236757a6d7b3 -r a1958bededd0 sys/miscfs/genfs/genfs_vnops.c
--- a/sys/miscfs/genfs/genfs_vnops.c Sat May 13 21:11:45 2000 +0000
+++ b/sys/miscfs/genfs/genfs_vnops.c Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_vnops.c,v 1.16 2000/03/30 12:22:14 augustss Exp $ */
+/* $NetBSD: genfs_vnops.c,v 1.17 2000/05/13 23:43:09 perseant Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -89,7 +89,7 @@
if ((ap->a_flags & FSYNC_DATAONLY) != 0)
return (0);
else
- return (VOP_UPDATE(ap->a_vp, NULL, NULL, wait));
+ return (VOP_UPDATE(ap->a_vp, NULL, NULL, wait ? UPDATE_WAIT : 0));
}
int
diff -r 236757a6d7b3 -r a1958bededd0 sys/msdosfs/msdosfs_denode.c
--- a/sys/msdosfs/msdosfs_denode.c Sat May 13 21:11:45 2000 +0000
+++ b/sys/msdosfs/msdosfs_denode.c Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_denode.c,v 1.42 2000/05/13 06:04:41 cgd Exp $ */
+/* $NetBSD: msdosfs_denode.c,v 1.43 2000/05/13 23:43:10 perseant Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -333,7 +333,7 @@
int waitfor;
{
- return (VOP_UPDATE(DETOV(dep), NULL, NULL, waitfor));
+ return (VOP_UPDATE(DETOV(dep), NULL, NULL, waitfor ? UPDATE_WAIT : 0));
}
/*
diff -r 236757a6d7b3 -r a1958bededd0 sys/msdosfs/msdosfs_vnops.c
--- a/sys/msdosfs/msdosfs_vnops.c Sat May 13 21:11:45 2000 +0000
+++ b/sys/msdosfs/msdosfs_vnops.c Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vnops.c,v 1.96 2000/04/22 22:45:37 jdolecek Exp $ */
+/* $NetBSD: msdosfs_vnops.c,v 1.97 2000/05/13 23:43:11 perseant Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -757,7 +757,7 @@
struct vnode *a_vp;
struct timespec *a_access;
struct timespec *a_modify;
- int a_waitfor;
+ int a_flags;
} */ *ap = v;
struct buf *bp;
struct direntry *dirp;
@@ -783,7 +783,7 @@
if (error)
return (error);
DE_EXTERNALIZE(dirp, dep);
- if (ap->a_waitfor == MNT_WAIT)
+ if (ap->a_flags & (UPDATE_WAIT|UPDATE_DIROP))
return (bwrite(bp));
else {
bdwrite(bp);
diff -r 236757a6d7b3 -r a1958bededd0 sys/sys/vnode.h
--- a/sys/sys/vnode.h Sat May 13 21:11:45 2000 +0000
+++ b/sys/sys/vnode.h Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vnode.h,v 1.74 2000/04/16 21:39:57 chs Exp $ */
+/* $NetBSD: vnode.h,v 1.75 2000/05/13 23:43:12 perseant Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -241,6 +241,9 @@
#define FSYNC_RECLAIM 0x0004 /* fsync: hint: vnode is being reclaimed */
#define FSYNC_LAZY 0x0008 /* fsync: lazy sync (trickle) */
+#define UPDATE_WAIT 0x0001 /* update: wait for completion */
+#define UPDATE_DIROP 0x0002 /* update: hint to fs to wait or not */
+
#define HOLDRELE(vp) holdrele(vp)
#define VHOLD(vp) vhold(vp)
#define VREF(vp) vref(vp)
diff -r 236757a6d7b3 -r a1958bededd0 sys/sys/vnode_if.h
--- a/sys/sys/vnode_if.h Sat May 13 21:11:45 2000 +0000
+++ b/sys/sys/vnode_if.h Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vnode_if.h,v 1.21 1999/12/07 23:58:27 thorpej Exp $ */
+/* $NetBSD: vnode_if.h,v 1.22 2000/05/13 23:43:12 perseant Exp $ */
/*
* Warning: This file is generated automatically.
@@ -1038,23 +1038,23 @@
struct vnode *a_vp;
struct timespec *a_access;
struct timespec *a_modify;
- int a_waitfor;
+ int a_flags;
};
extern struct vnodeop_desc vop_update_desc;
static __inline int VOP_UPDATE __P((struct vnode *, struct timespec *,
struct timespec *, int)) __attribute__((__unused__));
-static __inline int VOP_UPDATE(vp, access, modify, waitfor)
+static __inline int VOP_UPDATE(vp, access, modify, flags)
struct vnode *vp;
struct timespec *access;
struct timespec *modify;
- int waitfor;
+ int flags;
{
struct vop_update_args a;
a.a_desc = VDESC(vop_update);
a.a_vp = vp;
a.a_access = access;
a.a_modify = modify;
- a.a_waitfor = waitfor;
+ a.a_flags = flags;
return (VCALL(vp, VOFFSET(vop_update), &a));
}
diff -r 236757a6d7b3 -r a1958bededd0 sys/ufs/ext2fs/ext2fs_inode.c
--- a/sys/ufs/ext2fs/ext2fs_inode.c Sat May 13 21:11:45 2000 +0000
+++ b/sys/ufs/ext2fs/ext2fs_inode.c Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs_inode.c,v 1.14 2000/03/30 12:41:11 augustss Exp $ */
+/* $NetBSD: ext2fs_inode.c,v 1.15 2000/05/13 23:43:12 perseant Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@@ -116,8 +116,8 @@
* used to specify that the inode needs to be updated but that the times have
* already been set. The access and modified times are taken from the second
* and third parameters; the inode change time is always taken from the current
- * time. If waitfor is set, then wait for the disk write of the inode to
- * complete.
+ * time. If UPDATE_WAIT or UPDATE_DIROP is set, then wait for the disk
+ * write of the inode to complete.
*/
int
ext2fs_update(v)
@@ -127,7 +127,7 @@
struct vnode *a_vp;
struct timespec *a_access;
struct timespec *a_modify;
- int a_waitfor;
+ int a_flags;
} */ *ap = v;
struct m_ext2fs *fs;
struct buf *bp;
@@ -157,7 +157,8 @@
cp = (caddr_t)bp->b_data +
(ino_to_fsbo(fs, ip->i_number) * EXT2_DINODE_SIZE);
e2fs_isave(&ip->i_din.e2fs_din, (struct ext2fs_dinode *)cp);
- if (ap->a_waitfor && (ap->a_vp->v_mount->mnt_flag & MNT_ASYNC) == 0)
+ if ((ap->a_flags & (UPDATE_WAIT|UPDATE_DIROP)) &&
+ (ap->a_vp->v_mount->mnt_flag & MNT_ASYNC) == 0)
return (bwrite(bp));
else {
bdwrite(bp);
@@ -213,7 +214,7 @@
(u_int)oip->i_e2fs_size);
oip->i_e2fs_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (VOP_UPDATE(ovp, NULL, NULL, 1));
+ return (VOP_UPDATE(ovp, NULL, NULL, UPDATE_WAIT));
}
if (oip->i_e2fs_size == length) {
oip->i_flag |= IN_CHANGE | IN_UPDATE;
@@ -248,7 +249,7 @@
else
bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (VOP_UPDATE(ovp, NULL, NULL, 1));
+ return (VOP_UPDATE(ovp, NULL, NULL, UPDATE_WAIT));
}
/*
* Shorten the size of the file. If the file is not being
@@ -306,7 +307,7 @@
for (i = NDADDR - 1; i > lastblock; i--)
oip->i_e2fs_blocks[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- if ((error = VOP_UPDATE(ovp, NULL, NULL, 1)) != 0)
+ if ((error = VOP_UPDATE(ovp, NULL, NULL, UPDATE_WAIT)) != 0)
allerror = error;
/*
* Having written the new inode to disk, save its new configuration
diff -r 236757a6d7b3 -r a1958bededd0 sys/ufs/ext2fs/ext2fs_readwrite.c
--- a/sys/ufs/ext2fs/ext2fs_readwrite.c Sat May 13 21:11:45 2000 +0000
+++ b/sys/ufs/ext2fs/ext2fs_readwrite.c Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs_readwrite.c,v 1.11 2000/03/30 12:41:11 augustss Exp $ */
+/* $NetBSD: ext2fs_readwrite.c,v 1.12 2000/05/13 23:43:13 perseant Exp $ */
/*-
* Copyright (c) 1997 Manuel Bouyer.
@@ -163,7 +163,7 @@
if (!(vp->v_mount->mnt_flag & MNT_NOATIME)) {
ip->i_flag |= IN_ACCESS;
if ((ap->a_ioflag & IO_SYNC) == IO_SYNC)
- error = VOP_UPDATE(vp, NULL, NULL, 1);
+ error = VOP_UPDATE(vp, NULL, NULL, UPDATE_WAIT);
}
return (error);
}
@@ -295,6 +295,6 @@
uio->uio_resid = resid;
}
} else if (resid > uio->uio_resid && (ioflag & IO_SYNC) == IO_SYNC)
- error = VOP_UPDATE(vp, NULL, NULL, 1);
+ error = VOP_UPDATE(vp, NULL, NULL, UPDATE_WAIT);
return (error);
}
diff -r 236757a6d7b3 -r a1958bededd0 sys/ufs/ext2fs/ext2fs_vnops.c
--- a/sys/ufs/ext2fs/ext2fs_vnops.c Sat May 13 21:11:45 2000 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c Sat May 13 23:43:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs_vnops.c,v 1.25 2000/03/30 12:41:11 augustss Exp $ */
+/* $NetBSD: ext2fs_vnops.c,v 1.26 2000/05/13 23:43:13 perseant Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@@ -385,7 +385,8 @@
ip->i_flag |= IN_ACCESS;
if (vap->va_mtime.tv_sec != VNOVAL)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- error = VOP_UPDATE(vp, &vap->va_atime, &vap->va_mtime, 1);
+ error = VOP_UPDATE(vp, &vap->va_atime, &vap->va_mtime,
+ UPDATE_WAIT);
if (error)
return (error);
}
@@ -557,7 +558,7 @@
}
ip->i_e2fs_nlink++;
ip->i_flag |= IN_CHANGE;
- error = VOP_UPDATE(vp, NULL, NULL, 1);
+ error = VOP_UPDATE(vp, NULL, NULL, UPDATE_WAIT);
if (!error)
error = ext2fs_direnter(ip, dvp, cnp);
if (error) {
@@ -736,7 +737,7 @@
*/
ip->i_e2fs_nlink++;
ip->i_flag |= IN_CHANGE;
- if ((error = VOP_UPDATE(fvp, NULL, NULL, 1)) != 0) {
+ if ((error = VOP_UPDATE(fvp, NULL, NULL, UPDATE_WAIT)) != 0) {
VOP_UNLOCK(fvp, 0);
goto bad;
}
@@ -794,7 +795,8 @@
}
dp->i_e2fs_nlink++;
dp->i_flag |= IN_CHANGE;
- if ((error = VOP_UPDATE(tdvp, NULL, NULL, 1)) != 0)
+ if ((error = VOP_UPDATE(tdvp, NULL, NULL, UPDATE_WAIT))
+ != 0)
goto bad;
}
error = ext2fs_direnter(ip, tdvp, tcnp);
@@ -802,7 +804,7 @@
if (doingdirectory && newparent) {
dp->i_e2fs_nlink--;
dp->i_flag |= IN_CHANGE;
- (void)VOP_UPDATE(tdvp, NULL, NULL, 1);
+ (void)VOP_UPDATE(tdvp, NULL, NULL, UPDATE_WAIT);
}
goto bad;
}
@@ -1026,7 +1028,7 @@
ip->i_e2fs_mode = dmode;
tvp->v_type = VDIR; /* Rest init'd in getnewvnode(). */
ip->i_e2fs_nlink = 2;
- error = VOP_UPDATE(tvp, NULL, NULL, 1);
+ error = VOP_UPDATE(tvp, NULL, NULL, UPDATE_WAIT);
Home |
Main Index |
Thread Index |
Old Index