From 4625f023716f79390abe69b7dcbdde8f1354ed5c Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Sat, 17 Apr 2004 00:30:17 +0000 Subject: [PATCH] Style(9) cleanup to src/sys/vfs, stage 9/21: msdosfs. - Convert K&R-style function definitions to ANSI style. Submitted-by: Andre Nathan Additional-reformatting-by: cpressey --- sys/vfs/msdosfs/msdosfs_conv.c | 79 +++------- sys/vfs/msdosfs/msdosfs_denode.c | 62 +++----- sys/vfs/msdosfs/msdosfs_fat.c | 101 ++++--------- sys/vfs/msdosfs/msdosfs_lookup.c | 52 +++---- sys/vfs/msdosfs/msdosfs_vfsops.c | 63 +++----- sys/vfs/msdosfs/msdosfs_vnops.c | 240 +++++++++++++------------------ 6 files changed, 195 insertions(+), 402 deletions(-) diff --git a/sys/vfs/msdosfs/msdosfs_conv.c b/sys/vfs/msdosfs/msdosfs_conv.c index e53701da35..29daaf03ca 100644 --- a/sys/vfs/msdosfs/msdosfs_conv.c +++ b/sys/vfs/msdosfs/msdosfs_conv.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_conv.c,v 1.29.2.1 2002/11/08 22:01:22 semenu Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_conv.c,v 1.4 2003/08/20 09:56:32 rob Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_conv.c,v 1.5 2004/04/17 00:30:17 cpressey Exp $ */ /* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */ /*- @@ -96,11 +96,7 @@ static __inline u_int8_t find_lcode (u_int16_t code, u_int16_t *u2w); * file timestamps. The passed in unix time is assumed to be in GMT. */ void -unix2dostime(tsp, ddp, dtp, dhp) - struct timespec *tsp; - u_int16_t *ddp; - u_int16_t *dtp; - u_int8_t *dhp; +unix2dostime(struct timespec *tsp, u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp) { u_long t; u_long days; @@ -177,11 +173,7 @@ static u_long lastseconds; * not be too efficient. */ void -dos2unixtime(dd, dt, dh, tsp) - u_int dd; - u_int dt; - u_int dh; - struct timespec *tsp; +dos2unixtime(u_int dd, u_int dt, u_int dh, struct timespec *tsp) { u_long seconds; u_long month; @@ -395,14 +387,8 @@ l2u[256] = { * null. */ int -dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul) - u_char dn[11]; - u_char *un; - int lower; - int d2u_loaded; - u_int8_t *d2u; - int ul_loaded; - u_int8_t *ul; +dos2unixfn(u_char dn[11], u_char *un, int lower, int d2u_loaded, u_int8_t *d2u, + int ul_loaded, u_int8_t *ul) { int i; int thislong = 1; @@ -469,15 +455,8 @@ dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul) * 3 if conversion was successful and generation number was inserted */ int -unix2dosfn(un, dn, unlen, gen, u2d_loaded, u2d, lu_loaded, lu) - const u_char *un; - u_char dn[12]; - int unlen; - u_int gen; - int u2d_loaded; - u_int8_t *u2d; - int lu_loaded; - u_int8_t *lu; +unix2dosfn(const u_char *un, u_char dn[12], int unlen, u_int gen, int u2d_loaded, + u_int8_t *u2d, int lu_loaded, u_int8_t *lu) { int i, j, l; int conv = 1; @@ -651,14 +630,8 @@ unix2dosfn(un, dn, unlen, gen, u2d_loaded, u2d, lu_loaded, lu) * i.e. doesn't consist solely of blanks and dots */ int -unix2winfn(un, unlen, wep, cnt, chksum, table_loaded, u2w) - const u_char *un; - int unlen; - struct winentry *wep; - int cnt; - int chksum; - int table_loaded; - u_int16_t *u2w; +unix2winfn(const u_char *un, int unlen, struct winentry *wep, int cnt, int chksum, + int table_loaded, u_int16_t *u2w) { const u_int8_t *cp; u_int8_t *wcp; @@ -734,9 +707,7 @@ done: } static __inline u_int8_t -find_lcode(code, u2w) - u_int16_t code; - u_int16_t *u2w; +find_lcode(u_int16_t code, u_int16_t *u2w) { int i; @@ -751,15 +722,8 @@ find_lcode(code, u2w) * Returns the checksum or -1 if no match */ int -winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, ul_loaded, ul) - const u_char *un; - int unlen; - struct winentry *wep; - int chksum; - int u2w_loaded; - u_int16_t *u2w; - int ul_loaded; - u_int8_t *ul; +winChkName(const u_char *un, int unlen, struct winentry *wep, int chksum, + int u2w_loaded, u_int16_t *u2w, int ul_loaded, u_int8_t *ul) { u_int8_t *cp; int i; @@ -870,12 +834,8 @@ winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, ul_loaded, ul) * Returns the checksum or -1 if impossible */ int -win2unixfn(wep, dp, chksum, table_loaded, u2w) - struct winentry *wep; - struct dirent *dp; - int chksum; - int table_loaded; - u_int16_t *u2w; +win2unixfn(struct winentry *wep, struct dirent *dp, int chksum, int table_loaded, + u_int16_t *u2w) { u_int8_t *cp; u_int8_t *np, *ep = dp->d_name + WIN_MAXLEN; @@ -1009,8 +969,7 @@ win2unixfn(wep, dp, chksum, table_loaded, u2w) * Compute the checksum of a DOS filename for Win95 use */ u_int8_t -winChksum(name) - u_int8_t *name; +winChksum(u_int8_t *name) { int i; u_int8_t s; @@ -1024,9 +983,7 @@ winChksum(name) * Determine the number of slots necessary for Win95 names */ int -winSlotCnt(un, unlen) - const u_char *un; - int unlen; +winSlotCnt(const u_char *un, int unlen) { unlen = winLenFixup(un, unlen); if (unlen > WIN_MAXLEN) @@ -1038,9 +995,7 @@ winSlotCnt(un, unlen) * Determine the number of bytes neccesary for Win95 names */ int -winLenFixup(un, unlen) - const u_char* un; - int unlen; +winLenFixup(const u_char *un, int unlen) { for (un += unlen; unlen > 0; unlen--) if (*--un != ' ' && *un != '.') diff --git a/sys/vfs/msdosfs/msdosfs_denode.c b/sys/vfs/msdosfs/msdosfs_denode.c index 2374a525f6..34a9d6152b 100644 --- a/sys/vfs/msdosfs/msdosfs_denode.c +++ b/sys/vfs/msdosfs/msdosfs_denode.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_denode.c,v 1.47.2.3 2002/08/22 16:20:15 trhodes Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_denode.c,v 1.10 2004/03/01 06:33:21 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_denode.c,v 1.11 2004/04/17 00:30:17 cpressey Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.28 1998/02/10 14:10:00 mrg Exp $ */ /*- @@ -100,8 +100,7 @@ static void msdosfs_hashrem (struct denode *dep); /*ARGSUSED*/ int -msdosfs_init(vfsp) - struct vfsconf *vfsp; +msdosfs_init(struct vfsconf *vfsp) { dehashtbl = hashinit(desiredvnodes/2, M_MSDOSFSMNT, &dehash); lwkt_token_init(&dehash_token); @@ -109,8 +108,7 @@ msdosfs_init(vfsp) } int -msdosfs_uninit(vfsp) - struct vfsconf *vfsp; +msdosfs_uninit(struct vfsconf *vfsp) { if (dehashtbl) @@ -119,10 +117,7 @@ msdosfs_uninit(vfsp) } static struct denode * -msdosfs_hashget(dev, dirclust, diroff) - dev_t dev; - u_long dirclust; - u_long diroff; +msdosfs_hashget(dev_t dev, u_long dirclust, u_long diroff) { struct thread *td = curthread; /* XXX */ struct denode *dep; @@ -167,8 +162,7 @@ loop: } static void -msdosfs_hashins(dep) - struct denode *dep; +msdosfs_hashins(struct denode *dep) { struct denode **depp, *deq; lwkt_tokref ilock; @@ -185,8 +179,7 @@ msdosfs_hashins(dep) } static void -msdosfs_hashrem(dep) - struct denode *dep; +msdosfs_hashrem(struct denode *dep) { struct denode *deq; lwkt_tokref ilock; @@ -216,11 +209,10 @@ msdosfs_hashrem(dep) * depp - returns the address of the gotten denode. */ int -deget(pmp, dirclust, diroffset, depp) - struct msdosfsmount *pmp; /* so we know the maj/min number */ - u_long dirclust; /* cluster this dir entry came from */ - u_long diroffset; /* index of entry within the cluster */ - struct denode **depp; /* returns the addr of the gotten denode */ +deget(struct msdosfsmount *pmp, /* so we know the maj/min number */ + u_long dirclust, /* cluster this dir entry came from */ + u_long diroffset, /* index of entry within the cluster */ + struct denode **depp) /* returns the addr of the gotten denode */ { struct thread *td = curthread; /* XXX */ int error; @@ -408,9 +400,7 @@ deget(pmp, dirclust, diroffset, depp) } int -deupdat(dep, waitfor) - struct denode *dep; - int waitfor; +deupdat(struct denode *dep, int waitfor) { int error; struct buf *bp; @@ -444,11 +434,7 @@ deupdat(dep, waitfor) * Truncate the file described by dep to the length specified by length. */ int -detrunc(dep, length, flags, td) - struct denode *dep; - u_long length; - int flags; - struct thread *td; +detrunc(struct denode *dep, u_long length, int flags, struct thread *td) { int error; int allerror; @@ -591,9 +577,7 @@ detrunc(dep, length, flags, td) * Extend the file described by dep to length specified by length. */ int -deextend(dep, length) - struct denode *dep; - u_long length; +deextend(struct denode *dep, u_long length) { struct msdosfsmount *pmp = dep->de_pmp; u_long count; @@ -638,8 +622,7 @@ deextend(dep, length) * been moved to a new directory. */ void -reinsert(dep) - struct denode *dep; +reinsert(struct denode *dep) { /* * Fix up the denode cache. If the denode is for a directory, @@ -655,11 +638,11 @@ reinsert(dep) msdosfs_hashins(dep); } +/* + * msdosfs_reclaim(struct vnode *a_vp) + */ int -msdosfs_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - } */ *ap; +msdosfs_reclaim(struct vop_reclaim_args *ap) { struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(vp); @@ -692,12 +675,11 @@ msdosfs_reclaim(ap) return (0); } +/* + * msdosfs_inactive(struct vnode *a_vp, struct thread *a_td) + */ int -msdosfs_inactive(ap) - struct vop_inactive_args /* { - struct vnode *a_vp; - struct thread *a_td; - } */ *ap; +msdosfs_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(vp); diff --git a/sys/vfs/msdosfs/msdosfs_fat.c b/sys/vfs/msdosfs/msdosfs_fat.c index bcb56e8966..41f0220ebc 100644 --- a/sys/vfs/msdosfs/msdosfs_fat.c +++ b/sys/vfs/msdosfs/msdosfs_fat.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_fat.c,v 1.23 2000/01/27 14:43:06 nyan Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_fat.c,v 1.5 2003/08/20 09:56:32 rob Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_fat.c,v 1.6 2004/04/17 00:30:17 cpressey Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.28 1997/11/17 15:36:49 ws Exp $ */ /*- @@ -99,12 +99,8 @@ static __inline void usemap_free (struct msdosfsmount *pmp, u_long cn); static void -fatblock(pmp, ofs, bnp, sizep, bop) - struct msdosfsmount *pmp; - u_long ofs; - u_long *bnp; - u_long *sizep; - u_long *bop; +fatblock(struct msdosfsmount *pmp, u_long ofs, u_long *bnp, u_long *sizep, + u_long *bop) { u_long bn, size; @@ -140,12 +136,11 @@ fatblock(pmp, ofs, bnp, sizep, bop) * If cnp is null, nothing is returned. */ int -pcbmap(dep, findcn, bnp, cnp, sp) - struct denode *dep; - u_long findcn; /* file relative cluster to get */ - daddr_t *bnp; /* returned filesys relative blk number */ - u_long *cnp; /* returned cluster number */ - int *sp; /* returned block size */ +pcbmap(struct denode *dep, + u_long findcn, /* file relative cluster to get */ + daddr_t *bnp, /* returned filesys relative blk number */ + u_long *cnp, /* returned cluster number */ + int *sp) /* returned block size */ { int error; u_long i; @@ -281,11 +276,7 @@ hiteof:; * for. */ static void -fc_lookup(dep, findcn, frcnp, fsrcnp) - struct denode *dep; - u_long findcn; - u_long *frcnp; - u_long *fsrcnp; +fc_lookup(struct denode *dep, u_long findcn, u_long *frcnp, u_long *fsrcnp) { int i; u_long cn; @@ -309,9 +300,7 @@ fc_lookup(dep, findcn, frcnp, fsrcnp) * relative cluster frcn and beyond. */ void -fc_purge(dep, frcn) - struct denode *dep; - u_int frcn; +fc_purge(struct denode *dep, u_int frcn) { int i; struct fatcache *fcp; @@ -333,10 +322,7 @@ fc_purge(dep, frcn) * fatbn - block number relative to begin of filesystem of the modified fat block. */ static void -updatefats(pmp, bp, fatbn) - struct msdosfsmount *pmp; - struct buf *bp; - u_long fatbn; +updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn) { int i; struct buf *bpn; @@ -438,9 +424,7 @@ updatefats(pmp, bp, fatbn) * */ static __inline void -usemap_alloc(pmp, cn) - struct msdosfsmount *pmp; - u_long cn; +usemap_alloc(struct msdosfsmount *pmp, u_long cn) { pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); @@ -448,9 +432,7 @@ usemap_alloc(pmp, cn) } static __inline void -usemap_free(pmp, cn) - struct msdosfsmount *pmp; - u_long cn; +usemap_free(struct msdosfsmount *pmp, u_long cn) { pmp->pm_freeclustercount++; @@ -458,10 +440,7 @@ usemap_free(pmp, cn) } int -clusterfree(pmp, cluster, oldcnp) - struct msdosfsmount *pmp; - u_long cluster; - u_long *oldcnp; +clusterfree(struct msdosfsmount *pmp, u_long cluster, u_long *oldcnp) { int error; u_long oldcn; @@ -502,12 +481,8 @@ clusterfree(pmp, cluster, oldcnp) * the msdosfsmount structure. This is left to the caller. */ int -fatentry(function, pmp, cn, oldcontents, newcontents) - int function; - struct msdosfsmount *pmp; - u_long cn; - u_long *oldcontents; - u_long newcontents; +fatentry(int function, struct msdosfsmount *pmp, u_long cn, u_long *oldcontents, + u_long newcontents) { int error; u_long readcn; @@ -610,11 +585,7 @@ fatentry(function, pmp, cn, oldcontents, newcontents) * fillwith - what to write into fat entry of last cluster */ static int -fatchain(pmp, start, count, fillwith) - struct msdosfsmount *pmp; - u_long start; - u_long count; - u_long fillwith; +fatchain(struct msdosfsmount *pmp, u_long start, u_long count, u_long fillwith) { int error; u_long bn, bo, bsize, byteoffset, readcn, newc; @@ -685,10 +656,7 @@ fatchain(pmp, start, count, fillwith) * count - maximum interesting length */ static int -chainlength(pmp, start, count) - struct msdosfsmount *pmp; - u_long start; - u_long count; +chainlength(struct msdosfsmount *pmp, u_long start, u_long count) { u_long idx, max_idx; u_int map; @@ -731,13 +699,8 @@ chainlength(pmp, start, count) * got - how many clusters were actually allocated. */ static int -chainalloc(pmp, start, count, fillwith, retcluster, got) - struct msdosfsmount *pmp; - u_long start; - u_long count; - u_long fillwith; - u_long *retcluster; - u_long *got; +chainalloc(struct msdosfsmount *pmp, u_long start, u_long count, + u_long fillwith, u_long *retcluster, u_long *got) { int error; u_long cl, n; @@ -771,13 +734,8 @@ chainalloc(pmp, start, count, fillwith, retcluster, got) * got - how many clusters were actually allocated. */ int -clusteralloc(pmp, start, count, fillwith, retcluster, got) - struct msdosfsmount *pmp; - u_long start; - u_long count; - u_long fillwith; - u_long *retcluster; - u_long *got; +clusteralloc(struct msdosfsmount *pmp, u_long start, u_long count, + u_long fillwith, u_long *retcluster, u_long *got) { u_long idx; u_long len, newst, foundl, cn, l; @@ -854,9 +812,7 @@ clusteralloc(pmp, start, count, fillwith, retcluster, got) * freed. */ int -freeclusterchain(pmp, cluster) - struct msdosfsmount *pmp; - u_long cluster; +freeclusterchain(struct msdosfsmount *pmp, u_long cluster) { int error; struct buf *bp = NULL; @@ -915,8 +871,7 @@ freeclusterchain(pmp, cluster) * found turn off its corresponding bit in the pm_inusemap. */ int -fillinusemap(pmp) - struct msdosfsmount *pmp; +fillinusemap(struct msdosfsmount *pmp) { struct buf *bp = NULL; u_long cn, readcn; @@ -981,12 +936,8 @@ fillinusemap(pmp) * field. This is left for the caller to do. */ int -extendfile(dep, count, bpp, ncp, flags) - struct denode *dep; - u_long count; - struct buf **bpp; - u_long *ncp; - int flags; +extendfile(struct denode *dep, u_long count, struct buf **bpp, u_long *ncp, + int flags) { int error; u_long frcn; diff --git a/sys/vfs/msdosfs/msdosfs_lookup.c b/sys/vfs/msdosfs/msdosfs_lookup.c index 386779966f..4645744006 100644 --- a/sys/vfs/msdosfs/msdosfs_lookup.c +++ b/sys/vfs/msdosfs/msdosfs_lookup.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_lookup.c,v 1.30.2.1 2000/11/03 15:55:39 bp Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_lookup.c,v 1.8 2004/03/01 06:33:21 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_lookup.c,v 1.9 2004/04/17 00:30:17 cpressey Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */ /*- @@ -77,14 +77,12 @@ * Then update the disk block and the denode, and then write the disk block * out to disk. This way disk blocks containing directory entries and in * memory denode's will be in synch. + * + * msdosfs_lookup(struct vnode *a_dvp, struct vnode **a_vpp, + * struct componentname *a_cnp) */ int -msdosfs_lookup(ap) - struct vop_cachedlookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +msdosfs_lookup(struct vop_cachedlookup_args *ap) { struct vnode *vdp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; @@ -563,11 +561,8 @@ foundroot: * cnp - componentname needed for Win95 long filenames */ int -createde(dep, ddep, depp, cnp) - struct denode *dep; - struct denode *ddep; - struct denode **depp; - struct componentname *cnp; +createde(struct denode *dep, struct denode *ddep, struct denode **depp, + struct componentname *cnp) { int error; u_long dirclust, diroffset; @@ -693,8 +688,7 @@ createde(dep, ddep, depp, cnp) * return 0 if not empty or error. */ int -dosdirempty(dep) - struct denode *dep; +dosdirempty(struct denode *dep) { int blsize; int error; @@ -770,9 +764,7 @@ dosdirempty(dep) * The target inode is always unlocked on return. */ int -doscheckpath(source, target) - struct denode *source; - struct denode *target; +doscheckpath(struct denode *source, struct denode *target) { daddr_t scn; struct msdosfsmount *pmp; @@ -859,11 +851,8 @@ out:; * directory entry within the block. */ int -readep(pmp, dirclust, diroffset, bpp, epp) - struct msdosfsmount *pmp; - u_long dirclust, diroffset; - struct buf **bpp; - struct direntry **epp; +readep(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, + struct buf **bpp, struct direntry **epp) { int error; daddr_t bn; @@ -890,12 +879,8 @@ readep(pmp, dirclust, diroffset, bpp, epp) * entry within the block. */ int -readde(dep, bpp, epp) - struct denode *dep; - struct buf **bpp; - struct direntry **epp; +readde(struct denode *dep, struct buf **bpp, struct direntry **epp) { - return (readep(dep->de_pmp, dep->de_dirclust, dep->de_diroffset, bpp, epp)); } @@ -909,9 +894,8 @@ readde(dep, bpp, epp) * msdosfs_reclaim() which will remove the denode from the denode cache. */ int -removede(pdep, dep) - struct denode *pdep; /* directory where the entry is removed */ - struct denode *dep; /* file to be removed */ +removede(struct denode *pdep, /* directory where the entry is removed */ + struct denode *dep) /* file to be removed */ { int error; struct direntry *ep; @@ -976,10 +960,7 @@ removede(pdep, dep) * Create a unique DOS name in dvp */ int -uniqdosname(dep, cnp, cp) - struct denode *dep; - struct componentname *cnp; - u_char *cp; +uniqdosname(struct denode *dep, struct componentname *cnp, u_char *cp) { struct msdosfsmount *pmp = dep->de_pmp; struct direntry *dentp; @@ -1050,8 +1031,7 @@ uniqdosname(dep, cnp, cp) * Find any Win'95 long filename entry in directory dep */ int -findwin95(dep) - struct denode *dep; +findwin95(struct denode *dep) { struct msdosfsmount *pmp = dep->de_pmp; struct direntry *dentp; diff --git a/sys/vfs/msdosfs/msdosfs_vfsops.c b/sys/vfs/msdosfs/msdosfs_vfsops.c index 30df423d98..6a4d668b4e 100644 --- a/sys/vfs/msdosfs/msdosfs_vfsops.c +++ b/sys/vfs/msdosfs/msdosfs_vfsops.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_vfsops.c,v 1.60.2.6 2002/09/12 21:33:38 trhodes Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.11 2004/03/01 06:33:21 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.12 2004/04/17 00:30:17 cpressey Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -103,9 +103,7 @@ static int msdosfs_unmount (struct mount *, int, struct thread *); static int msdosfs_vptofh (struct vnode *, struct fid *); static int -update_mp(mp, argp) - struct mount *mp; - struct msdosfs_args *argp; +update_mp(struct mount *mp, struct msdosfs_args *argp) { struct msdosfsmount *pmp = VFSTOMSDOSFS(mp); int error; @@ -157,7 +155,7 @@ update_mp(mp, argp) #ifndef __DragonFly__ int -msdosfs_mountroot() +msdosfs_mountroot(void) { struct mount *mp; struct thread *td = curthread; /* XXX */ @@ -223,12 +221,8 @@ msdosfs_mountroot() * special file to treat as a filesystem. */ static int -msdosfs_mount(mp, path, data, ndp, td) - struct mount *mp; - char *path; - caddr_t data; - struct nameidata *ndp; - struct thread *td; +msdosfs_mount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, + struct thread *td) { struct vnode *devvp; /* vnode for blk device to mount */ struct msdosfs_args args; /* will hold data from mount request */ @@ -363,11 +357,8 @@ msdosfs_mount(mp, path, data, ndp, td) } static int -mountmsdosfs(devvp, mp, td, argp) - struct vnode *devvp; - struct mount *mp; - struct thread *td; - struct msdosfs_args *argp; +mountmsdosfs(struct vnode *devvp, struct mount *mp, struct thread *td, + struct msdosfs_args *argp) { struct msdosfsmount *pmp; struct buf *bp; @@ -753,10 +744,7 @@ error_exit: * Unmount the filesystem described by mp. */ static int -msdosfs_unmount(mp, mntflags, td) - struct mount *mp; - int mntflags; - struct thread *td; +msdosfs_unmount(struct mount *mp, int mntflags, struct thread *td) { struct msdosfsmount *pmp; int error, flags; @@ -803,9 +791,7 @@ msdosfs_unmount(mp, mntflags, td) } static int -msdosfs_root(mp, vpp) - struct mount *mp; - struct vnode **vpp; +msdosfs_root(struct mount *mp, struct vnode **vpp) { struct msdosfsmount *pmp = VFSTOMSDOSFS(mp); struct denode *ndep; @@ -822,10 +808,7 @@ msdosfs_root(mp, vpp) } static int -msdosfs_statfs(mp, sbp, td) - struct mount *mp; - struct statfs *sbp; - struct thread *td; +msdosfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) { struct msdosfsmount *pmp; @@ -857,10 +840,7 @@ static int msdosfs_sync_scan(struct mount *mp, struct vnode *vp, lwkt_tokref_t vlock, void *data); static int -msdosfs_sync(mp, waitfor, td) - struct mount *mp; - int waitfor; - struct thread *td; +msdosfs_sync(struct mount *mp, int waitfor, struct thread *td) { struct msdosfsmount *pmp = VFSTOMSDOSFS(mp); struct scaninfo scaninfo; @@ -900,8 +880,9 @@ msdosfs_sync(mp, waitfor, td) return (scaninfo.allerror); } -static int msdosfs_sync_scan(struct mount *mp, struct vnode *vp, - lwkt_tokref_t vlock, void *data) +static int +msdosfs_sync_scan(struct mount *mp, struct vnode *vp, + lwkt_tokref_t vlock, void *data) { struct scaninfo *info = data; struct denode *dep; @@ -929,10 +910,7 @@ static int msdosfs_sync_scan(struct mount *mp, struct vnode *vp, } static int -msdosfs_fhtovp(mp, fhp, vpp) - struct mount *mp; - struct fid *fhp; - struct vnode **vpp; +msdosfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) { struct msdosfsmount *pmp = VFSTOMSDOSFS(mp); struct defid *defhp = (struct defid *) fhp; @@ -949,11 +927,8 @@ msdosfs_fhtovp(mp, fhp, vpp) } static int -msdosfs_checkexp(mp, nam, exflagsp, credanonp) - struct mount *mp; - struct sockaddr *nam; - int *exflagsp; - struct ucred **credanonp; +msdosfs_checkexp(struct mount *mp, struct sockaddr *nam, int *exflagsp, + struct ucred **credanonp) { struct msdosfsmount *pmp = VFSTOMSDOSFS(mp); struct netcred *np; @@ -967,9 +942,7 @@ msdosfs_checkexp(mp, nam, exflagsp, credanonp) } static int -msdosfs_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; +msdosfs_vptofh(struct vnode *vp, struct fid *fhp) { struct denode *dep; struct defid *defhp; diff --git a/sys/vfs/msdosfs/msdosfs_vnops.c b/sys/vfs/msdosfs/msdosfs_vnops.c index 2b65237bce..4ca8546ed0 100644 --- a/sys/vfs/msdosfs/msdosfs_vnops.c +++ b/sys/vfs/msdosfs/msdosfs_vnops.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_vnops.c,v 1.95.2.4 2003/06/13 15:05:47 trhodes Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.14 2004/04/14 01:24:24 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.15 2004/04/17 00:30:17 cpressey Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -128,15 +128,12 @@ static int msdosfs_putpages (struct vop_putpages_args *); * created is locked. We must release before we return. We must also free * the pathname buffer pointed at by cnp->cn_pnbuf, always on error, or * only if the SAVESTART bit in cn_flags is clear on success. + * + * msdosfs_create(struct vnode *a_dvp, struct vnode **a_vpp, + * struct componentname *a_cnp, struct vattr *a_vap) */ static int -msdosfs_create(ap) - struct vop_create_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; +msdosfs_create(struct vop_create_args *ap) { struct componentname *cnp = ap->a_cnp; struct denode ndirent; @@ -196,16 +193,13 @@ bad: return (error); } +/* + * msdosfs_mknod(struct vnode *a_dvp, struct vnode **a_vpp, + * struct componentname *a_cnp, struct vattr *a_vap) + */ static int -msdosfs_mknod(ap) - struct vop_mknod_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; +msdosfs_mknod(struct vop_mknod_args *ap) { - switch (ap->a_vap->va_type) { case VDIR: return (msdosfs_mkdir((struct vop_mkdir_args *)ap)); @@ -221,14 +215,12 @@ msdosfs_mknod(ap) /* NOTREACHED */ } +/* + * msdosfs_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred, + * struct thread *a_td) + */ static int -msdosfs_close(ap) - struct vop_close_args /* { - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +msdosfs_close(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(vp); @@ -246,14 +238,12 @@ msdosfs_close(ap) return 0; } +/* + * msdosfs_access(struct vnode *a_vp, int a_mode, struct ucred *a_cred, + * struct thread *a_td) + */ static int -msdosfs_access(ap) - struct vop_access_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +msdosfs_access(struct vop_access_args *ap) { struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(ap->a_vp); @@ -324,14 +314,12 @@ msdosfs_access(ap) return (file_mode & mask) == mask ? 0 : EACCES; } +/* + * msdosfs_getattr(struct vnode *a_vp, struct vattr *a_vap, + * struct ucred *a_cred, struct thread *a_td) + */ static int -msdosfs_getattr(ap) - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +msdosfs_getattr(struct vop_getattr_args *ap) { struct denode *dep = VTODE(ap->a_vp); struct msdosfsmount *pmp = dep->de_pmp; @@ -390,14 +378,12 @@ msdosfs_getattr(ap) return (0); } +/* + * msdosfs_setattr(struct vnode *a_vp, struct vattr *a_vap, + * struct ucred *a_cred, struct thread *a_td) + */ static int -msdosfs_setattr(ap) - struct vop_setattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +msdosfs_setattr(struct vop_setattr_args *ap) { struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(ap->a_vp); @@ -550,14 +536,12 @@ msdosfs_setattr(ap) return (deupdat(dep, 1)); } +/* + * msdosfs_read(struct vnode *a_vp, struct uio *a_uio, int a_ioflag, + * struct ucred *a_cred) + */ static int -msdosfs_read(ap) - struct vop_read_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; +msdosfs_read(struct vop_read_args *ap) { int error = 0; int blsize; @@ -645,15 +629,12 @@ msdosfs_read(ap) /* * Write data to a file or directory. + * + * msdosfs_write(struct vnode *a_vp, struct uio *a_uio, int a_ioflag, + * struct ucred *a_cred) */ static int -msdosfs_write(ap) - struct vop_write_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; +msdosfs_write(struct vop_write_args *ap) { int n; int croffset; @@ -850,15 +831,12 @@ errexit: * * This function is worthless for vnodes that represent directories. Maybe we * could just do a sync if they try an fsync on a directory file. + * + * msdosfs_fsync(struct vnode *a_vp, struct ucred *a_cred, int a_waitfor, + * struct thread *a_td) */ static int -msdosfs_fsync(ap) - struct vop_fsync_args /* { - struct vnode *a_vp; - struct ucred *a_cred; - int a_waitfor; - struct thread *a_td; - } */ *ap; +msdosfs_fsync(struct vop_fsync_args *ap) { struct vnode *vp = ap->a_vp; int s; @@ -894,13 +872,12 @@ loop: return (deupdat(VTODE(vp), ap->a_waitfor == MNT_WAIT)); } +/* + * msdosfs_remove(struct vnode *a_dvp, struct vnode *a_vp, + * struct componentname *a_cnp) + */ static int -msdosfs_remove(ap) - struct vop_remove_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; +msdosfs_remove(struct vop_remove_args *ap) { struct denode *dep = VTODE(ap->a_vp); struct denode *ddep = VTODE(ap->a_dvp); @@ -920,14 +897,12 @@ msdosfs_remove(ap) * DOS filesystems don't know what links are. But since we already called * msdosfs_lookup() with create and lockparent, the parent is locked so we * have to free it before we return the error. + * + * msdosfs_link(struct vnode *a_tdvp, struct vnode *a_vp, + * struct componentname *a_cnp) */ static int -msdosfs_link(ap) - struct vop_link_args /* { - struct vnode *a_tdvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; +msdosfs_link(struct vop_link_args *ap) { return (EOPNOTSUPP); } @@ -982,17 +957,13 @@ msdosfs_link(ap) * I'm not sure how the memory containing the pathnames pointed at by the * componentname structures is freed, there may be some memory bleeding * for each rename done. + * + * msdosfs_rename(struct vnode *a_fdvp, struct vnode *a_fvp, + * struct componentname *a_fcnp, struct vnode *a_tdvp, + * struct vnode *a_tvp, struct componentname *a_tcnp) */ static int -msdosfs_rename(ap) - struct vop_rename_args /* { - struct vnode *a_fdvp; - struct vnode *a_fvp; - struct componentname *a_fcnp; - struct vnode *a_tdvp; - struct vnode *a_tvp; - struct componentname *a_tcnp; - } */ *ap; +msdosfs_rename(struct vop_rename_args *ap) { struct vnode *tdvp = ap->a_tdvp; struct vnode *fvp = ap->a_fvp; @@ -1329,14 +1300,12 @@ static struct { } }; +/* + * msdosfs_mkdir(struct vnode *a_dvp, struct vnode **a_vpp, + * struct componentname *a_cnp, struct vattr *a_vap) + */ static int -msdosfs_mkdir(ap) - struct vop_mkdir_args /* { - struct vnode *a_dvp; - struvt vnode **a_vpp; - struvt componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; +msdosfs_mkdir(struct vop_mkdir_args *ap) { struct componentname *cnp = ap->a_cnp; struct denode *dep; @@ -1442,13 +1411,12 @@ bad2: return (error); } +/* + * msdosfs_rmdir(struct vnode *a_dvp, struct vnode *a_vp, + * struct componentname *a_cnp) + */ static int -msdosfs_rmdir(ap) - struct vop_rmdir_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; +msdosfs_rmdir(struct vop_rmdir_args *ap) { struct vnode *vp = ap->a_vp; struct vnode *dvp = ap->a_dvp; @@ -1503,30 +1471,24 @@ out: /* * DOS filesystems don't know what symlinks are. + * + * msdosfs_symlink(struct vnode *a_dvp, struct vnode **a_vpp, + * struct componentname *a_cnp, struct vattr *a_vap, + * char *a_target) */ static int -msdosfs_symlink(ap) - struct vop_symlink_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - char *a_target; - } */ *ap; +msdosfs_symlink(struct vop_symlink_args *ap) { return (EOPNOTSUPP); } +/* + * msdosfs_readdir(struct vnode *a_vp, struct uio *a_uio, + * struct ucred *a_cred, int *a_eofflag, int *a_ncookies, + * u_long **a_cookies) + */ static int -msdosfs_readdir(ap) - struct vop_readdir_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - int *a_eofflag; - int *a_ncookies; - u_long **a_cookies; - } */ *ap; +msdosfs_readdir(struct vop_readdir_args *ap) { int error = 0; int diff; @@ -1790,17 +1752,12 @@ out: * vpp - returns the vnode for the block special file holding the filesystem * containing the file of interest * bnp - address of where to return the filesystem relative block number + * + * msdosfs_bmap(struct vnode *a_vp, daddr_t a_bn, struct vnode **a_vpp, + * daddr_t *a_bnp, int *a_runp, int *a_runb) */ static int -msdosfs_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; +msdosfs_bmap(struct vop_bmap_args *ap) { struct denode *dep = VTODE(ap->a_vp); @@ -1820,12 +1777,11 @@ msdosfs_bmap(ap) return (pcbmap(dep, ap->a_bn, ap->a_bnp, 0, 0)); } +/* + * msdosfs_strategy(struct vnode *a_vp, struct buf *a_bp) + */ static int -msdosfs_strategy(ap) - struct vop_strategy_args /* { - struct vnode *a_vp; - struct buf *a_bp; - } */ *ap; +msdosfs_strategy(struct vop_strategy_args *ap) { struct buf *bp = ap->a_bp; struct denode *dep = VTODE(bp->b_vp); @@ -1865,11 +1821,11 @@ msdosfs_strategy(ap) return (0); } +/* + * msdosfs_print(struct vnode *vp) + */ static int -msdosfs_print(ap) - struct vop_print_args /* { - struct vnode *vp; - } */ *ap; +msdosfs_print(struct vop_print_args *ap) { struct denode *dep = VTODE(ap->a_vp); @@ -1882,13 +1838,11 @@ msdosfs_print(ap) return (0); } +/* + * msdosfs_pathconf(struct vnode *a_vp, int a_name, int *a_retval) + */ static int -msdosfs_pathconf(ap) - struct vop_pathconf_args /* { - struct vnode *a_vp; - int a_name; - int *a_retval; - } */ *ap; +msdosfs_pathconf(struct vop_pathconf_args *ap) { struct msdosfsmount *pmp = VTODE(ap->a_vp)->de_pmp; @@ -1921,8 +1875,7 @@ msdosfs_pathconf(ap) * XXX has been). */ int -msdosfs_getpages(ap) - struct vop_getpages_args *ap; +msdosfs_getpages(struct vop_getpages_args *ap) { return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_reqpage); @@ -1935,8 +1888,7 @@ msdosfs_getpages(ap) * XXX has been). */ int -msdosfs_putpages(ap) - struct vop_putpages_args *ap; +msdosfs_putpages(struct vop_putpages_args *ap) { return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_sync, ap->a_rtvals); -- 2.41.0