diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-12-15 03:04:25 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-12-15 03:04:25 +0000 |
commit | f91f289a9a5472f63706904a6bf5ecec00b89cc4 (patch) | |
tree | b62de464f27b805f7095b0f402efd43addec567a | |
parent | aca2338790665caf3f78618178ddb3f6e82371de (diff) |
Nuke GEMDOSFS. Unused part of unused atari port. Simplifies
MSDOSFS code. Eliminates -G option to mount_msdos.
Nit detection by gwk@, tom@, jmc@.
ok weingart@ tom@ thib@ dlg@ deraadt@
-rw-r--r-- | lib/libc/sys/mount.2 | 3 | ||||
-rw-r--r-- | sbin/mount/mount.c | 6 | ||||
-rw-r--r-- | sbin/mount_msdos/mount_msdos.8 | 10 | ||||
-rw-r--r-- | sbin/mount_msdos/mount_msdos.c | 9 | ||||
-rw-r--r-- | sys/msdosfs/bootsect.h | 18 | ||||
-rw-r--r-- | sys/msdosfs/bpb.h | 24 | ||||
-rw-r--r-- | sys/msdosfs/fat.h | 7 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_vfsops.c | 99 | ||||
-rw-r--r-- | sys/msdosfs/msdosfsmount.h | 5 | ||||
-rw-r--r-- | sys/sys/mount.h | 3 |
10 files changed, 18 insertions, 166 deletions
diff --git a/lib/libc/sys/mount.2 b/lib/libc/sys/mount.2 index edd48cc3b89..251e7875a9d 100644 --- a/lib/libc/sys/mount.2 +++ b/lib/libc/sys/mount.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mount.2,v 1.34 2005/10/27 19:21:00 jaredy Exp $ +.\" $OpenBSD: mount.2,v 1.35 2006/12/15 03:04:23 krw Exp $ .\" $NetBSD: mount.2,v 1.12 1996/02/29 23:47:48 jtc Exp $ .\" .\" Copyright (c) 1980, 1989, 1993 @@ -182,7 +182,6 @@ 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 */ .Ed .Pp .Dv MOUNT_NFS diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 7a9e019a74d..77b95f4f6aa 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.c,v 1.43 2006/12/06 17:54:22 thib Exp $ */ +/* $OpenBSD: mount.c,v 1.44 2006/12/15 03:04:24 krw Exp $ */ /* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount.c 8.19 (Berkeley) 4/19/94"; #else -static char rcsid[] = "$OpenBSD: mount.c,v 1.43 2006/12/06 17:54:22 thib Exp $"; +static char rcsid[] = "$OpenBSD: mount.c,v 1.44 2006/12/15 03:04:24 krw Exp $"; #endif #endif /* not lint */ @@ -584,8 +584,6 @@ prmount(struct statfs *sf) (void)printf("%s%s", !f++ ? " (" : ", ", "long"); if (msdosfs_args->flags & MSDOSFSMNT_NOWIN95) (void)printf("%s%s", !f++ ? " (" : ", ", "nowin95"); - if (msdosfs_args->flags & MSDOSFSMNT_GEMDOSFS) - (void)printf("%s%s", !f++ ? " (" : ", ", "gem"); if (msdosfs_args->flags & MSDOSFSMNT_ALLOWDIRX) (void)printf("%s%s", !f++ ? " (" : ", ", "direxec"); } else if (strcmp(sf->f_fstypename, MOUNT_CD9660) == 0) { diff --git a/sbin/mount_msdos/mount_msdos.8 b/sbin/mount_msdos/mount_msdos.8 index 29d610375e8..c0778f0de3f 100644 --- a/sbin/mount_msdos/mount_msdos.8 +++ b/sbin/mount_msdos/mount_msdos.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mount_msdos.8,v 1.20 2005/02/28 16:00:37 tom Exp $ +.\" $OpenBSD: mount_msdos.8,v 1.21 2006/12/15 03:04:24 krw Exp $ .\" $NetBSD: mount_msdos.8,v 1.10 1996/01/19 21:14:43 leo Exp $ .\" .\" Copyright (c) 1993,1994 Christopher G. Demetriou @@ -44,7 +44,6 @@ .Op Fl s .Op Fl l .Op Fl 9 -.Op Fl G .Op Fl x .Ar special .Ar node @@ -138,13 +137,6 @@ Ignore the special Windows 95/98 directory entries even if deleting or renaming a file. This forces .Fl s . -.It Fl G -This option causes the filesystem to be interpreted as an Atari-Gemdos -filesystem. -The differences to the MS-DOS filesystem are minimal and -limited to the boot block. -This option enforces -.Fl s . .It Fl x If a directory is readable, it inherits the x attribute as well. .El diff --git a/sbin/mount_msdos/mount_msdos.c b/sbin/mount_msdos/mount_msdos.c index 73eacc6e5bf..257cdc26cdf 100644 --- a/sbin/mount_msdos/mount_msdos.c +++ b/sbin/mount_msdos/mount_msdos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_msdos.c,v 1.19 2005/04/08 20:09:37 jaredy Exp $ */ +/* $OpenBSD: mount_msdos.c,v 1.20 2006/12/15 03:04:24 krw Exp $ */ /* $NetBSD: mount_msdos.c,v 1.16 1996/10/24 00:12:50 cgd Exp $ */ /* @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: mount_msdos.c,v 1.19 2005/04/08 20:09:37 jaredy Exp $"; +static char rcsid[] = "$OpenBSD: mount_msdos.c,v 1.20 2006/12/15 03:04:24 krw Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -74,11 +74,8 @@ main(int argc, char **argv) mntflags = set_gid = set_uid = set_mask = 0; (void)memset(&args, '\0', sizeof(args)); - while ((c = getopt(argc, argv, "Gsl9xu:g:m:o:")) != -1) { + while ((c = getopt(argc, argv, "sl9xu:g:m:o:")) != -1) { switch (c) { - case 'G': - args.flags |= MSDOSFSMNT_GEMDOSFS; - break; case 's': args.flags |= MSDOSFSMNT_SHORTNAME; break; diff --git a/sys/msdosfs/bootsect.h b/sys/msdosfs/bootsect.h index 806062ee95e..56cde30376d 100644 --- a/sys/msdosfs/bootsect.h +++ b/sys/msdosfs/bootsect.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bootsect.h,v 1.4 2000/11/10 15:33:10 provos Exp $ */ +/* $OpenBSD: bootsect.h,v 1.5 2006/12/15 03:04:24 krw Exp $ */ /* $NetBSD: bootsect.h,v 1.8 1997/10/17 11:23:29 ws Exp $ */ /* @@ -71,22 +71,6 @@ struct bootsector710 { #define BOOTSIG2 0 #define BOOTSIG3 0 }; -#ifdef atari -/* - * 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. - */ -#if 0 -struct bootsec_atari { - u_int8_t bsBranch[2]; /* branch inst if auto-boot */ - int8_t bsFiller[6]; /* anything or nothing */ - int8_t bsSerial[3]; /* serial no. for mediachange */ - int8_t bsBPB[19]; /* BIOS parameter block */ - int8_t bsBootCode[482]; /* pad so struct is 512b */ -}; -#endif -#endif /* atari */ union bootsector { struct bootsector33 bs33; diff --git a/sys/msdosfs/bpb.h b/sys/msdosfs/bpb.h index 0817efb91c5..d9550a1b40c 100644 --- a/sys/msdosfs/bpb.h +++ b/sys/msdosfs/bpb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bpb.h,v 1.4 2005/09/28 20:53:56 miod Exp $ */ +/* $OpenBSD: bpb.h,v 1.5 2006/12/15 03:04:24 krw Exp $ */ /* $NetBSD: bpb.h,v 1.6 1997/10/17 11:23:35 ws Exp $ */ /* @@ -81,28 +81,6 @@ struct bpb710 { /* There is a 12 byte filler here, but we ignore it */ }; -#ifdef atari -/* - * BPB for gemdos filesystems. Atari leaves the obsolete stuff undefined. - * Currently there is no need for a separate BPB structure. - */ -#if 0 -struct bpb_a { - u_int16_t bpbBytesPerSec; /* bytes per sector */ - u_int8_t bpbSecPerClust; /* sectors per cluster */ - u_int16_t bpbResSectors; /* number of reserved sectors */ - 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_int16_t bpbFATsecs; /* number of sectors per FAT */ - u_int16_t bpbUseless2; /* meaningless for harddisk fs */ - u_int16_t bpbUseless3; /* meaningless for harddisk fs */ - u_int16_t bpbHiddenSecs; /* the TOS-BIOS ignores this */ -}; -#endif -#endif /* atari */ - /* * The following structures represent how the bpb's look on disk. shorts * and longs are just character arrays of the appropriate length. This is diff --git a/sys/msdosfs/fat.h b/sys/msdosfs/fat.h index 48d45bf0184..661736e0d82 100644 --- a/sys/msdosfs/fat.h +++ b/sys/msdosfs/fat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fat.h,v 1.8 2006/10/03 19:49:06 pedro Exp $ */ +/* $OpenBSD: fat.h,v 1.9 2006/12/15 03:04:24 krw Exp $ */ /* $NetBSD: fat.h,v 1.11 1997/10/17 11:23:49 ws Exp $ */ /*- @@ -71,11 +71,6 @@ * than 4078 ((CLUST_RSRVS - CLUST_FIRST) & FAT12_MASK) then we've got a * 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 - * 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. */ #define FAT12(pmp) (pmp->pm_fatmask == FAT12_MASK) #define FAT16(pmp) (pmp->pm_fatmask == FAT16_MASK) diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index 4f312c02827..e64bbe7ba28 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vfsops.c,v 1.44 2006/12/14 10:55:03 tom Exp $ */ +/* $OpenBSD: msdosfs_vfsops.c,v 1.45 2006/12/15 03:04:24 krw Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */ /*- @@ -214,12 +214,6 @@ msdosfs_mount(mp, path, data, ndp, p) pmp->pm_mask = args.mask; pmp->pm_flags |= args.flags & MSDOSFSMNT_MNTOPT; - /* - * GEMDOS knows nothing (yet) about win95 - */ - if (pmp->pm_flags & MSDOSFSMNT_GEMDOSFS) - pmp->pm_flags |= MSDOSFSMNT_NOWIN95; - if (pmp->pm_flags & MSDOSFSMNT_NOWIN95) pmp->pm_flags |= MSDOSFSMNT_SHORTNAME; else if (!(pmp->pm_flags & (MSDOSFSMNT_SHORTNAME | MSDOSFSMNT_LONGNAME))) { @@ -263,7 +257,6 @@ msdosfs_mountfs(devvp, mp, p, argp) struct msdosfsmount *pmp; struct buf *bp; dev_t dev = devvp->v_rdev; - struct partinfo dpart; union bootsector *bsp; struct byte_bpb33 *b33; struct byte_bpb50 *b50; @@ -271,7 +264,6 @@ msdosfs_mountfs(devvp, mp, p, argp) extern struct vnode *rootvp; u_int8_t SecPerClust; int ronly, error, bmapsiz; - int bsize = 0, dtype = 0, tmp; uint32_t fat_max_clusters; /* @@ -298,30 +290,6 @@ msdosfs_mountfs(devvp, mp, p, argp) bp = NULL; /* both used in error_exit */ pmp = NULL; - if (argp->flags & MSDOSFSMNT_GEMDOSFS) { - /* - * We need the disklabel to calculate the size of a FAT entry - * later on. Also make sure the partition contains a filesystem - * of type FS_MSDOS. This doesn't work for floppies, so we have - * to check for them too. - * - * At least some parts of the msdos fs driver seem to assume - * that the size of a disk block will always be 512 bytes. - * Let's check it... - */ - error = VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, - FREAD, NOCRED, p); - if (error) - goto error_exit; - tmp = dpart.part->p_fstype; - dtype = dpart.disklab->d_type; - bsize = dpart.disklab->d_secsize; - if (bsize != 512 || (dtype!=DTYPE_FLOPPY && tmp!=FS_MSDOS)) { - error = EFTYPE; - goto error_exit; - } - } - /* * Read the boot sector of the filesystem, and then check the * boot signature. If not a dos boot sector then error out. @@ -354,12 +322,9 @@ msdosfs_mountfs(devvp, mp, p, argp) pmp->pm_Heads = getushort(b50->bpbHeads); pmp->pm_Media = b50->bpbMedia; - if (!(argp->flags & MSDOSFSMNT_GEMDOSFS)) { - if (!pmp->pm_BytesPerSec || !SecPerClust - || pmp->pm_SecPerTrack > 63) { - error = EFTYPE; - goto error_exit; - } + if (!pmp->pm_BytesPerSec || !SecPerClust || pmp->pm_SecPerTrack > 63) { + error = EFTYPE; + goto error_exit; } if (pmp->pm_Sectors == 0) { @@ -387,47 +352,6 @@ msdosfs_mountfs(devvp, mp, p, argp) } else pmp->pm_flags |= MSDOSFS_FATMIRROR; - if (argp->flags & MSDOSFSMNT_GEMDOSFS) { - if (FAT32(pmp)) { - /* - * GEMDOS doesn't know fat32. - */ - error = EINVAL; - goto error_exit; - } - - /* - * Check a few values (could do some more): - * - logical sector size: power of 2, >= block size - * - sectors per cluster: power of 2, >= 1 - * - number of sectors: >= 1, <= size of partition - */ - if ( (SecPerClust == 0) - || (SecPerClust & (SecPerClust - 1)) - || (pmp->pm_BytesPerSec < bsize) - || (pmp->pm_BytesPerSec & (pmp->pm_BytesPerSec - 1)) - || (pmp->pm_HugeSectors == 0) - || (pmp->pm_HugeSectors * (pmp->pm_BytesPerSec / bsize) - > dpart.part->p_size) - ) { - error = EFTYPE; - goto error_exit; - } - /* - * XXX - Many parts of the msdos fs 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. - */ - tmp = pmp->pm_BytesPerSec / bsize; - pmp->pm_BytesPerSec = bsize; - pmp->pm_HugeSectors *= tmp; - pmp->pm_HiddenSects *= tmp; - pmp->pm_ResSectors *= tmp; - pmp->pm_Sectors *= tmp; - pmp->pm_FATsecs *= tmp; - SecPerClust *= tmp; - } pmp->pm_fatblk = pmp->pm_ResSectors; if (FAT32(pmp)) { pmp->pm_rootdirblk = getulong(b710->bpbRootClust); @@ -448,20 +372,7 @@ msdosfs_mountfs(devvp, mp, p, argp) pmp->pm_maxcluster = pmp->pm_nmbrofclusters + 1; pmp->pm_fatsize = pmp->pm_FATsecs * pmp->pm_BytesPerSec; - if (argp->flags & MSDOSFSMNT_GEMDOSFS) { - if ((pmp->pm_nmbrofclusters <= (0xff0 - 2)) - && ((dtype == DTYPE_FLOPPY) || ((dtype == DTYPE_VNODE) - && ((pmp->pm_Heads == 1) || (pmp->pm_Heads == 2)))) - ) { - pmp->pm_fatmask = FAT12_MASK; - pmp->pm_fatmult = 3; - pmp->pm_fatdiv = 2; - } else { - pmp->pm_fatmask = FAT16_MASK; - pmp->pm_fatmult = 2; - pmp->pm_fatdiv = 1; - } - } else if (pmp->pm_fatmask == 0) { + if (pmp->pm_fatmask == 0) { if (pmp->pm_maxcluster <= ((CLUST_RSRVD - CLUST_FIRST) & FAT12_MASK)) { /* diff --git a/sys/msdosfs/msdosfsmount.h b/sys/msdosfs/msdosfsmount.h index 3b44d747981..56f2cd971ff 100644 --- a/sys/msdosfs/msdosfsmount.h +++ b/sys/msdosfs/msdosfsmount.h @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfsmount.h,v 1.16 2004/05/14 04:05:05 tedu Exp $ */ +/* $OpenBSD: msdosfsmount.h,v 1.17 2006/12/15 03:04:24 krw Exp $ */ /* $NetBSD: msdosfsmount.h,v 1.16 1997/10/17 11:24:24 ws Exp $ */ /*- @@ -96,14 +96,13 @@ struct msdosfsmount { #define MSDOSFSMNT_SHORTNAME 0x01 #define MSDOSFSMNT_LONGNAME 0x02 #define MSDOSFSMNT_NOWIN95 0x04 -#define MSDOSFSMNT_GEMDOSFS 0x08 #define MSDOSFSMNT_ALLOWDIRX 0x10 #endif /* All flags above: */ #define MSDOSFSMNT_MNTOPT \ (MSDOSFSMNT_SHORTNAME|MSDOSFSMNT_LONGNAME|MSDOSFSMNT_NOWIN95 \ - |MSDOSFSMNT_GEMDOSFS|MSDOSFSMNT_ALLOWDIRX) + |MSDOSFSMNT_ALLOWDIRX) #define MSDOSFSMNT_RONLY 0x80000000 /* mounted read-only */ #define MSDOSFSMNT_WAITONFAT 0x40000000 /* mounted synchronous */ #define MSDOSFS_FATMIRROR 0x20000000 /* FAT is mirrored */ diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 27f4add81e7..ea848a7ddb3 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.h,v 1.76 2006/09/22 14:23:03 pedro Exp $ */ +/* $OpenBSD: mount.h,v 1.77 2006/12/15 03:04:24 krw Exp $ */ /* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */ /* @@ -219,7 +219,6 @@ struct msdosfs_args { #define MSDOSFSMNT_SHORTNAME 0x01 /* Force old DOS short names only */ #define MSDOSFSMNT_LONGNAME 0x02 /* Force Win'95 long names */ #define MSDOSFSMNT_NOWIN95 0x04 /* Completely ignore Win95 entries */ -#define MSDOSFSMNT_GEMDOSFS 0x08 /* This is a gemdos-flavour */ #define MSDOSFSMNT_ALLOWDIRX 0x10 /* dir is mode +x if r */ /* |