From 6715c8c695a3d5e818882649561a0bbd4403cb95 Mon Sep 17 00:00:00 2001 From: Pedro Martelletto Date: Thu, 10 Nov 2005 22:01:15 +0000 Subject: Use ANSI function declarations and deregister, no binary change. Diff from Rui Reis , thanks. --- sys/ufs/ufs/ufs_bmap.c | 21 ++++------------- sys/ufs/ufs/ufs_ihash.c | 22 +++++++----------- sys/ufs/ufs/ufs_inode.c | 11 ++++----- sys/ufs/ufs/ufs_lookup.c | 60 ++++++++++++++---------------------------------- 4 files changed, 34 insertions(+), 80 deletions(-) diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index 96ec5d69e99..bc436d74f83 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_bmap.c,v 1.17 2005/07/03 20:14:02 drahn Exp $ */ +/* $OpenBSD: ufs_bmap.c,v 1.18 2005/11/10 22:01:14 pedro Exp $ */ /* $NetBSD: ufs_bmap.c,v 1.3 1996/02/09 22:36:00 christos Exp $ */ /* @@ -58,8 +58,7 @@ * number to index into the array of block pointers described by the dinode. */ int -ufs_bmap(v) - void *v; +ufs_bmap(void *v) { struct vop_bmap_args /* { struct vnode *a_vp; @@ -94,15 +93,9 @@ ufs_bmap(v) * Each entry contains the offset into that block that gets you to the * next block and the disk address of the block (if it is assigned). */ - int -ufs_bmaparray(vp, bn, bnp, ap, nump, runp) - struct vnode *vp; - daddr_t bn; - daddr_t *bnp; - struct indir *ap; - int *nump; - int *runp; +ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, struct indir *ap, + int *nump, int *runp) { struct inode *ip; struct buf *bp; @@ -220,11 +213,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp) * once with the offset into the page itself. */ int -ufs_getlbns(vp, bn, ap, nump) - struct vnode *vp; - daddr_t bn; - struct indir *ap; - int *nump; +ufs_getlbns(struct vnode *vp, daddr_t bn, struct indir *ap, int *nump) { long metalbn, realbn; struct ufsmount *ump; diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c index d2af1808f18..d8b8354232d 100644 --- a/sys/ufs/ufs/ufs_ihash.c +++ b/sys/ufs/ufs/ufs_ihash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_ihash.c,v 1.10 2004/12/26 21:22:14 miod Exp $ */ +/* $OpenBSD: ufs_ihash.c,v 1.11 2005/11/10 22:01:14 pedro Exp $ */ /* $NetBSD: ufs_ihash.c,v 1.3 1996/02/09 22:36:04 christos Exp $ */ /* @@ -54,9 +54,8 @@ struct simplelock ufs_ihash_slock; * Initialize inode hash table. */ void -ufs_ihashinit() +ufs_ihashinit(void) { - ihashtbl = hashinit(desiredvnodes, M_UFSMNT, M_WAITOK, &ihash); simple_lock_init(&ufs_ihash_slock); } @@ -66,9 +65,7 @@ ufs_ihashinit() * to it. If it is in core, return it, even if it is locked. */ struct vnode * -ufs_ihashlookup(dev, inum) - dev_t dev; - ino_t inum; +ufs_ihashlookup(dev_t dev, ino_t inum) { struct inode *ip; @@ -80,6 +77,7 @@ ufs_ihashlookup(dev, inum) if (ip) return (ITOV(ip)); + return (NULLVP); } @@ -88,9 +86,7 @@ ufs_ihashlookup(dev, inum) * to it. If it is in core, but locked, wait for it. */ struct vnode * -ufs_ihashget(dev, inum) - dev_t dev; - ino_t inum; +ufs_ihashget(dev_t dev, ino_t inum) { struct proc *p = curproc; struct inode *ip; @@ -115,11 +111,10 @@ loop: * Insert the inode into the hash table, and return it locked. */ int -ufs_ihashins(ip) - struct inode *ip; +ufs_ihashins(struct inode *ip) { struct inode *curip; - struct proc *p = curproc; /* XXX */ + struct proc *p = curproc; struct ihashhead *ipp; dev_t dev = ip->i_dev; ino_t inum = ip->i_number; @@ -148,8 +143,7 @@ ufs_ihashins(ip) * Remove the inode from the hash table. */ void -ufs_ihashrem(ip) - struct inode *ip; +ufs_ihashrem(struct inode *ip) { simple_lock(&ufs_ihash_slock); diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index 11de7e84bbe..cb4481a3423 100644 --- a/sys/ufs/ufs/ufs_inode.c +++ b/sys/ufs/ufs/ufs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_inode.c,v 1.30 2005/07/03 20:14:03 drahn Exp $ */ +/* $OpenBSD: ufs_inode.c,v 1.31 2005/11/10 22:01:14 pedro Exp $ */ /* $NetBSD: ufs_inode.c,v 1.7 1996/05/11 18:27:52 mycroft Exp $ */ /* @@ -61,8 +61,7 @@ u_long nextgennumber; /* Next generation number to assign. */ * Last reference to an inode. If necessary, write or delete it. */ int -ufs_inactive(v) - void *v; +ufs_inactive(void *v) { struct vop_inactive_args /* { struct vnode *a_vp; @@ -133,11 +132,9 @@ out: * Reclaim an inode so that it can be used for other purposes. */ int -ufs_reclaim(vp, p) - register struct vnode *vp; - struct proc *p; +ufs_reclaim(struct vnode *vp, struct proc *p) { - register struct inode *ip; + struct inode *ip; extern int prtactive; if (prtactive && vp->v_usecount != 0) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 97238080f1f..8fe04244835 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_lookup.c,v 1.33 2005/07/20 16:30:35 pedro Exp $ */ +/* $OpenBSD: ufs_lookup.c,v 1.34 2005/11/10 22:01:14 pedro Exp $ */ /* $NetBSD: ufs_lookup.c,v 1.7 1996/02/09 22:36:06 christos Exp $ */ /* @@ -102,18 +102,17 @@ int dirchk = 0; * nor deleting, add name to cache */ int -ufs_lookup(v) - void *v; +ufs_lookup(void *v) { struct vop_lookup_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; } */ *ap = v; - register struct vnode *vdp; /* vnode for directory being searched */ - register struct inode *dp; /* inode for directory being searched */ + struct vnode *vdp; /* vnode for directory being searched */ + struct inode *dp; /* inode for directory being searched */ struct buf *bp; /* a buffer of directory entries */ - register struct direct *ep; /* the current directory entry */ + struct direct *ep; /* the current directory entry */ int entryoffsetinblock; /* offset of ep in bp's buffer */ enum {NONE, COMPACT, FOUND} slotstatus; doff_t slotoffset; /* offset of area with free space */ @@ -607,10 +606,7 @@ found: } void -ufs_dirbad(ip, offset, how) - struct inode *ip; - doff_t offset; - char *how; +ufs_dirbad(struct inode *ip, doff_t offset, char *how) { struct mount *mp; @@ -630,12 +626,9 @@ ufs_dirbad(ip, offset, how) * name must be as long as advertised, and null terminated */ int -ufs_dirbadentry(dp, ep, entryoffsetinblock) - struct vnode *dp; - register struct direct *ep; - int entryoffsetinblock; +ufs_dirbadentry(struct vnode *dp, struct direct *ep, int entryoffsetinblock) { - register int i; + int i; int namlen; # if (BYTE_ORDER == LITTLE_ENDIAN) @@ -674,12 +667,9 @@ bad: * argument ip is the inode to which the new directory entry will refer. */ void -ufs_makedirentry(ip, cnp, newdirp) - struct inode *ip; - struct componentname *cnp; - struct direct *newdirp; +ufs_makedirentry(struct inode *ip, struct componentname *cnp, + struct direct *newdirp) { - #ifdef DIAGNOSTIC if ((cnp->cn_flags & SAVENAME) == 0) panic("ufs_makedirentry: missing name"); @@ -709,12 +699,8 @@ ufs_makedirentry(ip, cnp, newdirp) * soft dependency code). */ int -ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) - struct vnode *dvp; - struct vnode *tvp; - struct direct *dirp; - struct componentname *cnp; - struct buf *newdirbp; +ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, + struct componentname *cnp, struct buf *newdirbp) { struct ucred *cr; struct proc *p; @@ -966,11 +952,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) * to the size of the previous entry. */ int -ufs_dirremove(dvp, ip, flags, isrmdir) - struct vnode *dvp; - struct inode *ip; - int flags; - int isrmdir; +ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) { struct inode *dp; struct direct *ep; @@ -1043,11 +1025,8 @@ ufs_dirremove(dvp, ip, flags, isrmdir) * set up by a call to namei. */ int -ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) - struct inode *dp, *oip; - ino_t newinum; - int newtype; - int isrmdir; +ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, + int isrmdir) { struct buf *bp; struct direct *ep; @@ -1089,10 +1068,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) * NB: does not handle corrupted directories. */ int -ufs_dirempty(ip, parentino, cred) - struct inode *ip; - ino_t parentino; - struct ucred *cred; +ufs_dirempty(struct inode *ip, ino_t parentino, struct ucred *cred) { off_t off, m; struct dirtemplate dbuf; @@ -1150,9 +1126,7 @@ ufs_dirempty(ip, parentino, cred) * The target is always vput before returning. */ int -ufs_checkpath(source, target, cred) - struct inode *source, *target; - struct ucred *cred; +ufs_checkpath(struct inode *source, struct inode *target, struct ucred *cred) { struct vnode *vp; int error, rootino, namlen; -- cgit v1.2.3