summaryrefslogtreecommitdiffstats
path: root/sys/ufs/lfs
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/lfs
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/lfs')
-rw-r--r--sys/ufs/lfs/lfs_extern.h4
-rw-r--r--sys/ufs/lfs/lfs_inode.c29
-rw-r--r--sys/ufs/lfs/lfs_vfsops.c7
-rw-r--r--sys/ufs/lfs/lfs_vnops.c7
4 files changed, 23 insertions, 24 deletions
diff --git a/sys/ufs/lfs/lfs_extern.h b/sys/ufs/lfs/lfs_extern.h
index 030fedd..d930f4d 100644
--- a/sys/ufs/lfs/lfs_extern.h
+++ b/sys/ufs/lfs/lfs_extern.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)lfs_extern.h 8.6 (Berkeley) 5/8/95
- * $Id: lfs_extern.h,v 1.17 1997/10/12 20:26:15 phk Exp $
+ * $Id: lfs_extern.h,v 1.18 1997/10/16 10:49:44 phk Exp $
*/
#ifndef _UFS_LFS_LFS_EXTERN_H_
@@ -68,7 +68,7 @@ int lfs_segwrite __P((struct mount *, int));
#define lfs_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
int lfs_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
-int lfs_update __P((struct vop_update_args *));
+int lfs_update __P((struct vnode *, struct timeval *, struct timeval *, int));
void lfs_updatemeta __P((struct segment *));
int lfs_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
int lfs_vcreate __P((struct mount *, ino_t, struct vnode **));
diff --git a/sys/ufs/lfs/lfs_inode.c b/sys/ufs/lfs/lfs_inode.c
index 6b03151..39edcae 100644
--- a/sys/ufs/lfs/lfs_inode.c
+++ b/sys/ufs/lfs/lfs_inode.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)lfs_inode.c 8.9 (Berkeley) 5/8/95
- * $Id: lfs_inode.c,v 1.18 1997/09/02 20:06:48 bde Exp $
+ * $Id: lfs_inode.c,v 1.19 1997/10/16 10:49:47 phk Exp $
*/
#include "opt_quota.h"
@@ -73,15 +73,12 @@ lfs_ifind(fs, ino, dip)
}
int
-lfs_update(ap)
- struct vop_update_args /* {
- struct vnode *a_vp;
- struct timeval *a_access;
- struct timeval *a_modify;
- int a_waitfor;
- } */ *ap;
+lfs_update(vp, access, modify, waitfor)
+ struct vnode *vp;
+ struct timeval *access;
+ struct timeval *modify;
+ int waitfor;
{
- struct vnode *vp = ap->a_vp;
struct inode *ip;
int error;
@@ -104,9 +101,9 @@ lfs_update(ap)
return(0);
if (ip->i_flag & IN_ACCESS)
- ip->i_atime = ap->a_access->tv_sec;
+ ip->i_atime = access->tv_sec;
if (ip->i_flag & IN_UPDATE) {
- ip->i_mtime = ap->a_modify->tv_sec;
+ ip->i_mtime = modify->tv_sec;
(ip)->i_modrev++;
}
if (ip->i_flag & IN_CHANGE)
@@ -118,8 +115,8 @@ lfs_update(ap)
ip->i_flag |= IN_MODIFIED;
/* If sync, push back the vnode and any dirty blocks it may have. */
- error = (ap->a_waitfor & LFS_SYNC ? lfs_vflush(vp) : 0);
- if(ap->a_waitfor & LFS_SYNC && vp->v_dirtyblkhd.lh_first != NULL)
+ error = (waitfor & LFS_SYNC ? lfs_vflush(vp) : 0);
+ if(waitfor & LFS_SYNC && vp->v_dirtyblkhd.lh_first != NULL)
panic("lfs_update: dirty bufs");
return( error );
@@ -186,7 +183,7 @@ lfs_truncate(vp, length, flags, cred, p)
bzero((char *)&ip->i_shortlink, (u_int)ip->i_size);
ip->i_size = 0;
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (VOP_UPDATE(vp, &tv, &tv, 0));
+ return (UFS_UPDATE(vp, &tv, &tv, 0));
}
vnode_pager_setsize(vp, (u_long)length);
@@ -195,7 +192,7 @@ lfs_truncate(vp, length, flags, cred, p)
/* If length is larger than the file, just update the times. */
if (ip->i_size <= length) {
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (VOP_UPDATE(vp, &tv, &tv, 0));
+ return (UFS_UPDATE(vp, &tv, &tv, 0));
}
/*
@@ -376,6 +373,6 @@ lfs_truncate(vp, length, flags, cred, p)
fs->lfs_avail += fragstodb(fs, a_released);
e1 = vinvalbuf(vp, (length > 0) ? V_SAVE : 0, cred, p,
0, 0);
- e2 = VOP_UPDATE(vp, &tv, &tv, 0);
+ e2 = UFS_UPDATE(vp, &tv, &tv, 0);
return (e1 ? e1 : e2 ? e2 : 0);
}
diff --git a/sys/ufs/lfs/lfs_vfsops.c b/sys/ufs/lfs/lfs_vfsops.c
index aa54c28..c543639 100644
--- a/sys/ufs/lfs/lfs_vfsops.c
+++ b/sys/ufs/lfs/lfs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)lfs_vfsops.c 8.20 (Berkeley) 6/10/95
- * $Id: lfs_vfsops.c,v 1.24 1997/10/12 20:26:17 phk Exp $
+ * $Id: lfs_vfsops.c,v 1.25 1997/10/16 08:16:34 julian Exp $
*/
#include "opt_quota.h"
@@ -385,6 +385,11 @@ lfs_mountfs(devvp, mp, p)
ump = (struct ufsmount *)malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
bzero(ump, sizeof *ump);
ump->um_malloctype = M_LFSNODE;
+ ump->um_blkatoff = lfs_blkatoff;
+ ump->um_truncate = lfs_truncate;
+ ump->um_update = lfs_update;
+ ump->um_valloc = lfs_valloc;
+ ump->um_vfree = lfs_vfree;
fs = ump->um_lfs = malloc(sizeof(struct lfs), M_UFSMNT, M_WAITOK);
bcopy(bp->b_data, fs, sizeof(struct lfs));
if (sizeof(struct lfs) < LFS_SBPAD) /* XXX why? */
diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c
index a440b2b..fd383a7 100644
--- a/sys/ufs/lfs/lfs_vnops.c
+++ b/sys/ufs/lfs/lfs_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)lfs_vnops.c 8.13 (Berkeley) 6/10/95
- * $Id: lfs_vnops.c,v 1.27 1997/10/15 13:23:52 phk Exp $
+ * $Id: lfs_vnops.c,v 1.28 1997/10/16 10:49:53 phk Exp $
*/
#include <sys/param.h>
@@ -79,7 +79,6 @@ static struct vnodeopv_entry_desc lfs_vnodeop_entries[] = {
{ &vop_fsync_desc, (vop_t *) lfs_fsync },
{ &vop_getattr_desc, (vop_t *) lfs_getattr },
{ &vop_read_desc, (vop_t *) lfs_read },
- { &vop_update_desc, (vop_t *) lfs_update },
{ &vop_write_desc, (vop_t *) lfs_write },
{ &vop_lookup_desc, (vop_t *) ufs_lookup },
{ NULL, NULL }
@@ -92,7 +91,6 @@ static struct vnodeopv_entry_desc lfs_specop_entries[] = {
{ &vop_default_desc, (vop_t *) ufs_vnoperatespec },
{ &vop_bwrite_desc, (vop_t *) lfs_bwrite },
{ &vop_getattr_desc, (vop_t *) lfs_getattr },
- { &vop_update_desc, (vop_t *) lfs_update },
{ NULL, NULL }
};
static struct vnodeopv_desc lfs_specop_opv_desc =
@@ -103,7 +101,6 @@ static struct vnodeopv_entry_desc lfs_fifoop_entries[] = {
{ &vop_default_desc, (vop_t *) ufs_vnoperatefifo },
{ &vop_bwrite_desc, (vop_t *) lfs_bwrite },
{ &vop_getattr_desc, (vop_t *) lfs_getattr },
- { &vop_update_desc, (vop_t *) lfs_update },
{ NULL, NULL }
};
static struct vnodeopv_desc lfs_fifoop_opv_desc =
@@ -134,7 +131,7 @@ lfs_fsync(ap)
int error;
gettime(&tv);
- error = (VOP_UPDATE(ap->a_vp, &tv, &tv,
+ error = (UFS_UPDATE(ap->a_vp, &tv, &tv,
ap->a_waitfor == MNT_WAIT ? LFS_SYNC : 0));
if(ap->a_waitfor == MNT_WAIT && ap->a_vp->v_dirtyblkhd.lh_first != NULL)
panic("lfs_fsync: dirty bufs");
OpenPOWER on IntegriCloud