summaryrefslogtreecommitdiff
path: root/sys/ufs/ext2fs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ufs/ext2fs')
-rw-r--r--sys/ufs/ext2fs/ext2fs_balloc.c31
-rw-r--r--sys/ufs/ext2fs/ext2fs_extern.h4
-rw-r--r--sys/ufs/ext2fs/ext2fs_vfsops.c8
-rw-r--r--sys/ufs/ext2fs/ext2fs_vnops.c4
4 files changed, 20 insertions, 27 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_balloc.c b/sys/ufs/ext2fs/ext2fs_balloc.c
index a6daf74d8c6..390f02dc13f 100644
--- a/sys/ufs/ext2fs/ext2fs_balloc.c
+++ b/sys/ufs/ext2fs/ext2fs_balloc.c
@@ -314,29 +314,17 @@ fail:
}
int
-ext2fs_ballocn(v)
- void *v;
+ext2fs_gop_alloc(struct vnode *vp, off_t off, off_t len, int flags,
+ struct ucred *cred)
{
- struct vop_ballocn_args /* {
- struct vnode *a_vp;
- off_t a_offset;
- off_t a_length;
- struct ucred *a_cred;
- int a_flags;
- } */ *ap = v;
- off_t off, len;
- struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
struct m_ext2fs *fs = ip->i_e2fs;
int error, delta, bshift, bsize;
- UVMHIST_FUNC("ext2fs_ballocn"); UVMHIST_CALLED(ubchist);
+ UVMHIST_FUNC("ext2fs_gop_alloc"); UVMHIST_CALLED(ubchist);
bshift = fs->e2fs_bshift;
bsize = 1 << bshift;
- off = ap->a_offset;
- len = ap->a_length;
-
delta = off & (bsize - 1);
off -= delta;
len += delta;
@@ -346,8 +334,8 @@ ext2fs_ballocn(v)
UVMHIST_LOG(ubchist, "off 0x%x len 0x%x bsize 0x%x",
off, len, bsize, 0);
- error = ext2fs_buf_alloc(ip, lblkno(fs, off), bsize, ap->a_cred,
- NULL, ap->a_flags);
+ error = ext2fs_buf_alloc(ip, lblkno(fs, off), bsize, cred,
+ NULL, flags);
if (error) {
UVMHIST_LOG(ubchist, "error %d", error, 0,0,0);
return error;
@@ -389,6 +377,7 @@ ext2fs_balloc_range(vp, off, len, cred, flags)
{
off_t oldeof, eof, pagestart;
struct uvm_object *uobj;
+ struct genfs_node *gp = VTOG(vp);
int i, delta, error, npages;
int bshift = vp->v_mount->mnt_fs_bshift;
int bsize = 1 << bshift;
@@ -441,10 +430,10 @@ ext2fs_balloc_range(vp, off, len, cred, flags)
* now allocate the range.
*/
- lockmgr(&vp->v_glock, LK_EXCLUSIVE, NULL, curproc);
- error = VOP_BALLOCN(vp, off, len, cred, flags);
- UVMHIST_LOG(ubchist, "ballocn %d", error,0,0,0);
- lockmgr(&vp->v_glock, LK_RELEASE, NULL, curproc);
+ lockmgr(&gp->g_glock, LK_EXCLUSIVE, NULL, curproc);
+ error = GOP_ALLOC(vp, off, len, flags, cred);
+ UVMHIST_LOG(ubchist, "alloc %d", error,0,0,0);
+ lockmgr(&gp->g_glock, LK_RELEASE, NULL, curproc);
/*
* unbusy any pages we are holding.
diff --git a/sys/ufs/ext2fs/ext2fs_extern.h b/sys/ufs/ext2fs/ext2fs_extern.h
index af23fb6ef2d..5f5b2c3a47b 100644
--- a/sys/ufs/ext2fs/ext2fs_extern.h
+++ b/sys/ufs/ext2fs/ext2fs_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_extern.h,v 1.11 2001/11/27 05:27:12 art Exp $ */
+/* $OpenBSD: ext2fs_extern.h,v 1.12 2001/12/10 04:45:31 art Exp $ */
/* $NetBSD: ext2fs_extern.h,v 1.9 2000/11/27 08:39:53 chs Exp $ */
/*-
@@ -74,7 +74,7 @@ int ext2fs_inode_free(struct inode *pip, ino_t ino, int mode);
/* ext2fs_balloc.c */
int ext2fs_buf_alloc(struct inode *, daddr_t, int, struct ucred *,
struct buf **, int);
-int ext2fs_ballocn __P((void *));
+int ext2fs_gop_alloc __P((struct vnode *, off_t, off_t, int, struct ucred *));
int ext2fs_balloc_range __P((struct vnode *, off_t, off_t, struct ucred *,
int));
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c
index 87eab5f5c2b..b77f4edec62 100644
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vfsops.c,v 1.18 2001/12/10 02:19:34 art Exp $ */
+/* $OpenBSD: ext2fs_vfsops.c,v 1.19 2001/12/10 04:45:31 art Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.40 2000/11/27 08:39:53 chs Exp $ */
/*
@@ -100,6 +100,11 @@ struct vfsops ext2fs_vfsops = {
ufs_check_export
};
+struct genfs_ops ext2fs_genfsops = {
+ genfs_size,
+ ext2fs_gop_alloc,
+};
+
struct pool ext2fs_inode_pool;
extern u_long ext2gennumber;
@@ -916,6 +921,7 @@ ext2fs_vget(mp, ino, vpp)
/*
* Finish inode initialization now that aliasing has been resolved.
*/
+ genfs_node_init(vp, &ext2fs_genfsops);
ip->i_devvp = ump->um_devvp;
VREF(ip->i_devvp);
/*
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c
index defbaedf0cb..6e82f66279a 100644
--- a/sys/ufs/ext2fs/ext2fs_vnops.c
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vnops.c,v 1.19 2001/12/04 22:44:32 art Exp $ */
+/* $OpenBSD: ext2fs_vnops.c,v 1.20 2001/12/10 04:45:31 art Exp $ */
/* $NetBSD: ext2fs_vnops.c,v 1.30 2000/11/27 08:39:53 chs Exp $ */
/*
@@ -1467,10 +1467,8 @@ struct vnodeopv_entry_desc ext2fs_vnodeop_entries[] = {
{ &vop_pathconf_desc, ufs_pathconf }, /* pathconf */
{ &vop_advlock_desc, ext2fs_advlock }, /* advlock */
{ &vop_bwrite_desc, vop_generic_bwrite }, /* bwrite */
- { &vop_ballocn_desc, ext2fs_ballocn },
{ &vop_getpages_desc, genfs_getpages },
{ &vop_putpages_desc, genfs_putpages },
- { &vop_size_desc, genfs_size },
{ &vop_mmap_desc, ufs_mmap },
{ NULL, NULL }
};