diff options
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 42 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_extern.h | 11 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 29 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_subr.c | 28 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 6 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 8 |
6 files changed, 56 insertions, 68 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 425bf64..85ef1b6 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.38 1997/10/14 14:22:23 phk Exp $ + * $Id: ffs_alloc.c,v 1.39 1997/10/14 18:46:41 phk Exp $ */ #include "opt_quota.h" @@ -48,6 +48,7 @@ #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> +#include <ufs/ufs/ufsmount.h> #include <ufs/ffs/fs.h> #include <ufs/ffs/ffs_extern.h> @@ -545,23 +546,19 @@ fail: * available inode is located. */ int -ffs_valloc(ap) - struct vop_valloc_args /* { - struct vnode *a_pvp; - int a_mode; - struct ucred *a_cred; - struct vnode **a_vpp; - } */ *ap; +ffs_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 fs *fs; register struct inode *ip; - mode_t mode = ap->a_mode; ino_t ino, ipref; int cg, error; - *ap->a_vpp = NULL; + *vpp = NULL; pip = VTOI(pvp); fs = pip->i_fs; if (fs->fs_cstotal.cs_nifree == 0) @@ -578,12 +575,12 @@ ffs_valloc(ap) (allocfcn_t *)ffs_nodealloccg); 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); if (ip->i_mode) { printf("mode = 0%o, inum = %ld, fs = %s\n", ip->i_mode, ip->i_number, fs->fs_fsmnt); @@ -602,7 +599,7 @@ ffs_valloc(ap) ip->i_gen = random() / 2 + 1; return (0); noinodes: - ffs_fserr(fs, ap->a_cred->cr_uid, "out of inodes"); + ffs_fserr(fs, cred->cr_uid, "out of inodes"); uprintf("\n%s: create/symlink failed, no inodes free\n", fs->fs_fsmnt); return (ENOSPC); } @@ -1404,21 +1401,18 @@ ffs_checkblk(ip, bno, size) * The specified inode is placed back in the free map. */ int -ffs_vfree(ap) - struct vop_vfree_args /* { - struct vnode *a_pvp; - ino_t a_ino; - int a_mode; - } */ *ap; +ffs_vfree(pvp, ino, mode) + struct vnode *pvp; + ino_t ino; + int mode; { register struct fs *fs; register struct cg *cgp; register struct inode *pip; - ino_t ino = ap->a_ino; struct buf *bp; int error, cg; - pip = VTOI(ap->a_pvp); + pip = VTOI(pvp); fs = pip->i_fs; if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) panic("ffs_vfree: range: dev = 0x%x, ino = %d, fs = %s", @@ -1449,7 +1443,7 @@ ffs_vfree(ap) cgp->cg_cs.cs_nifree++; fs->fs_cstotal.cs_nifree++; fs->fs_cs(fs, cg).cs_nifree++; - if ((ap->a_mode & IFMT) == IFDIR) { + if ((mode & IFMT) == IFDIR) { cgp->cg_cs.cs_ndir--; fs->fs_cstotal.cs_ndir--; fs->fs_cs(fs, cg).cs_ndir--; diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 7cc5251..4aa6118 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.17 1997/09/27 13:40:05 kato Exp $ + * $Id: ffs_extern.h,v 1.18 1997/10/10 18:16:58 phk Exp $ */ #ifndef _UFS_FFS_EXTERN_H @@ -65,7 +65,7 @@ int ffs_alloc __P((struct inode *, ufs_daddr_t, ufs_daddr_t, int, struct ucred *, ufs_daddr_t *)); int ffs_balloc __P((struct inode *, ufs_daddr_t, int, struct ucred *, struct buf **, int)); -int ffs_blkatoff __P((struct vop_blkatoff_args *)); +int ffs_blkatoff __P((struct vnode *, off_t, char **, struct buf **)); void ffs_blkfree __P((struct inode *, ufs_daddr_t, long)); ufs_daddr_t ffs_blkpref __P((struct inode *, ufs_daddr_t, int, ufs_daddr_t *)); int ffs_bmap __P((struct vop_bmap_args *)); @@ -84,11 +84,12 @@ int ffs_realloccg __P((struct inode *, void ffs_setblock __P((struct fs *, u_char *, ufs_daddr_t)); 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 vop_truncate_args *)); +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_valloc __P((struct vop_valloc_args *)); -int ffs_vfree __P((struct vop_vfree_args *)); +int ffs_valloc __P((struct vnode *, int, struct ucred *, struct vnode **)); + +int ffs_vfree __P((struct vnode *, ino_t, int)); int ffs_vget __P((struct mount *, ino_t, struct vnode **)); int ffs_vptofh __P((struct vnode *, struct fid *)); diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 99dc77b..78cf65c 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.26 1997/03/22 06:53:29 bde Exp $ + * $Id: ffs_inode.c,v 1.27 1997/09/02 20:06:44 bde Exp $ */ #include "opt_quota.h" @@ -149,21 +149,18 @@ ffs_update(ap) * disk blocks. */ int -ffs_truncate(ap) - struct vop_truncate_args /* { - struct vnode *a_vp; - off_t a_length; - int a_flags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; +ffs_truncate(vp, length, flags, cred, p) + struct vnode *vp; + off_t length; + int flags; + struct ucred *cred; + struct proc *p; { - register struct vnode *ovp = ap->a_vp; + register struct vnode *ovp = vp; ufs_daddr_t lastblock; register struct inode *oip; ufs_daddr_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR]; ufs_daddr_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; - off_t length = ap->a_length; register struct fs *fs; struct buf *bp; int offset, size, level; @@ -210,9 +207,9 @@ ffs_truncate(ap) offset = blkoff(fs, length - 1); lbn = lblkno(fs, length - 1); aflags = B_CLRBUF; - if (ap->a_flags & IO_SYNC) + if (flags & IO_SYNC) aflags |= B_SYNC; - error = ffs_balloc(oip, lbn, offset + 1, ap->a_cred, + error = ffs_balloc(oip, lbn, offset + 1, cred, &bp, aflags); if (error) return (error); @@ -240,9 +237,9 @@ ffs_truncate(ap) } else { lbn = lblkno(fs, length); aflags = B_CLRBUF; - if (ap->a_flags & IO_SYNC) + if (flags & IO_SYNC) aflags |= B_SYNC; - error = ffs_balloc(oip, lbn, offset, ap->a_cred, &bp, aflags); + error = ffs_balloc(oip, lbn, offset, cred, &bp, aflags); if (error) return (error); oip->i_size = length; @@ -296,7 +293,7 @@ ffs_truncate(ap) bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks); oip->i_size = osize; vflags = ((length > 0) ? V_SAVE : 0) | V_SAVEMETA; - allerror = vinvalbuf(ovp, vflags, ap->a_cred, ap->a_p, 0, 0); + allerror = vinvalbuf(ovp, vflags, cred, p, 0, 0); /* * Indirect blocks first. diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 1387b20..06d5b55 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_subr.c 8.5 (Berkeley) 3/21/95 - * $Id: ffs_subr.c,v 1.11 1997/02/22 09:47:04 peter Exp $ + * $Id: ffs_subr.c,v 1.12 1997/03/09 06:00:42 mpp Exp $ */ #include <sys/param.h> @@ -57,13 +57,11 @@ * remaining space in the directory. */ int -ffs_blkatoff(ap) - struct vop_blkatoff_args /* { - struct vnode *a_vp; - off_t a_offset; - char **a_res; - struct buf **a_bpp; - } */ *ap; +ffs_blkatoff(vp, offset, res, bpp) + struct vnode *vp; + off_t offset; + char **res; + struct buf **bpp; { struct inode *ip; register struct fs *fs; @@ -71,20 +69,20 @@ ffs_blkatoff(ap) ufs_daddr_t lbn; int bsize, error; - ip = VTOI(ap->a_vp); + ip = VTOI(vp); fs = ip->i_fs; - lbn = lblkno(fs, ap->a_offset); + lbn = lblkno(fs, offset); bsize = blksize(fs, ip, lbn); - *ap->a_bpp = NULL; - error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp); + *bpp = NULL; + error = bread(vp, lbn, bsize, NOCRED, &bp); if (error) { brelse(bp); return (error); } - if (ap->a_res) - *ap->a_res = (char *)bp->b_data + blkoff(fs, ap->a_offset); - *ap->a_bpp = bp; + if (res) + *res = (char *)bp->b_data + blkoff(fs, offset); + *bpp = bp; return (0); } #endif diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 05ee306..c053477 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.58 1997/10/11 18:31:36 phk Exp $ + * $Id: ffs_vfsops.c,v 1.59 1997/10/12 20:26:12 phk Exp $ */ #include "opt_quota.h" @@ -555,6 +555,10 @@ ffs_mountfs(devvp, mp, p, malloctype) ump->um_malloctype = malloctype; ump->um_fs = malloc((u_long)fs->fs_sbsize, M_UFSMNT, M_WAITOK); + ump->um_blkatoff = ffs_blkatoff; + ump->um_truncate = ffs_truncate; + ump->um_valloc = ffs_valloc; + ump->um_vfree = ffs_vfree; bcopy(bp->b_data, ump->um_fs, (u_int)fs->fs_sbsize); if (fs->fs_sbsize < SBSIZE) bp->b_flags |= B_INVAL; diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index d3b9085..254d5e5 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.33 1997/10/15 10:05:17 phk Exp $ + * $Id: ffs_vnops.c,v 1.34 1997/10/15 13:23:47 phk Exp $ */ #include <sys/param.h> @@ -73,15 +73,11 @@ static int ffs_write __P((struct vop_write_args *)); vop_t **ffs_vnodeop_p; static struct vnodeopv_entry_desc ffs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) ufs_vnoperate }, - { &vop_blkatoff_desc, (vop_t *) ffs_blkatoff }, { &vop_fsync_desc, (vop_t *) ffs_fsync }, { &vop_getpages_desc, (vop_t *) ffs_getpages }, { &vop_read_desc, (vop_t *) ffs_read }, { &vop_reallocblks_desc, (vop_t *) ffs_reallocblks }, - { &vop_truncate_desc, (vop_t *) ffs_truncate }, { &vop_update_desc, (vop_t *) ffs_update }, - { &vop_valloc_desc, (vop_t *) ffs_valloc }, - { &vop_vfree_desc, (vop_t *) ffs_vfree }, { &vop_write_desc, (vop_t *) ffs_write }, { NULL, NULL } }; @@ -93,7 +89,6 @@ 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 }, - { &vop_vfree_desc, (vop_t *) ffs_vfree }, { NULL, NULL } }; static struct vnodeopv_desc ffs_specop_opv_desc = @@ -104,7 +99,6 @@ 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 }, - { &vop_vfree_desc, (vop_t *) ffs_vfree }, { NULL, NULL } }; static struct vnodeopv_desc ffs_fifoop_opv_desc = |