summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1997-10-16 20:32:40 +0000
committerphk <phk@FreeBSD.org>1997-10-16 20:32:40 +0000
commit373a865574ccc2ae06911beddc7b809dd8449423 (patch)
treec9364701073c9acbc48233602bef7453a235a02d /sys/ufs/ffs
parent49953d2a8b5e57272bcc9a4179f881d6b847830b (diff)
downloadFreeBSD-src-373a865574ccc2ae06911beddc7b809dd8449423.zip
FreeBSD-src-373a865574ccc2ae06911beddc7b809dd8449423.tar.gz
Another VFS cleanup "kilo commit"
1. Remove VOP_UPDATE, it is (also) an UFS/{FFS,LFS,EXT2FS,MFS} intereface function, and now lives in the ufsmount structure. 2. Remove VOP_SEEK, it was unused. 3. Add mode default vops: VOP_ADVLOCK vop_einval VOP_CLOSE vop_null VOP_FSYNC vop_null VOP_IOCTL vop_enotty VOP_MMAP vop_einval VOP_OPEN vop_null VOP_PATHCONF vop_einval VOP_READLINK vop_einval VOP_REALLOCBLKS vop_eopnotsupp And remove identical functionality from filesystems 4. Add vop_stdpathconf, which returns the canonical stuff. Use it in the filesystems. (XXX: It's probably wrong that specfs and fifofs sets this vop, shouldn't it come from the "host" filesystem, for instance ufs or cd9660 ?) 5. Try to make system wide VOP functions have vop_* names. 6. Initialize the um_* vectors in LFS. (Recompile your LKMS!!!)
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c4
-rw-r--r--sys/ufs/ffs/ffs_extern.h4
-rw-r--r--sys/ufs/ffs/ffs_inode.c33
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c7
-rw-r--r--sys/ufs/ffs/ffs_vnops.c7
5 files changed, 26 insertions, 29 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 85ef1b6..7f8d84d 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95
- * $Id: ffs_alloc.c,v 1.39 1997/10/14 18:46:41 phk Exp $
+ * $Id: ffs_alloc.c,v 1.40 1997/10/16 10:49:19 phk Exp $
*/
#include "opt_quota.h"
@@ -486,7 +486,7 @@ ffs_reallocblks(ap)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
if (!doasyncfree) {
gettime(&tv);
- VOP_UPDATE(vp, &tv, &tv, 1);
+ UFS_UPDATE(vp, &tv, &tv, 1);
}
}
if (ssize < len)
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 4aa6118..38701c5 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95
- * $Id: ffs_extern.h,v 1.18 1997/10/10 18:16:58 phk Exp $
+ * $Id: ffs_extern.h,v 1.19 1997/10/16 10:49:22 phk Exp $
*/
#ifndef _UFS_FFS_EXTERN_H
@@ -86,7 +86,7 @@ int ffs_statfs __P((struct mount *, struct statfs *, struct proc *));
int ffs_sync __P((struct mount *, int, struct ucred *, struct proc *));
int ffs_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
int ffs_unmount __P((struct mount *, int, struct proc *));
-int ffs_update __P((struct vop_update_args *));
+int ffs_update __P((struct vnode *, struct timeval *, struct timeval *, int));
int ffs_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
int ffs_vfree __P((struct vnode *, ino_t, int));
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 78cf65c..92bb2a7 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95
- * $Id: ffs_inode.c,v 1.27 1997/09/02 20:06:44 bde Exp $
+ * $Id: ffs_inode.c,v 1.28 1997/10/16 10:49:28 phk Exp $
*/
#include "opt_quota.h"
@@ -50,6 +50,7 @@
#include <vm/vm_extern.h>
#include <ufs/ufs/quota.h>
+#include <ufs/ufs/ufsmount.h>
#include <ufs/ufs/inode.h>
#include <ufs/ffs/fs.h>
@@ -68,13 +69,11 @@ static int ffs_indirtrunc __P((struct inode *, ufs_daddr_t, ufs_daddr_t,
* write of the inode to complete.
*/
int
-ffs_update(ap)
- struct vop_update_args /* {
- struct vnode *a_vp;
- struct timeval *a_access;
- struct timeval *a_modify;
- int a_waitfor;
- } */ *ap;
+ffs_update(vp, access, modify, waitfor)
+ struct vnode *vp;
+ struct timeval *access;
+ struct timeval *modify;
+ int waitfor;
{
register struct fs *fs;
struct buf *bp;
@@ -82,8 +81,8 @@ ffs_update(ap)
int error;
time_t tv_sec;
- ip = VTOI(ap->a_vp);
- if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) {
+ ip = VTOI(vp);
+ if (vp->v_mount->mnt_flag & MNT_RDONLY) {
ip->i_flag &=
~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
return (0);
@@ -106,10 +105,10 @@ ffs_update(ap)
tv_sec = time.tv_sec;
if (ip->i_flag & IN_ACCESS)
ip->i_atime =
- (ap->a_access == &time ? tv_sec : ap->a_access->tv_sec);
+ (access == &time ? tv_sec : access->tv_sec);
if (ip->i_flag & IN_UPDATE) {
ip->i_mtime =
- (ap->a_modify == &time ? tv_sec : ap->a_modify->tv_sec);
+ (modify == &time ? tv_sec : modify->tv_sec);
ip->i_modrev++;
}
if (ip->i_flag & IN_CHANGE)
@@ -132,7 +131,7 @@ ffs_update(ap)
}
*((struct dinode *)bp->b_data +
ino_to_fsbo(fs, ip->i_number)) = ip->i_din;
- if (ap->a_waitfor && (ap->a_vp->v_mount->mnt_flag & MNT_ASYNC) == 0)
+ if (waitfor && (vp->v_mount->mnt_flag & MNT_ASYNC) == 0)
return (bwrite(bp));
else {
bp->b_flags |= B_CLUSTEROK;
@@ -186,11 +185,11 @@ ffs_truncate(vp, length, flags, cred, p)
bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
oip->i_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (VOP_UPDATE(ovp, &tv, &tv, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
if (oip->i_size == length) {
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (VOP_UPDATE(ovp, &tv, &tv, 0));
+ return (UFS_UPDATE(ovp, &tv, &tv, 0));
}
#ifdef QUOTA
error = getinoquota(oip);
@@ -222,7 +221,7 @@ ffs_truncate(vp, length, flags, cred, p)
else
bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (VOP_UPDATE(ovp, &tv, &tv, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
/*
* Shorten the size of the file. If the file is not being
@@ -280,7 +279,7 @@ ffs_truncate(vp, length, flags, cred, p)
for (i = NDADDR - 1; i > lastblock; i--)
oip->i_db[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- error = VOP_UPDATE(ovp, &tv, &tv, ((length > 0) ? 0 : 1));
+ error = UFS_UPDATE(ovp, &tv, &tv, ((length > 0) ? 0 : 1));
if (error)
allerror = error;
/*
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index c053477..45d8a0f 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
- * $Id: ffs_vfsops.c,v 1.59 1997/10/12 20:26:12 phk Exp $
+ * $Id: ffs_vfsops.c,v 1.60 1997/10/16 10:49:33 phk Exp $
*/
#include "opt_quota.h"
@@ -557,6 +557,7 @@ ffs_mountfs(devvp, mp, p, malloctype)
M_WAITOK);
ump->um_blkatoff = ffs_blkatoff;
ump->um_truncate = ffs_truncate;
+ ump->um_update = ffs_update;
ump->um_valloc = ffs_valloc;
ump->um_vfree = ffs_vfree;
bcopy(bp->b_data, ump->um_fs, (u_int)fs->fs_sbsize);
@@ -877,8 +878,8 @@ loop:
simple_unlock(&mntvnode_slock);
simple_unlock(&vp->v_interlock);
gettime(&tv);
- /* VOP_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */
- VOP_UPDATE(vp, &tv, &tv, 0);
+ /* UFS_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */
+ UFS_UPDATE(vp, &tv, &tv, 0);
simple_lock(&mntvnode_slock);
}
}
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 254d5e5..7400ed5 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95
- * $Id: ffs_vnops.c,v 1.34 1997/10/15 13:23:47 phk Exp $
+ * $Id: ffs_vnops.c,v 1.35 1997/10/16 10:49:35 phk Exp $
*/
#include <sys/param.h>
@@ -77,7 +77,6 @@ static struct vnodeopv_entry_desc ffs_vnodeop_entries[] = {
{ &vop_getpages_desc, (vop_t *) ffs_getpages },
{ &vop_read_desc, (vop_t *) ffs_read },
{ &vop_reallocblks_desc, (vop_t *) ffs_reallocblks },
- { &vop_update_desc, (vop_t *) ffs_update },
{ &vop_write_desc, (vop_t *) ffs_write },
{ NULL, NULL }
};
@@ -88,7 +87,6 @@ vop_t **ffs_specop_p;
static struct vnodeopv_entry_desc ffs_specop_entries[] = {
{ &vop_default_desc, (vop_t *) ufs_vnoperatespec },
{ &vop_fsync_desc, (vop_t *) ffs_fsync },
- { &vop_update_desc, (vop_t *) ffs_update },
{ NULL, NULL }
};
static struct vnodeopv_desc ffs_specop_opv_desc =
@@ -98,7 +96,6 @@ vop_t **ffs_fifoop_p;
static struct vnodeopv_entry_desc ffs_fifoop_entries[] = {
{ &vop_default_desc, (vop_t *) ufs_vnoperatefifo },
{ &vop_fsync_desc, (vop_t *) ffs_fsync },
- { &vop_update_desc, (vop_t *) ffs_update },
{ NULL, NULL }
};
static struct vnodeopv_desc ffs_fifoop_opv_desc =
@@ -187,6 +184,6 @@ loop:
}
gettime(&tv);
- return (VOP_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
+ return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}
OpenPOWER on IntegriCloud