Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/msdosfs Minor changes:
details: https://anonhg.NetBSD.org/src/rev/f9f8ac47a9f2
branches: trunk
changeset: 330451:f9f8ac47a9f2
user: maxv <maxv%NetBSD.org@localhost>
date: Wed Jul 09 09:00:18 2014 +0000
description:
Minor changes:
- malloc()+memset() -> malloc(|M_ZERO)
- rename 'vers' to 'FSVers'
- declare 'ExtFlags' instead of calling getushort() two times
diffstat:
sys/fs/msdosfs/msdosfs_vfsops.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
diffs (74 lines):
diff -r f18747f6630f -r f9f8ac47a9f2 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c Wed Jul 09 08:43:54 2014 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c Wed Jul 09 09:00:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vfsops.c,v 1.111 2014/07/09 08:43:54 maxv Exp $ */
+/* $NetBSD: msdosfs_vfsops.c,v 1.112 2014/07/09 09:00:18 maxv 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.111 2014/07/09 08:43:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.112 2014/07/09 09:00:18 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -524,8 +524,7 @@
}
}
- pmp = malloc(sizeof *pmp, M_MSDOSFSMNT, M_WAITOK);
- memset(pmp, 0, sizeof *pmp);
+ pmp = malloc(sizeof(*pmp), M_MSDOSFSMNT, M_WAITOK|M_ZERO);
pmp->pm_mountp = mp;
/*
@@ -576,15 +575,16 @@
}
if (pmp->pm_RootDirEnts == 0) {
- unsigned short vers = getushort(b710->bpbFSVers);
+ unsigned short FSVers = getushort(b710->bpbFSVers);
+ unsigned short ExtFlags = getushort(b710->bpbExtFlags);
/*
* Some say that bsBootSectSig[23] must be zero, but
* Windows does not require this and some digital cameras
* do not set these to zero. Therefore, do not insist.
*/
- if (pmp->pm_Sectors || pmp->pm_FATsecs || vers) {
- DPRINTF(("sectors %d fatsecs %lu vers %d\n",
- pmp->pm_Sectors, pmp->pm_FATsecs, vers));
+ if (pmp->pm_Sectors || pmp->pm_FATsecs || FSVers) {
+ DPRINTF(("Sectors %d FATsecs %lu FSVers %d\n",
+ pmp->pm_Sectors, pmp->pm_FATsecs, FSVers));
error = EINVAL;
goto error_exit;
}
@@ -593,20 +593,18 @@
pmp->pm_fatdiv = 1;
pmp->pm_FATsecs = getulong(b710->bpbBigFATsecs);
- /* mirrorring is enabled if the FATMIRROR bit is not set */
- if ((getushort(b710->bpbExtFlags) & FATMIRROR) == 0)
+ /* Mirroring is enabled if the FATMIRROR bit is not set. */
+ if ((ExtFlags & FATMIRROR) == 0)
pmp->pm_flags |= MSDOSFS_FATMIRROR;
else
- pmp->pm_curfat = getushort(b710->bpbExtFlags) & FATNUM;
+ pmp->pm_curfat = ExtFlags & FATNUM;
} else
pmp->pm_flags |= MSDOSFS_FATMIRROR;
if (argp->flags & MSDOSFSMNT_GEMDOSFS) {
if (FAT32(pmp)) {
+ /* GEMDOS doesn't know FAT32. */
DPRINTF(("FAT32 for GEMDOS\n"));
- /*
- * GEMDOS doesn't know FAT32.
- */
error = EINVAL;
goto error_exit;
}
Home |
Main Index |
Thread Index |
Old Index