Stylistic changes in comments/strings:

"FAT" and "fat" are different things, use the appropriate case.
"GEMDOS" is all caps.
This commit is contained in:
jakllsch 2012-11-04 17:57:59 +00:00
parent 1467a3f336
commit 48958e522b
8 changed files with 76 additions and 76 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bootsect.h,v 1.4 2006/08/14 14:06:26 gdt Exp $ */
/* $NetBSD: bootsect.h,v 1.5 2012/11/04 17:57:59 jakllsch Exp $ */
/*
* Written by Paul Popelka (paulp@uts.amdahl.com)
@ -70,7 +70,7 @@ struct bootsector710 {
};
#ifdef atari
/*
* The boot sector on a gemdos fs is a little bit different from the msdos fs
* The boot sector on a GEMDOS FS is a little bit different from the MSDOS FS
* format. Currently there is no need to declare a separate structure, the
* bootsector33 struct will do.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: bpb.h,v 1.6 2007/01/27 07:18:10 cbiere Exp $ */
/* $NetBSD: bpb.h,v 1.7 2012/11/04 17:57:59 jakllsch Exp $ */
/*
* Written by Paul Popelka (paulp@uts.amdahl.com)
@ -85,7 +85,7 @@ struct bpb710 {
#ifdef atari
/*
* BPB for gemdos filesystems. Atari leaves the obsolete stuff undefined.
* BPB for GEMDOS filesystems. Atari leaves the obsolete stuff undefined.
* Currently there is no need for a separate BPB structure.
*/
#if 0
@ -96,7 +96,7 @@ struct bpb_a {
u_int8_t bpbFATs; /* number of FATs */
u_int16_t bpbRootDirEnts; /* number of root directory entries */
u_int16_t bpbSectors; /* total number of sectors */
u_int8_t bpbUseless1; /* meaningless on gemdos fs */
u_int8_t bpbUseless1; /* meaningless on GEMDOS FS */
u_int16_t bpbFATsecs; /* number of sectors per FAT */
u_int16_t bpbUseless2; /* meaningless for harddisk fs */
u_int16_t bpbUseless3; /* meaningless for harddisk fs */

View File

@ -1,4 +1,4 @@
/* $NetBSD: denode.h,v 1.19 2011/04/04 19:16:58 hannken Exp $ */
/* $NetBSD: denode.h,v 1.20 2012/11/04 17:57:59 jakllsch Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -101,7 +101,7 @@
#define MSDOSFSROOT_OFS 0x1fffffff
/*
* The fat cache structure. fc_fsrcn is the filesystem relative cluster
* The FAT cache structure. fc_fsrcn is the filesystem relative cluster
* number that corresponds to the file relative cluster number in this
* structure (fc_frcn).
*/
@ -111,11 +111,11 @@ struct fatcache {
};
/*
* The fat entry cache as it stands helps make extending files a "quick"
* operation by avoiding having to scan the fat to discover the last
* The FAT entry cache as it stands helps make extending files a "quick"
* operation by avoiding having to scan the FAT to discover the last
* cluster of the file. The cache also helps sequential reads by
* remembering the last cluster read from the file. This also prevents us
* from having to rescan the fat to find the next cluster to read. This
* from having to rescan the FAT to find the next cluster to read. This
* cache is probably pretty worthless if a file is opened by multiple
* processes.
*/
@ -128,7 +128,7 @@ struct fatcache {
#define FCE_EMPTY 0xffffffff /* doesn't represent an actual cluster # */
/*
* Set a slot in the fat cache.
* Set a slot in the FAT cache.
*/
#define fc_setcache(dep, slot, frcn, fsrcn) \
(dep)->de_fc[slot].fc_frcn = frcn; \
@ -169,7 +169,7 @@ struct denode {
u_short de_MDate; /* modification date */
u_long de_StartCluster; /* starting cluster of file */
u_long de_FileSize; /* size of file in bytes */
struct fatcache de_fc[FC_SIZE]; /* fat cache */
struct fatcache de_fc[FC_SIZE]; /* FAT cache */
};
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: fat.h,v 1.6 2012/11/04 17:35:27 jakllsch Exp $ */
/* $NetBSD: fat.h,v 1.7 2012/11/04 17:57:59 jakllsch Exp $ */
/*-
* Copyright (C) 1994, 1997 Wolfgang Solfrank.
@ -68,13 +68,13 @@
/*
* MSDOSFS:
* Return true if filesystem uses 12 bit fats. Microsoft Programmer's
* Return true if filesystem uses 12 bit FATs. Microsoft Programmer's
* Reference says if the maximum cluster number in a filesystem is greater
* than 4084 ((CLUST_RSRVD - CLUST_FIRST) & FAT12_MASK) then we've got a
* 16 bit fat filesystem. While mounting, the result of this test is stored
* 16 bit FAT filesystem. While mounting, the result of this test is stored
* in pm_fatentrysize.
* GEMDOS-flavour (atari):
* If the filesystem is on floppy we've got a 12 bit fat filesystem, otherwise
* If the filesystem is on floppy we've got a 12 bit FAT filesystem, otherwise
* 16 bit. We check the d_type field in the disklabel struct while mounting
* and store the result in the pm_fatentrysize. Note that this kind of
* detection gets flakey when mounting a vnd-device.
@ -97,8 +97,8 @@
* These are the values for the function argument to the function
* fatentry().
*/
#define FAT_GET 0x0001 /* get a fat entry */
#define FAT_SET 0x0002 /* set a fat entry */
#define FAT_GET 0x0001 /* get a FAT entry */
#define FAT_SET 0x0002 /* set a FAT entry */
#define FAT_GET_AND_SET (FAT_GET | FAT_SET)
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_denode.c,v 1.46 2011/06/16 09:21:02 hannken Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.47 2012/11/04 17:57:59 jakllsch Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.46 2011/06/16 09:21:02 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.47 2012/11/04 17:57:59 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -348,7 +348,7 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, struct denode
ldep->de_dev = pmp->pm_dev;
ldep->de_dirclust = dirclust;
ldep->de_diroffset = diroffset;
fc_purge(ldep, 0); /* init the fat cache for this denode */
fc_purge(ldep, 0); /* init the FAT cache for this denode */
/*
* Insert the denode into the hash queue and lock the denode so it

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_fat.c,v 1.20 2012/04/09 11:10:06 hannken Exp $ */
/* $NetBSD: msdosfs_fat.c,v 1.21 2012/11/04 17:57:59 jakllsch Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.20 2012/04/09 11:10:06 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.21 2012/11/04 17:57:59 jakllsch Exp $");
/*
* kernel include files.
@ -226,8 +226,8 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp, u_long *cnp, int *sp)
*sp = pmp->pm_bpcluster;
/*
* Rummage around in the fat cache, maybe we can avoid tromping
* thru every fat entry for the file. And, keep track of how far
* Rummage around in the FAT cache, maybe we can avoid tromping
* thru every FAT entry for the file. And, keep track of how far
* off the cache was from where we wanted to be.
*/
i = 0;
@ -309,13 +309,13 @@ hiteof:;
*cnp = i;
if (bp)
brelse(bp, 0);
/* update last file cluster entry in the fat cache */
/* update last file cluster entry in the FAT cache */
fc_setcache(dep, FC_LASTFC, i - 1, prevcn);
return (E2BIG);
}
/*
* Find the closest entry in the fat cache to the cluster we are looking
* Find the closest entry in the FAT cache to the cluster we are looking
* for.
*/
void
@ -339,7 +339,7 @@ fc_lookup(struct denode *dep, u_long findcn, u_long *frcnp, u_long *fsrcnp)
}
/*
* Purge the fat cache in denode dep of all entries relating to file
* Purge the FAT cache in denode dep of all entries relating to file
* relative cluster frcn and beyond.
*/
void
@ -356,13 +356,13 @@ fc_purge(struct denode *dep, u_int frcn)
}
/*
* Update the fat.
* If mirroring the fat, update all copies, with the first copy as last.
* Else update only the current fat (ignoring the others).
* Update the FAT.
* If mirroring the FAT, update all copies, with the first copy as last.
* Else update only the current FAT (ignoring the others).
*
* pmp - msdosfsmount structure for filesystem to update
* bp - addr of modified fat block
* fatbn - block number relative to begin of filesystem of the modified fat block.
* bp - addr of modified FAT block
* fatbn - block number relative to begin of filesystem of the modified FAT block.
*/
void
updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn)
@ -421,11 +421,11 @@ updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn)
if (pmp->pm_flags & MSDOSFS_FATMIRROR) {
/*
* Now copy the block(s) of the modified fat to the other copies of
* the fat and write them out. This is faster than reading in the
* other fats and then writing them back out. This could tie up
* the fat for quite a while. Preventing others from accessing it.
* To prevent us from going after the fat quite so much we use
* Now copy the block(s) of the modified FAT to the other copies of
* the FAT and write them out. This is faster than reading in the
* other FATs and then writing them back out. This could tie up
* the FAT for quite a while. Preventing others from accessing it.
* To prevent us from going after the FAT quite so much we use
* delayed writes, unless they specified "synchronous" when the
* filesystem was mounted. If synch is asked for then use
* bwrite()'s and really slow things down.
@ -444,7 +444,7 @@ updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn)
}
/*
* Write out the first (or current) fat last.
* Write out the first (or current) FAT last.
*/
if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT)
bwrite(bp);
@ -456,7 +456,7 @@ updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn)
}
/*
* Updating entries in 12 bit fats is a pain in the butt.
* Updating entries in 12 bit FATs is a pain in the butt.
*
* The following picture shows where nibbles go when moving from a 12 bit
* cluster number into the appropriate bytes in the FAT.
@ -513,21 +513,21 @@ clusterfree(struct msdosfsmount *pmp, u_long cluster, u_long *oldcnp)
}
/*
* Get or Set or 'Get and Set' the cluster'th entry in the fat.
* Get or Set or 'Get and Set' the cluster'th entry in the FAT.
*
* function - whether to get or set a fat entry
* pmp - address of the msdosfsmount structure for the filesystem
* whose fat is to be manipulated.
* whose FAT is to be manipulated.
* cn - which cluster is of interest
* oldcontents - address of a word that is to receive the contents of the
* cluster'th entry if this is a get function
* newcontents - the new value to be written into the cluster'th element of
* the fat if this is a set function.
* the FAT if this is a set function.
*
* This function can also be used to free a cluster by setting the fat entry
* This function can also be used to free a cluster by setting the FAT entry
* for a cluster to 0.
*
* All copies of the fat are updated if this is a set function. NOTE: If
* All copies of the FAT are updated if this is a set function. NOTE: If
* fatentry() marks a cluster as free it does not update the inusemap in
* the msdosfsmount structure. This is left to the caller.
*/
@ -606,7 +606,7 @@ fatentry(int function, struct msdosfsmount *pmp, u_long cn, u_long *oldcontents,
case FAT32_MASK:
/*
* According to spec we have to retain the
* high order bits of the fat entry.
* high order bits of the FAT entry.
*/
readcn = getulong((char *)bp->b_data + bo);
readcn &= ~FAT32_MASK;
@ -629,7 +629,7 @@ fatentry(int function, struct msdosfsmount *pmp, u_long cn, u_long *oldcontents,
* pmp - mount point
* start - first cluster of chain
* count - number of clusters in chain
* fillwith - what to write into fat entry of last cluster
* fillwith - what to write into FAT entry of last cluster
*/
static int
fatchain(struct msdosfsmount *pmp, u_long start, u_long count, u_long fillwith)
@ -740,7 +740,7 @@ chainlength(struct msdosfsmount *pmp, u_long start, u_long count)
* pmp - mount point.
* start - start of cluster chain.
* count - number of clusters to allocate.
* fillwith - put this value into the fat entry for the
* fillwith - put this value into the FAT entry for the
* last allocated cluster.
* retcluster - put the first allocated cluster's number here.
* got - how many clusters were actually allocated.
@ -772,7 +772,7 @@ chainalloc(struct msdosfsmount *pmp, u_long start, u_long count, u_long fillwith
* pmp - mount point.
* start - preferred start of cluster chain.
* count - number of clusters requested.
* fillwith - put this value into the fat entry for the
* fillwith - put this value into the FAT entry for the
* last allocated cluster.
* retcluster - put the first allocated cluster's number here.
* got - how many clusters were actually allocated.
@ -919,7 +919,7 @@ freeclusterchain(struct msdosfsmount *pmp, u_long cluster)
}
/*
* Read in fat blocks looking for free clusters. For every free cluster
* Read in FAT blocks looking for free clusters. For every free cluster
* found turn off its corresponding bit in the pm_inusemap.
*/
int
@ -931,7 +931,7 @@ fillinusemap(struct msdosfsmount *pmp)
u_long bn, bo, bsize, byteoffset;
/*
* Mark all clusters in use, we mark the free ones in the fat scan
* Mark all clusters in use, we mark the free ones in the FAT scan
* loop further down.
*/
for (cn = 0; cn < (pmp->pm_maxcluster + N_INUSEBITS) / N_INUSEBITS; cn++)
@ -939,7 +939,7 @@ fillinusemap(struct msdosfsmount *pmp)
/*
* Figure how many free clusters are in the filesystem by ripping
* through the fat counting the number of entries whose content is
* through the FAT counting the number of entries whose content is
* zero. These represent free clusters.
*/
pmp->pm_freeclustercount = 0;
@ -1070,7 +1070,7 @@ extendfile(struct denode *dep, u_long count, struct buf **bpp, u_long *ncp, int
/*
* Update the "last cluster of the file" entry in the
* denode's fat cache.
* denode's FAT cache.
*/
fc_setcache(dep, FC_LASTFC, frcn + got - 1, cn + got - 1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_vfsops.c,v 1.99 2012/11/04 17:18:56 jakllsch Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.100 2012/11/04 17:57:59 jakllsch Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.99 2012/11/04 17:18:56 jakllsch Exp $");
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.100 2012/11/04 17:57:59 jakllsch Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -104,7 +104,7 @@ int msdosfs_mountfs(struct vnode *, struct mount *, struct lwp *,
static int update_mp(struct mount *, struct msdosfs_args *);
MALLOC_JUSTDEFINE(M_MSDOSFSMNT, "MSDOSFS mount", "MSDOS FS mount structure");
MALLOC_JUSTDEFINE(M_MSDOSFSFAT, "MSDOSFS fat", "MSDOS FS fat table");
MALLOC_JUSTDEFINE(M_MSDOSFSFAT, "MSDOSFS FAT", "MSDOS FS FAT table");
MALLOC_JUSTDEFINE(M_MSDOSFSTMP, "MSDOSFS temp", "MSDOS FS temp. structures");
#define ROOTNAME "root_device"
@ -506,7 +506,7 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd
if (argp->flags & MSDOSFSMNT_GEMDOSFS) {
bsize = secsize;
if (bsize != 512) {
DPRINTF(("Invalid block bsize %d for gemdos\n", bsize));
DPRINTF(("Invalid block bsize %d for GEMDOS\n", bsize));
error = EINVAL;
goto error_exit;
}
@ -604,9 +604,9 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd
if (argp->flags & MSDOSFSMNT_GEMDOSFS) {
if (FAT32(pmp)) {
DPRINTF(("fat32 for gemdos\n"));
DPRINTF(("FAT32 for GEMDOS\n"));
/*
* GEMDOS doesn't know fat32.
* GEMDOS doesn't know FAT32.
*/
error = EINVAL;
goto error_exit;
@ -625,12 +625,12 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd
|| (pmp->pm_HugeSectors == 0)
|| (pmp->pm_HugeSectors * (pmp->pm_BytesPerSec / bsize)
> psize)) {
DPRINTF(("consistency checks for gemdos\n"));
DPRINTF(("consistency checks for GEMDOS\n"));
error = EINVAL;
goto error_exit;
}
/*
* XXX - Many parts of the msdos fs driver seem to assume that
* XXX - Many parts of the msdosfs driver seem to assume that
* the number of bytes per logical sector (BytesPerSec) will
* always be the same as the number of bytes per disk block
* Let's pretend it is.
@ -687,7 +687,7 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd
<= ((CLUST_RSRVD - CLUST_FIRST) & FAT12_MASK)) {
/*
* This will usually be a floppy disk. This size makes
* sure that one fat entry will not be split across
* sure that one FAT entry will not be split across
* multiple blocks.
*/
pmp->pm_fatmask = FAT12_MASK;
@ -792,9 +792,9 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd
}
/*
* If they want fat updates to be synchronous then let them suffer
* If they want FAT updates to be synchronous then let them suffer
* the performance degradation in exchange for the on disk copy of
* the fat being correct just about all the time. I suppose this
* the FAT being correct just about all the time. I suppose this
* would be a good thing to turn on if the kernel is still flakey.
*/
if (mp->mnt_flag & MNT_SYNCHRONOUS)
@ -947,14 +947,14 @@ msdosfs_sync(struct mount *mp, int waitfor, kauth_cred_t cred)
int error, allerror = 0;
/*
* If we ever switch to not updating all of the fats all the time,
* If we ever switch to not updating all of the FATs all the time,
* this would be the place to update them from the first one.
*/
if (pmp->pm_fmod != 0) {
if (pmp->pm_flags & MSDOSFSMNT_RONLY)
panic("msdosfs_sync: rofs mod");
else {
/* update fats here */
/* update FATs here */
}
}
/* Allocate a marker vnode. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfsmount.h,v 1.16 2012/02/03 04:29:17 joerg Exp $ */
/* $NetBSD: msdosfsmount.h,v 1.17 2012/11/04 17:57:59 jakllsch Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -74,7 +74,7 @@ struct msdosfs_args {
#define MSDOSFSMNT_SHORTNAME 1 /* Force old DOS short names only */
#define MSDOSFSMNT_LONGNAME 2 /* Force Win'95 long names */
#define MSDOSFSMNT_NOWIN95 4 /* Completely ignore Win95 entries */
#define MSDOSFSMNT_GEMDOSFS 8 /* This is a gemdos-flavour */
#define MSDOSFSMNT_GEMDOSFS 8 /* This is a GEMDOS-flavour */
#define MSDOSFSMNT_VERSIONED 16 /* Struct is versioned */
/* All flags above: */
@ -98,7 +98,7 @@ MALLOC_DECLARE(M_MSDOSFSTMP);
#endif
/*
* Layout of the mount control block for a msdos file system.
* Layout of the mount control block for a MSDOSFS file system.
*/
struct msdosfsmount {
struct mount *pm_mountp;/* vfs mount struct for this fs */
@ -112,7 +112,7 @@ struct msdosfsmount {
int pm_gmtoff; /* offset from UTC in seconds */
struct vnode *pm_devvp; /* vnode for block device mntd */
struct bpb50 pm_bpb; /* BIOS parameter blk for this fs */
u_long pm_FATsecs; /* actual number of fat sectors */
u_long pm_FATsecs; /* actual number of FAT sectors */
u_long pm_fatblk; /* sector # of first FAT */
u_long pm_rootdirblk; /* sector # (cluster # for FAT32) of root directory number */
u_long pm_rootdirsize; /* size in sectors (not clusters) */
@ -125,15 +125,15 @@ struct msdosfsmount {
u_long pm_bnshift; /* shift file offset right this amount to get a sector number */
u_long pm_bpcluster; /* bytes per cluster */
u_long pm_fmod; /* ~0 if fs is modified, this can rollover to 0 */
u_long pm_fatblocksize; /* size of fat blocks in bytes */
u_long pm_fatblocksec; /* size of fat blocks in sectors */
u_long pm_fatsize; /* size of fat in bytes */
u_long pm_fatmask; /* mask to use for fat numbers */
u_long pm_fatblocksize; /* size of FAT blocks in bytes */
u_long pm_fatblocksec; /* size of FAT blocks in sectors */
u_long pm_fatsize; /* size of FAT in bytes */
u_long pm_fatmask; /* mask to use for FAT numbers */
u_long pm_fsinfo; /* fsinfo block number */
u_long pm_nxtfree; /* next free cluster in fsinfo block */
u_int pm_fatmult; /* these 2 values are used in fat */
u_int pm_fatmult; /* these 2 values are used in FAT */
u_int pm_fatdiv; /* offset computation */
u_int pm_curfat; /* current fat for FAT32 (0 otherwise) */
u_int pm_curfat; /* current FAT for FAT32 (0 otherwise) */
u_int *pm_inusemap; /* ptr to bitmap of in-use clusters */
u_int pm_flags; /* see below */
};