summaryrefslogtreecommitdiffstats
path: root/sys/gnu/ext2fs/ext2_alloc.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1997-10-16 10:50:27 +0000
committerphk <phk@FreeBSD.org>1997-10-16 10:50:27 +0000
commitd166441755d9516e482ede0d988b7989be25b10a (patch)
treead2fb706565dc877eddf12a6581bfa2467513503 /sys/gnu/ext2fs/ext2_alloc.c
parentefcfb5d9cd2ecb3d30ec4c7701bfe737dc1b4606 (diff)
downloadFreeBSD-src-d166441755d9516e482ede0d988b7989be25b10a.zip
FreeBSD-src-d166441755d9516e482ede0d988b7989be25b10a.tar.gz
VFS mega cleanup commit (x/N)
1. Add new file "sys/kern/vfs_default.c" where default actions for VOPs go. Implement proper defaults for ABORTOP, BWRITE, LEASE, POLL, REVOKE and STRATEGY. Various stuff spread over the entire tree belongs here. 2. Change VOP_BLKATOFF to a normal function in cd9660. 3. Kill VOP_BLKATOFF, VOP_TRUNCATE, VOP_VFREE, VOP_VALLOC. These are private interface functions between UFS and the underlying storage manager layer (FFS/LFS/MFS/EXT2FS). The functions now live in struct ufsmount instead. 4. Remove a kludge of VOP_ functions in all filesystems, that did nothing but obscure the simplicity and break the expandability. If a filesystem doesn't implement VOP_FOO, it shouldn't have an entry for it in its vnops table. The system will try to DTRT if it is not implemented. There are still some cruft left, but the bulk of it is done. 5. Fix another VCALL in vfs_cache.c (thanks Bruce!)
Diffstat (limited to 'sys/gnu/ext2fs/ext2_alloc.c')
-rw-r--r--sys/gnu/ext2fs/ext2_alloc.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/sys/gnu/ext2fs/ext2_alloc.c b/sys/gnu/ext2fs/ext2_alloc.c
index 64e9b87..f78b6a5 100644
--- a/sys/gnu/ext2fs/ext2_alloc.c
+++ b/sys/gnu/ext2fs/ext2_alloc.c
@@ -56,6 +56,7 @@
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
+#include <ufs/ufs/ufsmount.h>
#include <gnu/ext2fs/ext2_fs.h>
#include <gnu/ext2fs/ext2_fs_sb.h>
@@ -383,26 +384,22 @@ fail:
* ext2_new_inode(), to make sure we get the policies right
*/
int
-ext2_valloc(ap)
- struct vop_valloc_args /* {
- struct vnode *a_pvp;
- int a_mode;
- struct ucred *a_cred;
- struct vnode **a_vpp;
- } */ *ap;
+ext2_valloc(pvp, mode, cred, vpp)
+ struct vnode *pvp;
+ int mode;
+ struct ucred *cred;
+ struct vnode **vpp;
{
- register struct vnode *pvp = ap->a_pvp;
register struct inode *pip;
register struct ext2_sb_info *fs;
register struct inode *ip;
- mode_t mode = ap->a_mode;
ino_t ino;
int i, error;
#if !defined(__FreeBSD__)
struct timeval time;
#endif
- *ap->a_vpp = NULL;
+ *vpp = NULL;
pip = VTOI(pvp);
fs = pip->i_e2fs;
if (fs->s_es->s_free_inodes_count == 0)
@@ -413,12 +410,12 @@ ext2_valloc(ap)
if (ino == 0)
goto noinodes;
- error = VFS_VGET(pvp->v_mount, ino, ap->a_vpp);
+ error = VFS_VGET(pvp->v_mount, ino, vpp);
if (error) {
- VOP_VFREE(pvp, ino, mode);
+ UFS_VFREE(pvp, ino, mode);
return (error);
}
- ip = VTOI(*ap->a_vpp);
+ ip = VTOI(*vpp);
/*
the question is whether using VGET was such good idea at all -
@@ -448,7 +445,7 @@ printf("ext2_valloc: allocated inode %d\n", ino);
*/
return (0);
noinodes:
- ext2_fserr(fs, ap->a_cred->cr_uid, "out of inodes");
+ ext2_fserr(fs, cred->cr_uid, "out of inodes");
uprintf("\n%s: create/symlink failed, no inodes free\n", fs->fs_fsmnt);
return (ENOSPC);
}
@@ -525,25 +522,21 @@ ext2_blkfree(ip, bno, size)
* the maintenance of the actual bitmaps is again up to the linux code
*/
int
-ext2_vfree(ap)
- struct vop_vfree_args /* {
- struct vnode *a_pvp;
- ino_t a_ino;
- int a_mode;
- } */ *ap;
+ext2_vfree(pvp, ino, mode)
+ struct vnode *pvp;
+ ino_t ino;
+ int mode;
{
register struct ext2_sb_info *fs;
register struct inode *pip;
- ino_t ino = ap->a_ino;
- int mode;
- pip = VTOI(ap->a_pvp);
+ pip = VTOI(pvp);
fs = pip->i_e2fs;
if ((u_int)ino >= fs->s_inodes_per_group * fs->s_groups_count)
panic("ifree: range: dev = 0x%x, ino = %d, fs = %s",
pip->i_dev, ino, fs->fs_fsmnt);
-/* ext2_debug("ext2_vfree (%d, %d) called\n", pip->i_number, ap->a_mode);
+/* ext2_debug("ext2_vfree (%d, %d) called\n", pip->i_number, mode);
*/
ext2_discard_prealloc(pip);
@@ -553,7 +546,7 @@ ext2_vfree(ap)
'set i_mode to zero to denote an unused inode' is
*/
mode = pip->i_mode;
- pip->i_mode = ap->a_mode;
+ pip->i_mode = mode;
ext2_free_inode(pip);
pip->i_mode = mode;
return (0);
OpenPOWER on IntegriCloud