diff options
-rw-r--r-- | sys/ufs/lfs/lfs.h | 13 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_alloc.c | 30 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_balloc.c | 8 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_bio.c | 18 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_cksum.c | 6 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_debug.c | 6 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_extern.h | 153 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_inode.c | 29 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_segment.c | 20 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_subr.c | 13 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_syscalls.c | 52 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_vfsops.c | 55 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_vnops.c | 132 |
13 files changed, 324 insertions, 211 deletions
diff --git a/sys/ufs/lfs/lfs.h b/sys/ufs/lfs/lfs.h index 35f88803e0b..7f9be0158a3 100644 --- a/sys/ufs/lfs/lfs.h +++ b/sys/ufs/lfs/lfs.h @@ -1,4 +1,5 @@ -/* $NetBSD: lfs.h,v 1.6 1994/12/21 20:01:01 mycroft Exp $ */ +/* $OpenBSD: lfs.h,v 1.2 1996/02/27 07:13:18 niklas Exp $ */ +/* $NetBSD: lfs.h,v 1.7 1996/02/09 22:28:45 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -263,9 +264,9 @@ struct segsum { #define LFS_IENTRY(IP, F, IN, BP) { \ int _e; \ VTOI((F)->lfs_ivnode)->i_flag |= IN_ACCESS; \ - if (_e = bread((F)->lfs_ivnode, \ + if ((_e = bread((F)->lfs_ivnode, \ (IN) / (F)->lfs_ifpb + (F)->lfs_cleansz + (F)->lfs_segtabsz,\ - (F)->lfs_bsize, NOCRED, &(BP))) \ + (F)->lfs_bsize, NOCRED, &(BP))) != 0) \ panic("lfs: ifile read %d", _e); \ (IP) = (IFILE *)(BP)->b_data + (IN) % (F)->lfs_ifpb; \ } @@ -274,11 +275,11 @@ struct segsum { #define LFS_SEGENTRY(SP, F, IN, BP) { \ int _e; \ VTOI((F)->lfs_ivnode)->i_flag |= IN_ACCESS; \ - if (_e = bread((F)->lfs_ivnode, \ + if ((_e = bread((F)->lfs_ivnode, \ ((IN) >> (F)->lfs_sushift) + (F)->lfs_cleansz, \ - (F)->lfs_bsize, NOCRED, &(BP))) \ + (F)->lfs_bsize, NOCRED, &(BP))) != 0) \ panic("lfs: ifile read: %d", _e); \ - (SP) = (SEGUSE *)(BP)->b_data + ((IN) & (F)->lfs_sepb - 1); \ + (SP) = (SEGUSE *)(BP)->b_data + ((IN) & ((F)->lfs_sepb - 1)); \ } /* diff --git a/sys/ufs/lfs/lfs_alloc.c b/sys/ufs/lfs/lfs_alloc.c index 56a85b696fd..54b47bd28b8 100644 --- a/sys/ufs/lfs/lfs_alloc.c +++ b/sys/ufs/lfs/lfs_alloc.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_alloc.c,v 1.2 1994/06/29 06:46:47 cgd Exp $ */ +/* $OpenBSD: lfs_alloc.c,v 1.2 1996/02/27 07:13:20 niklas Exp $ */ +/* $NetBSD: lfs_alloc.c,v 1.3 1996/02/09 22:28:47 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,6 +37,7 @@ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/kernel.h> #include <sys/buf.h> #include <sys/vnode.h> @@ -48,6 +50,7 @@ #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> #include <ufs/ufs/ufsmount.h> +#include <ufs/ufs/ufs_extern.h> #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> @@ -57,14 +60,15 @@ extern u_long nextgennumber; /* Allocate a new inode. */ /* ARGSUSED */ int -lfs_valloc(ap) +lfs_valloc(v) + void *v; +{ struct vop_valloc_args /* { struct vnode *a_pvp; int a_mode; struct ucred *a_cred; struct vnode **a_vpp; - } */ *ap; -{ + } */ *ap = v; struct lfs *fs; struct buf *bp; struct ifile *ifp; @@ -113,12 +117,12 @@ lfs_valloc(ap) } ifp--; ifp->if_nextfree = LFS_UNUSED_INUM; - if (error = VOP_BWRITE(bp)) + if ((error = VOP_BWRITE(bp)) != 0) return (error); } /* Create a vnode to associate with the inode. */ - if (error = lfs_vcreate(ap->a_pvp->v_mount, new_ino, &vp)) + if ((error = lfs_vcreate(ap->a_pvp->v_mount, new_ino, &vp)) != 0) return (error); @@ -135,7 +139,8 @@ lfs_valloc(ap) /* Insert into the inode hash table. */ ufs_ihashins(ip); - if (error = ufs_vinit(vp->v_mount, lfs_specop_p, LFS_FIFOOPS, &vp)) { + error = ufs_vinit(vp->v_mount, lfs_specop_p, LFS_FIFOOPS, &vp); + if (error) { vput(vp); *ap->a_vpp = NULL; return (error); @@ -158,13 +163,13 @@ lfs_vcreate(mp, ino, vpp) ino_t ino; struct vnode **vpp; { - extern int (**lfs_vnodeop_p)(); + extern int (**lfs_vnodeop_p) __P((void *)); struct inode *ip; struct ufsmount *ump; int error, i; /* Create the vnode. */ - if (error = getnewvnode(VT_LFS, mp, lfs_vnodeop_p, vpp)) { + if ((error = getnewvnode(VT_LFS, mp, lfs_vnodeop_p, vpp)) != 0) { *vpp = NULL; return (error); } @@ -199,13 +204,14 @@ ip->i_din.di_spare[1] = 0xdeadbeef; /* Free an inode. */ /* ARGUSED */ int -lfs_vfree(ap) +lfs_vfree(v) + void *v; +{ struct vop_vfree_args /* { struct vnode *a_pvp; ino_t a_ino; int a_mode; - } */ *ap; -{ + } */ *ap = v; SEGUSE *sup; struct buf *bp; struct ifile *ifp; diff --git a/sys/ufs/lfs/lfs_balloc.c b/sys/ufs/lfs/lfs_balloc.c index aaadf2d9cb3..72c1fb4ee52 100644 --- a/sys/ufs/lfs/lfs_balloc.c +++ b/sys/ufs/lfs/lfs_balloc.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_balloc.c,v 1.2 1994/06/29 06:46:49 cgd Exp $ */ +/* $OpenBSD: lfs_balloc.c,v 1.2 1996/02/27 07:13:20 niklas Exp $ */ +/* $NetBSD: lfs_balloc.c,v 1.3 1996/02/09 22:28:48 christos Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -35,6 +36,7 @@ * @(#)lfs_balloc.c 8.1 (Berkeley) 6/11/93 */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/buf.h> #include <sys/proc.h> #include <sys/vnode.h> @@ -47,6 +49,7 @@ #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> #include <ufs/ufs/ufsmount.h> +#include <ufs/ufs/ufs_extern.h> #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> @@ -79,7 +82,8 @@ lfs_balloc(vp, iosize, lbn, bpp) */ *bpp = NULL; - if (error = ufs_bmaparray(vp, lbn, &daddr, &indirs[0], &num, NULL )) + error = ufs_bmaparray(vp, lbn, &daddr, &indirs[0], &num, NULL); + if (error) return (error); *bpp = bp = getblk(vp, lbn, fs->lfs_bsize, 0, 0); diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c index b3715af3507..48e2e979f9e 100644 --- a/sys/ufs/lfs/lfs_bio.c +++ b/sys/ufs/lfs/lfs_bio.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_bio.c,v 1.4 1995/06/18 14:48:33 cgd Exp $ */ +/* $OpenBSD: lfs_bio.c,v 1.2 1996/02/27 07:13:21 niklas Exp $ */ +/* $NetBSD: lfs_bio.c,v 1.5 1996/02/09 22:28:49 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,6 +37,7 @@ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/proc.h> #include <sys/buf.h> #include <sys/vnode.h> @@ -46,6 +48,7 @@ #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> #include <ufs/ufs/ufsmount.h> +#include <ufs/ufs/ufs_extern.h> #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> @@ -70,11 +73,12 @@ int lfs_writing; /* Set if already kicked off a writer #define LFS_BUFWAIT 2 int -lfs_bwrite(ap) +lfs_bwrite(v) + void *v; +{ struct vop_bwrite_args /* { struct buf *a_bp; - } */ *ap; -{ + } */ *ap = v; register struct buf *bp = ap->a_bp; struct lfs *fs; struct inode *ip; @@ -100,8 +104,9 @@ lfs_bwrite(ap) bp->b_lblkno > 0) { /* Out of space, need cleaner to run */ wakeup(&lfs_allclean_wakeup); - if (error = tsleep(&fs->lfs_avail, PCATCH | PUSER, - "cleaner", NULL)) { + error = tsleep(&fs->lfs_avail, PCATCH | PUSER, + "cleaner", NULL); + if (error) { brelse(bp); return (error); } @@ -168,7 +173,6 @@ lfs_check(vp, blkno) struct vnode *vp; daddr_t blkno; { - extern int lfs_allclean_wakeup; int error; error = 0; diff --git a/sys/ufs/lfs/lfs_cksum.c b/sys/ufs/lfs/lfs_cksum.c index 8255b4d92e2..0a71b7cdb3e 100644 --- a/sys/ufs/lfs/lfs_cksum.c +++ b/sys/ufs/lfs/lfs_cksum.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_cksum.c,v 1.4 1994/12/14 13:03:46 mycroft Exp $ */ +/* $OpenBSD: lfs_cksum.c,v 1.2 1996/02/27 07:13:22 niklas Exp $ */ +/* $NetBSD: lfs_cksum.c,v 1.6 1996/02/16 02:22:05 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,6 +37,9 @@ */ #include <sys/types.h> +#ifdef _KERNEL +#include <ufs/lfs/lfs_extern.h> +#endif /* * Simple, general purpose, fast checksum. Data must be short-aligned. diff --git a/sys/ufs/lfs/lfs_debug.c b/sys/ufs/lfs/lfs_debug.c index b2ba8a8d21d..ed21ac0dfa4 100644 --- a/sys/ufs/lfs/lfs_debug.c +++ b/sys/ufs/lfs/lfs_debug.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_debug.c,v 1.2 1994/06/29 06:46:54 cgd Exp $ */ +/* $OpenBSD: lfs_debug.c,v 1.2 1996/02/27 07:13:23 niklas Exp $ */ +/* $NetBSD: lfs_debug.c,v 1.3 1996/02/12 22:08:47 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -37,6 +38,7 @@ #ifdef DEBUG #include <sys/param.h> +#include <sys/systm.h> #include <sys/namei.h> #include <sys/vnode.h> #include <sys/mount.h> @@ -119,7 +121,7 @@ lfs_dump_dinode(dip) { int i; - (void)printf("%s%u\t%s%d\t%s%u\t%s%u\t%s%lu\n", + (void)printf("%s%u\t%s%d\t%s%u\t%s%u\t%s%qu\n", "mode ", dip->di_mode, "nlink ", dip->di_nlink, "uid ", dip->di_uid, diff --git a/sys/ufs/lfs/lfs_extern.h b/sys/ufs/lfs/lfs_extern.h index 42d4eb34254..826e7f14356 100644 --- a/sys/ufs/lfs/lfs_extern.h +++ b/sys/ufs/lfs/lfs_extern.h @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_extern.h,v 1.3 1994/12/14 13:03:47 mycroft Exp $ */ +/* $OpenBSD: lfs_extern.h,v 1.2 1996/02/27 07:13:24 niklas Exp $ */ +/* $NetBSD: lfs_extern.h,v 1.5 1996/02/12 15:20:12 christos Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -44,65 +45,109 @@ struct timeval; struct inode; struct uio; struct mbuf; +struct dinode; +struct buf; +struct vnode; +struct lfs; +struct segment; +struct ucred; __BEGIN_DECLS -u_long cksum __P((void *, size_t)); /* XXX */ -int lfs_balloc __P((struct vnode *, u_long, daddr_t, struct buf **)); -int lfs_blkatoff __P((struct vop_blkatoff_args *)); -int lfs_bwrite __P((struct vop_bwrite_args *)); -int lfs_check __P((struct vnode *, daddr_t)); -int lfs_close __P((struct vop_close_args *)); -int lfs_create __P((struct vop_create_args *)); -int lfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *, - struct vnode **, int *, struct ucred **)); -int lfs_fsync __P((struct vop_fsync_args *)); -int lfs_getattr __P((struct vop_getattr_args *)); -struct dinode * - lfs_ifind __P((struct lfs *, ino_t, struct dinode *)); -int lfs_inactive __P((struct vop_inactive_args *)); -int lfs_init __P((void)); -int lfs_initseg __P((struct lfs *)); -int lfs_link __P((struct vop_link_args *)); -int lfs_makeinode __P((int, struct nameidata *, struct inode **)); -int lfs_mkdir __P((struct vop_mkdir_args *)); -int lfs_mknod __P((struct vop_mknod_args *)); -int lfs_mount __P((struct mount *, - char *, caddr_t, struct nameidata *, struct proc *)); -int lfs_mountroot __P((void)); -struct buf * - lfs_newbuf __P((struct vnode *, daddr_t, size_t)); -int lfs_read __P((struct vop_read_args *)); -int lfs_reclaim __P((struct vop_reclaim_args *)); -int lfs_remove __P((struct vop_remove_args *)); -int lfs_rmdir __P((struct vop_rmdir_args *)); -int lfs_rename __P((struct vop_rename_args *)); -void lfs_seglock __P((struct lfs *, unsigned long flags)); -void lfs_segunlock __P((struct lfs *)); -int lfs_segwrite __P((struct mount *, int)); -int lfs_statfs __P((struct mount *, struct statfs *, struct proc *)); -int lfs_symlink __P((struct vop_symlink_args *)); -int lfs_sync __P((struct mount *, int, struct ucred *, struct proc *)); -int lfs_truncate __P((struct vop_truncate_args *)); -int lfs_unmount __P((struct mount *, int, struct proc *)); -int lfs_update __P((struct vop_update_args *)); -int lfs_valloc __P((struct vop_valloc_args *)); -int lfs_vcreate __P((struct mount *, ino_t, struct vnode **)); -int lfs_vfree __P((struct vop_vfree_args *)); -int lfs_vflush __P((struct vnode *)); -int lfs_vget __P((struct mount *, ino_t, struct vnode **)); -int lfs_vptofh __P((struct vnode *, struct fid *)); -int lfs_vref __P((struct vnode *)); -void lfs_vunref __P((struct vnode *)); -int lfs_write __P((struct vop_write_args *)); +/* lfs_alloc.c */ +int lfs_vcreate __P((struct mount *, ino_t, struct vnode **)); + + +/* lfs_balloc.c */ +int lfs_balloc __P((struct vnode *, u_long, daddr_t, struct buf **)); + +/* lfs_bio.c */ +void lfs_flush __P((void)); +int lfs_check __P((struct vnode *, daddr_t)); + +/* lfs_cksum.c */ +u_long cksum __P((void *, size_t)); + +/* lfs_debug.c */ #ifdef DEBUG -void lfs_dump_dinode __P((struct dinode *)); -void lfs_dump_super __P((struct lfs *)); +void lfs_dump_super __P((struct lfs *)); +void lfs_dump_dinode __P((struct dinode *)); #endif + +/* lfs_inode.c */ +void lfs_init __P((void)); +struct dinode *lfs_ifind __P((struct lfs *, ino_t, struct dinode *)); + +/* lfs_segment.c */ +int lfs_vflush __P((struct vnode *)); +void lfs_writevnodes __P((struct lfs *, struct mount *, struct segment *, int)); +int lfs_segwrite __P((struct mount *, int)); +void lfs_writefile __P((struct lfs *, struct segment *, struct vnode *)); +int lfs_writeinode __P((struct lfs *, struct segment *, struct inode *)); +int lfs_gatherblock __P((struct segment *, struct buf *, int *)); +void lfs_gather __P((struct lfs *, struct segment *, struct vnode *, int (*match )__P ((struct lfs *, struct buf *)))); +void lfs_updatemeta __P((struct segment *)); +int lfs_initseg __P((struct lfs *)); +void lfs_newseg __P((struct lfs *)); +int lfs_writeseg __P((struct lfs *, struct segment *)); +void lfs_writesuper __P((struct lfs *)); +int lfs_match_data __P((struct lfs *, struct buf *)); +int lfs_match_indir __P((struct lfs *, struct buf *)); +int lfs_match_dindir __P((struct lfs *, struct buf *)); +int lfs_match_tindir __P((struct lfs *, struct buf *)); +struct buf *lfs_newbuf __P((struct vnode *, daddr_t, size_t)); +void lfs_callback __P((struct buf *)); +void lfs_supercallback __P((struct buf *)); +void lfs_shellsort __P((struct buf **, daddr_t *, int)); +int lfs_vref __P((struct vnode *)); +void lfs_vunref __P((struct vnode *)); + +/* lfs_subr.c */ +void lfs_seglock __P((struct lfs *, unsigned long)); +void lfs_segunlock __P((struct lfs *)); + +/* lfs_syscalls.c */ +int lfs_fastvget __P((struct mount *, ino_t, daddr_t, struct vnode **, struct dinode *)); +struct buf *lfs_fakebuf __P((struct vnode *, int, size_t, caddr_t)); + +/* lfs_vfsops.c */ +int lfs_mountroot __P((void)); +int lfs_mount __P((struct mount *, char *, caddr_t, struct nameidata *, struct proc *)); +int lfs_mountfs __P((struct vnode *, struct mount *, struct proc *)); +int lfs_unmount __P((struct mount *, int, struct proc *)); +int lfs_statfs __P((struct mount *, struct statfs *, struct proc *)); +int lfs_sync __P((struct mount *, int, struct ucred *, struct proc *)); +int lfs_vget __P((struct mount *, ino_t, struct vnode **)); +int lfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *, struct vnode **, int *, struct ucred **)); +int lfs_vptofh __P((struct vnode *, struct fid *)); + + +int lfs_valloc __P((void *)); +int lfs_vfree __P((void *)); +int lfs_bwrite __P((void *)); +int lfs_update __P((void *)); +int lfs_truncate __P((void *)); +int lfs_blkatoff __P((void *)); +int lfs_fsync __P((void *)); +int lfs_symlink __P((void *)); +int lfs_mknod __P((void *)); +int lfs_create __P((void *)); +int lfs_mkdir __P((void *)); +int lfs_read __P((void *)); +int lfs_remove __P((void *)); +int lfs_rmdir __P((void *)); +int lfs_link __P((void *)); +int lfs_rename __P((void *)); +int lfs_getattr __P((void *)); +int lfs_close __P((void *)); +int lfs_inactive __P((void *)); +int lfs_reclaim __P((void *)); +int lfs_write __P((void *)); + __END_DECLS -extern int (**lfs_vnodeop_p)(); -extern int (**lfs_specop_p)(); +extern int (**lfs_vnodeop_p) __P((void *)); +extern int (**lfs_specop_p) __P((void *)); #ifdef FIFO -extern int (**lfs_fifoop_p)(); +extern int (**lfs_fifoop_p) __P((void *)); #define LFS_FIFOOPS lfs_fifoop_p #else #define LFS_FIFOOPS NULL diff --git a/sys/ufs/lfs/lfs_inode.c b/sys/ufs/lfs/lfs_inode.c index 707c0085bf2..72acdfbdcad 100644 --- a/sys/ufs/lfs/lfs_inode.c +++ b/sys/ufs/lfs/lfs_inode.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_inode.c,v 1.3 1995/06/15 23:22:44 cgd Exp $ */ +/* $OpenBSD: lfs_inode.c,v 1.2 1996/02/27 07:13:25 niklas Exp $ */ +/* $NetBSD: lfs_inode.c,v 1.4 1996/02/09 22:28:52 christos Exp $ */ /* * Copyright (c) 1986, 1989, 1991, 1993 @@ -55,10 +56,10 @@ #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> -int +void lfs_init() { - return (ufs_init()); + ufs_init(); } /* Search a block for a specific dinode. */ @@ -80,14 +81,15 @@ lfs_ifind(fs, ino, dip) } int -lfs_update(ap) +lfs_update(v) + void *v; +{ struct vop_update_args /* { struct vnode *a_vp; struct timeval *a_access; struct timeval *a_modify; int a_waitfor; - } */ *ap; -{ + } */ *ap = v; struct vnode *vp = ap->a_vp; struct inode *ip; @@ -144,15 +146,16 @@ lfs_update(ap) */ /* ARGSUSED */ int -lfs_truncate(ap) +lfs_truncate(v) + void *v; +{ struct vop_truncate_args /* { struct vnode *a_vp; off_t a_length; int a_flags; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; register struct indir *inp; register int i; register daddr_t *daddrp; @@ -211,17 +214,17 @@ lfs_truncate(ap) else { lbn = lblkno(fs, length); #ifdef QUOTA - if (e1 = getinoquota(ip)) + if ((e1 = getinoquota(ip)) != 0) return (e1); #endif - if (e1 = bread(vp, lbn, fs->lfs_bsize, NOCRED, &bp)) + if ((e1 = bread(vp, lbn, fs->lfs_bsize, NOCRED, &bp)) != 0) return (e1); ip->i_size = length; size = blksize(fs); (void)vnode_pager_uncache(vp); bzero((char *)bp->b_data + offset, (u_int)(size - offset)); allocbuf(bp, size); - if (e1 = VOP_BWRITE(bp)) + if ((e1 = VOP_BWRITE(bp)) != 0) return (e1); } /* @@ -276,7 +279,7 @@ lfs_truncate(ap) bzero((daddr_t *)bp->b_data + inp->in_off, fs->lfs_bsize - inp->in_off * sizeof(daddr_t)); - if (e1 = VOP_BWRITE(bp)) + if ((e1 = VOP_BWRITE(bp)) != 0) return (e1); } } diff --git a/sys/ufs/lfs/lfs_segment.c b/sys/ufs/lfs/lfs_segment.c index 14b4abfdce9..d14ede9b019 100644 --- a/sys/ufs/lfs/lfs_segment.c +++ b/sys/ufs/lfs/lfs_segment.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_segment.c,v 1.3 1994/08/21 03:15:32 cgd Exp $ */ +/* $OpenBSD: lfs_segment.c,v 1.2 1996/02/27 07:13:26 niklas Exp $ */ +/* $NetBSD: lfs_segment.c,v 1.4 1996/02/09 22:28:54 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -232,8 +233,9 @@ lfs_segwrite(mp, flags) if (clean <= 2) { printf ("segs clean: %d\n", clean); wakeup(&lfs_allclean_wakeup); - if (error = tsleep(&fs->lfs_avail, PRIBIO + 1, - "lfs writer", 0)) + error = tsleep(&fs->lfs_avail, PRIBIO + 1, + "lfs writer", 0); + if (error) return (error); } } while (clean <= 2 ); @@ -579,7 +581,8 @@ lfs_updatemeta(sp) (*sp->start_bpp)->b_blkno = off = fs->lfs_offset; fs->lfs_offset += db_per_fsb; - if (error = ufs_bmaparray(vp, lbn, &daddr, a, &num, NULL)) + error = ufs_bmaparray(vp, lbn, &daddr, a, &num, NULL); + if (error) panic("lfs_updatemeta: ufs_bmaparray %d", error); ip = VTOI(vp); switch (num) { @@ -755,7 +758,7 @@ lfs_writeseg(fs, sp) size_t size; u_long *datap, *dp; int ch_per_blk, do_again, i, nblocks, num, s; - int (*strategy)__P((struct vop_strategy_args *)); + int (*strategy)__P((void *)); struct vop_strategy_args vop_strategy_a; u_short ninos; char *p; @@ -773,7 +776,7 @@ lfs_writeseg(fs, sp) /* Update the segment usage information. */ LFS_SEGENTRY(sup, fs, sp->seg_number, bp); ninos = (ssp->ss_ninos + INOPB(fs) - 1) / INOPB(fs); - sup->su_nbytes += nblocks - 1 - ninos << fs->lfs_bshift; + sup->su_nbytes += (nblocks - 1 - ninos) << fs->lfs_bshift; sup->su_nbytes += ssp->ss_ninos * sizeof(struct dinode); sup->su_nbytes += LFS_SUMMARY_SIZE; sup->su_lastmod = time.tv_sec; @@ -917,7 +920,7 @@ lfs_writesuper(fs) { struct buf *bp; dev_t i_dev; - int (*strategy) __P((struct vop_strategy_args *)); + int (*strategy) __P((void *)); int s; struct vop_strategy_args vop_strategy_a; @@ -1069,7 +1072,7 @@ lfs_shellsort(bp_array, lb_array, nmemb) struct buf *bp_temp; u_long lb_temp; - for (incrp = __rsshell_increments; incr = *incrp++;) + for (incrp = __rsshell_increments; (incr = *incrp++) != 0;) for (t1 = incr; t1 < nmemb; ++t1) for (t2 = t1 - incr; t2 >= 0;) if (lb_array[t2] > lb_array[t2 + incr]) { @@ -1087,6 +1090,7 @@ lfs_shellsort(bp_array, lb_array, nmemb) /* * Check VXLOCK. Return 1 if the vnode is locked. Otherwise, vget it. */ +int lfs_vref(vp) register struct vnode *vp; { diff --git a/sys/ufs/lfs/lfs_subr.c b/sys/ufs/lfs/lfs_subr.c index 1f5784a3bfd..613ea339eaf 100644 --- a/sys/ufs/lfs/lfs_subr.c +++ b/sys/ufs/lfs/lfs_subr.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_subr.c,v 1.2 1994/06/29 06:47:00 cgd Exp $ */ +/* $OpenBSD: lfs_subr.c,v 1.2 1996/02/27 07:13:27 niklas Exp $ */ +/* $NetBSD: lfs_subr.c,v 1.3 1996/02/09 22:28:55 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,6 +37,7 @@ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/namei.h> #include <sys/vnode.h> #include <sys/buf.h> @@ -54,14 +56,15 @@ * remaining space in the directory. */ int -lfs_blkatoff(ap) +lfs_blkatoff(v) + void *v; +{ struct vop_blkatoff_args /* { struct vnode *a_vp; off_t a_offset; char **a_res; struct buf **a_bpp; - } */ *ap; -{ + } */ *ap = v; register struct lfs *fs; struct inode *ip; struct buf *bp; @@ -74,7 +77,7 @@ lfs_blkatoff(ap) bsize = blksize(fs); *ap->a_bpp = NULL; - if (error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp)) { + if ((error = bread(ap->a_vp, lbn, bsize, NOCRED, &bp)) != 0) { brelse(bp); return (error); } diff --git a/sys/ufs/lfs/lfs_syscalls.c b/sys/ufs/lfs/lfs_syscalls.c index 5c131f05073..2ffb3b70cbc 100644 --- a/sys/ufs/lfs/lfs_syscalls.c +++ b/sys/ufs/lfs/lfs_syscalls.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_syscalls.c,v 1.9 1995/09/21 23:39:20 thorpej Exp $ */ +/* $OpenBSD: lfs_syscalls.c,v 1.2 1996/02/27 07:13:28 niklas Exp $ */ +/* $NetBSD: lfs_syscalls.c,v 1.10 1996/02/09 22:28:56 christos Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -53,6 +54,7 @@ #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> + #define BUMP_FIP(SP) \ (SP)->fip = (FINFO *) (&(SP)->fip->fi_blocks[(SP)->fip->fi_nblocks]) @@ -97,7 +99,7 @@ lfs_markv(p, v, retval) BLOCK_INFO *blkp; IFILE *ifp; struct buf *bp, **bpp; - struct inode *ip; + struct inode *ip = NULL; struct lfs *fs; struct mount *mntp; struct vnode *vp; @@ -108,17 +110,18 @@ lfs_markv(p, v, retval) u_long bsize; int cnt, error; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) return (error); - if (error = copyin(SCARG(uap, fsidp), &fsid, sizeof(fsid_t))) + if ((error = copyin(SCARG(uap, fsidp), &fsid, sizeof(fsid_t))) != 0) return (error); if ((mntp = getvfs(&fsid)) == NULL) return (EINVAL); cnt = SCARG(uap, blkcnt); start = malloc(cnt * sizeof(BLOCK_INFO), M_SEGMENT, M_WAITOK); - if (error = copyin(SCARG(uap, blkiov), start, cnt * sizeof(BLOCK_INFO))) + error = copyin(SCARG(uap, blkiov), start, cnt * sizeof(BLOCK_INFO)); + if (error) goto err1; /* Mark blocks/inodes dirty. */ @@ -209,7 +212,7 @@ lfs_markv(p, v, retval) (error = copyin(blkp->bi_bp, bp->b_data, bsize))) goto err2; - if (error = VOP_BWRITE(bp)) + if ((error = VOP_BWRITE(bp)) != 0); goto err2; } while (lfs_gatherblock(sp, bp, NULL)); @@ -278,18 +281,19 @@ lfs_bmapv(p, v, retval) daddr_t daddr; int cnt, error, step; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) return (error); - if (error = copyin(SCARG(uap, fsidp), &fsid, sizeof(fsid_t))) + error = copyin(SCARG(uap, fsidp), &fsid, sizeof(fsid_t)); + if (error) return (error); if ((mntp = getvfs(&fsid)) == NULL) return (EINVAL); cnt = SCARG(uap, blkcnt); start = blkp = malloc(cnt * sizeof(BLOCK_INFO), M_SEGMENT, M_WAITOK); - if (error = copyin(SCARG(uap, blkiov), blkp, - cnt * sizeof(BLOCK_INFO))) { + error = copyin(SCARG(uap, blkiov), blkp, cnt * sizeof(BLOCK_INFO)); + if (error) { free(blkp, M_SEGMENT); return (error); } @@ -338,10 +342,10 @@ lfs_segclean(p, v, retval) fsid_t fsid; int error; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) return (error); - if (error = copyin(SCARG(uap, fsidp), &fsid, sizeof(fsid_t))) + if ((error = copyin(SCARG(uap, fsidp), &fsid, sizeof(fsid_t))) != 0) return (error); if ((mntp = getvfs(&fsid)) == NULL) return (EINVAL); @@ -399,7 +403,7 @@ lfs_segwait(p, v, retval) u_long timeout; int error, s; - if (error = suser(p->p_ucred, &p->p_acflag)) { + if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) { return (error); } #ifdef WHEN_QUADS_WORK @@ -413,7 +417,7 @@ lfs_segwait(p, v, retval) addr = &VFSTOUFS(mntp)->um_lfs->lfs_nextseg; } #else - if (error = copyin(SCARG(uap, fsidp), &fsid, sizeof(fsid_t))) + if ((error = copyin(SCARG(uap, fsidp), &fsid, sizeof(fsid_t))) != 0) return (error); if ((mntp = getvfs(&fsid)) == NULL) addr = &lfs_allclean_wakeup; @@ -422,8 +426,8 @@ lfs_segwait(p, v, retval) #endif if (SCARG(uap, tv)) { - if (error = - copyin(SCARG(uap, tv), &atv, sizeof(struct timeval))) + error = copyin(SCARG(uap, tv), &atv, sizeof(struct timeval)); + if (error) return (error); if (itimerfix(&atv)) return (EINVAL); @@ -482,7 +486,7 @@ lfs_fastvget(mp, ino, daddr, vpp, dinp) } /* Allocate new vnode/inode. */ - if (error = lfs_vcreate(mp, ino, &vp)) { + if ((error = lfs_vcreate(mp, ino, &vp)) != 0) { *vpp = NULL; return (error); } @@ -505,12 +509,15 @@ lfs_fastvget(mp, ino, daddr, vpp, dinp) ip->i_lfs = ump->um_lfs; /* Read in the disk contents for the inode, copy into the inode. */ - if (dinp) - if (error = copyin(dinp, &ip->i_din, sizeof(struct dinode))) + if (dinp) { + error = copyin(dinp, &ip->i_din, sizeof(struct dinode)); + if (error) return (error); + } else { - if (error = bread(ump->um_devvp, daddr, - (int)ump->um_lfs->lfs_bsize, NOCRED, &bp)) { + error = bread(ump->um_devvp, daddr, + (int)ump->um_lfs->lfs_bsize, NOCRED, &bp); + if (error) { /* * The inode does not contain anything useful, so it * would be misleading to leave it on its hash chain. @@ -536,7 +543,8 @@ lfs_fastvget(mp, ino, daddr, vpp, dinp) * Initialize the vnode from the inode, check for aliases. In all * cases re-init ip, the underlying vnode/inode may have changed. */ - if (error = ufs_vinit(mp, lfs_specop_p, LFS_FIFOOPS, &vp)) { + error = ufs_vinit(mp, lfs_specop_p, LFS_FIFOOPS, &vp); + if (error) { lfs_vunref(vp); *vpp = NULL; return (error); diff --git a/sys/ufs/lfs/lfs_vfsops.c b/sys/ufs/lfs/lfs_vfsops.c index 4747235b714..35374b85538 100644 --- a/sys/ufs/lfs/lfs_vfsops.c +++ b/sys/ufs/lfs/lfs_vfsops.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_vfsops.c,v 1.9 1995/06/18 14:48:39 cgd Exp $ */ +/* $OpenBSD: lfs_vfsops.c,v 1.2 1996/02/27 07:13:29 niklas Exp $ */ +/* $NetBSD: lfs_vfsops.c,v 1.10 1996/02/09 22:28:58 christos Exp $ */ /* * Copyright (c) 1989, 1991, 1993, 1994 @@ -82,6 +83,7 @@ int lfs_mountroot() { panic("lfs_mountroot"); /* XXX -- implement */ + return 0; } /* @@ -89,6 +91,7 @@ lfs_mountroot() * * mount system call */ +int lfs_mount(mp, path, data, ndp, p) register struct mount *mp; char *path; @@ -98,13 +101,14 @@ lfs_mount(mp, path, data, ndp, p) { struct vnode *devvp; struct ufs_args args; - struct ufsmount *ump; - register struct lfs *fs; /* LFS */ + struct ufsmount *ump = NULL; + register struct lfs *fs = NULL; /* LFS */ size_t size; int error; mode_t accessmode; - if (error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args))) + error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args)); + if (error) return (error); /* Until LFS can do NFS right. XXX */ @@ -124,8 +128,9 @@ lfs_mount(mp, path, data, ndp, p) */ if (p->p_ucred->cr_uid != 0) { VOP_LOCK(ump->um_devvp); - if (error = VOP_ACCESS(ump->um_devvp, - VREAD | VWRITE, p->p_ucred, p)) { + error = VOP_ACCESS(ump->um_devvp, VREAD|VWRITE, + p->p_ucred, p); + if (error) { VOP_UNLOCK(ump->um_devvp); return (error); } @@ -145,7 +150,7 @@ lfs_mount(mp, path, data, ndp, p) * and verify that it refers to a sensible block device. */ NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p); - if (error = namei(ndp)) + if ((error = namei(ndp)) != 0) return (error); devvp = ndp->ni_vp; if (devvp->v_type != VBLK) { @@ -165,7 +170,8 @@ lfs_mount(mp, path, data, ndp, p) if ((mp->mnt_flag & MNT_RDONLY) == 0) accessmode |= VWRITE; VOP_LOCK(devvp); - if (error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) { + error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p); + if (error) { vput(devvp); return (error); } @@ -227,15 +233,16 @@ lfs_mountfs(devvp, mp, p) * (except for root, which might share swap device for miniroot). * Flush out any old buffers remaining from a previous use. */ - if (error = vfs_mountedon(devvp)) + if ((error = vfs_mountedon(devvp)) != 0) return (error); if (vcount(devvp) > 1 && devvp != rootvp) return (EBUSY); - if (error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0)) + if ((error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0)) != 0) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - if (error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p)) + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p); + if (error) return (error); if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, cred, p) != 0) @@ -255,7 +262,8 @@ lfs_mountfs(devvp, mp, p) ump = NULL; /* Read in the superblock. */ - if (error = bread(devvp, LFS_LABELPAD / size, LFS_SBPAD, cred, &bp)) + error = bread(devvp, LFS_LABELPAD / size, LFS_SBPAD, cred, &bp); + if (error) goto out; fs = (struct lfs *)bp->b_data; @@ -312,7 +320,7 @@ lfs_mountfs(devvp, mp, p) * artificially increment the reference count and keep a pointer * to it in the incore copy of the superblock. */ - if (error = VFS_VGET(mp, LFS_IFILE_INUM, &vp)) + if ((error = VFS_VGET(mp, LFS_IFILE_INUM, &vp)) != 0) goto out; fs->lfs_ivnode = vp; VREF(vp); @@ -334,12 +342,12 @@ out: /* * unmount system call */ +int lfs_unmount(mp, mntflags, p) struct mount *mp; int mntflags; struct proc *p; { - extern int doforce; register struct ufsmount *ump; register struct lfs *fs; int i, error, flags, ronly; @@ -352,7 +360,8 @@ lfs_unmount(mp, mntflags, p) fs = ump->um_lfs; #ifdef QUOTA if (mp->mnt_flag & MNT_QUOTA) { - if (error = vflush(mp, fs->lfs_ivnode, SKIPSYSTEM|flags)) + error = vflush(mp, fs->lfs_ivnode, SKIPSYSTEM|flags); + if (error) return (error); for (i = 0; i < MAXQUOTAS; i++) { if (ump->um_quotas[i] == NULLVP) @@ -365,10 +374,10 @@ lfs_unmount(mp, mntflags, p) */ } #endif - if (error = vflush(mp, fs->lfs_ivnode, flags)) + if ((error = vflush(mp, fs->lfs_ivnode, flags)) != 0) return (error); fs->lfs_clean = 1; - if (error = VFS_SYNC(mp, 1, p->p_ucred, p)) + if ((error = VFS_SYNC(mp, 1, p->p_ucred, p)) != 0) return (error); if (fs->lfs_ivnode->v_dirtyblkhd.lh_first) panic("lfs_unmount: still dirty blocks on ifile vnode\n"); @@ -390,6 +399,7 @@ lfs_unmount(mp, mntflags, p) /* * Get file system statistics. */ +int lfs_statfs(mp, sbp, p) struct mount *mp; register struct statfs *sbp; @@ -427,6 +437,7 @@ lfs_statfs(mp, sbp, p) * * Note: we are always called with the filesystem marked `MPBUSY'. */ +int lfs_sync(mp, waitfor, cred, p) struct mount *mp; int waitfor; @@ -482,7 +493,7 @@ lfs_vget(mp, ino, vpp) } /* Allocate new vnode/inode. */ - if (error = lfs_vcreate(mp, ino, &vp)) { + if ((error = lfs_vcreate(mp, ino, &vp)) != 0) { *vpp = NULL; return (error); } @@ -505,8 +516,8 @@ lfs_vget(mp, ino, vpp) ip->i_lfs = ump->um_lfs; /* Read in the disk contents for the inode, copy into the inode. */ - if (error = - bread(ump->um_devvp, daddr, (int)fs->lfs_bsize, NOCRED, &bp)) { + error = bread(ump->um_devvp, daddr, (int)fs->lfs_bsize, NOCRED, &bp); + if (error) { /* * The inode does not contain anything useful, so it would * be misleading to leave it on its hash chain. With mode @@ -525,7 +536,8 @@ lfs_vget(mp, ino, vpp) * Initialize the vnode from the inode, check for aliases. In all * cases re-init ip, the underlying vnode/inode may have changed. */ - if (error = ufs_vinit(mp, lfs_specop_p, LFS_FIFOOPS, &vp)) { + error = ufs_vinit(mp, lfs_specop_p, LFS_FIFOOPS, &vp); + if (error) { vput(vp); *vpp = NULL; return (error); @@ -575,6 +587,7 @@ lfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) * Vnode pointer to File handle */ /* ARGSUSED */ +int lfs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c index 96ffcb47df3..24ed50153f7 100644 --- a/sys/ufs/lfs/lfs_vnops.c +++ b/sys/ufs/lfs/lfs_vnops.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_vnops.c,v 1.7 1995/06/15 23:22:46 cgd Exp $ */ +/* $OpenBSD: lfs_vnops.c,v 1.2 1996/02/27 07:13:31 niklas Exp $ */ +/* $NetBSD: lfs_vnops.c,v 1.10 1996/02/09 22:28:59 christos Exp $ */ /* * Copyright (c) 1986, 1989, 1991, 1993 @@ -48,6 +49,7 @@ #include <sys/mount.h> #include <sys/vnode.h> #include <sys/malloc.h> +#include <sys/signalvar.h> #include <vm/vm.h> @@ -64,7 +66,7 @@ #include <ufs/lfs/lfs_extern.h> /* Global vfs data structures for lfs. */ -int (**lfs_vnodeop_p)(); +int (**lfs_vnodeop_p) __P((void *)); struct vnodeopv_entry_desc lfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, ufs_lookup }, /* lookup */ @@ -109,12 +111,12 @@ struct vnodeopv_entry_desc lfs_vnodeop_entries[] = { { &vop_truncate_desc, lfs_truncate }, /* truncate */ { &vop_update_desc, lfs_update }, /* update */ { &vop_bwrite_desc, lfs_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc lfs_vnodeop_opv_desc = { &lfs_vnodeop_p, lfs_vnodeop_entries }; -int (**lfs_specop_p)(); +int (**lfs_specop_p) __P((void *)); struct vnodeopv_entry_desc lfs_specop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, spec_lookup }, /* lookup */ @@ -158,13 +160,13 @@ struct vnodeopv_entry_desc lfs_specop_entries[] = { { &vop_truncate_desc, spec_truncate }, /* truncate */ { &vop_update_desc, lfs_update }, /* update */ { &vop_bwrite_desc, lfs_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc lfs_specop_opv_desc = { &lfs_specop_p, lfs_specop_entries }; #ifdef FIFO -int (**lfs_fifoop_p)(); +int (**lfs_fifoop_p) __P((void *)); struct vnodeopv_entry_desc lfs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, fifo_lookup }, /* lookup */ @@ -208,7 +210,7 @@ struct vnodeopv_entry_desc lfs_fifoop_entries[] = { { &vop_truncate_desc, fifo_truncate }, /* truncate */ { &vop_update_desc, lfs_update }, /* update */ { &vop_bwrite_desc, lfs_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc lfs_fifoop_opv_desc = { &lfs_fifoop_p, lfs_fifoop_entries }; @@ -222,14 +224,16 @@ struct vnodeopv_desc lfs_fifoop_opv_desc = * Synch an open file. */ /* ARGSUSED */ -lfs_fsync(ap) +int +lfs_fsync(v) + void *v; +{ struct vop_fsync_args /* { struct vnode *a_vp; struct ucred *a_cred; int a_waitfor; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; struct timeval tv; tv = time; @@ -258,15 +262,16 @@ lfs_fsync(ap) #define MARK_VNODE(dvp) (dvp)->v_flag |= VDIROP int -lfs_symlink(ap) +lfs_symlink(v) + void *v; +{ struct vop_symlink_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; char *a_target; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -277,14 +282,15 @@ lfs_symlink(ap) } int -lfs_mknod(ap) +lfs_mknod(v) + void *v; +{ struct vop_mknod_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -295,14 +301,15 @@ lfs_mknod(ap) } int -lfs_create(ap) +lfs_create(v) + void *v; +{ struct vop_create_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -313,14 +320,15 @@ lfs_create(ap) } int -lfs_mkdir(ap) +lfs_mkdir(v) + void *v; +{ struct vop_mkdir_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -331,13 +339,14 @@ lfs_mkdir(ap) } int -lfs_remove(ap) +lfs_remove(v) + void *v; +{ struct vop_remove_args /* { struct vnode *a_dvp; struct vnode *a_vp; struct componentname *a_cnp; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -349,14 +358,15 @@ lfs_remove(ap) } int -lfs_rmdir(ap) +lfs_rmdir(v) + void *v; +{ struct vop_rmdir_args /* { struct vnodeop_desc *a_desc; struct vnode *a_dvp; struct vnode *a_vp; struct componentname *a_cnp; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -368,24 +378,27 @@ lfs_rmdir(ap) } int -lfs_link(ap) +lfs_link(v) + void *v; +{ struct vop_link_args /* { + struct vnode *a_dvp; struct vnode *a_vp; - struct vnode *a_tdvp; struct componentname *a_cnp; - } */ *ap; -{ + } */ *ap = v; int ret; - SET_DIROP(VTOI(ap->a_vp)->i_lfs); - MARK_VNODE(ap->a_vp); + SET_DIROP(VTOI(ap->a_dvp)->i_lfs); + MARK_VNODE(ap->a_dvp); ret = ufs_link(ap); - SET_ENDOP(VTOI(ap->a_vp)->i_lfs); + SET_ENDOP(VTOI(ap->a_dvp)->i_lfs); return (ret); } - + int -lfs_rename(ap) +lfs_rename(v) + void *v; +{ struct vop_rename_args /* { struct vnode *a_fdvp; struct vnode *a_fvp; @@ -393,8 +406,7 @@ lfs_rename(ap) struct vnode *a_tdvp; struct vnode *a_tvp; struct componentname *a_tcnp; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_fdvp)->i_lfs); @@ -406,14 +418,15 @@ lfs_rename(ap) } /* XXX hack to avoid calling ITIMES in getattr */ int -lfs_getattr(ap) +lfs_getattr(v) + void *v; +{ struct vop_getattr_args /* { struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct inode *ip = VTOI(vp); register struct vattr *vap = ap->a_vap; @@ -428,12 +441,12 @@ lfs_getattr(ap) vap->va_gid = ip->i_gid; vap->va_rdev = (dev_t)ip->i_rdev; vap->va_size = ip->i_din.di_size; - vap->va_atime.ts_sec = ip->i_atime; - vap->va_atime.ts_nsec = ip->i_atimensec; - vap->va_mtime.ts_sec = ip->i_mtime; - vap->va_mtime.ts_nsec = ip->i_mtimensec; - vap->va_ctime.ts_sec = ip->i_ctime; - vap->va_ctime.ts_nsec = ip->i_ctimensec; + vap->va_atime.tv_sec = ip->i_atime; + vap->va_atime.tv_nsec = ip->i_atimensec; + vap->va_mtime.tv_sec = ip->i_mtime; + vap->va_mtime.tv_nsec = ip->i_mtimensec; + vap->va_ctime.tv_sec = ip->i_ctime; + vap->va_ctime.tv_nsec = ip->i_ctimensec; vap->va_flags = ip->i_flags; vap->va_gen = ip->i_gen; /* this doesn't belong here */ @@ -457,14 +470,15 @@ lfs_getattr(ap) */ /* ARGSUSED */ int -lfs_close(ap) +lfs_close(v) + void *v; +{ struct vop_close_args /* { struct vnode *a_vp; int a_fflag; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct inode *ip = VTOI(vp); int mod; @@ -484,11 +498,12 @@ lfs_close(ap) int lfs_no_inactive = 0; int -lfs_inactive(ap) +lfs_inactive(v) + void *v; +{ struct vop_inactive_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; if (lfs_no_inactive) return (0); @@ -499,15 +514,16 @@ lfs_inactive(ap) * Reclaim an inode so that it can be used for other purposes. */ int -lfs_reclaim(ap) +lfs_reclaim(v) + void *v; +{ struct vop_reclaim_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; int error; - if (error = ufs_reclaim(vp)) + if ((error = ufs_reclaim(vp)) != 0) return (error); FREE(vp->v_data, M_LFSNODE); vp->v_data = NULL; |