Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/msdosfs fix LP64 problems which were the cause of PR#8037.
details: https://anonhg.NetBSD.org/src/rev/b8cba0c057f6
branches: trunk
changeset: 474946:b8cba0c057f6
user: cgd <cgd%NetBSD.org@localhost>
date: Tue Jul 27 05:38:02 1999 +0000
description:
fix LP64 problems which were the cause of PR#8037.
diffstat:
sys/msdosfs/fat.h | 4 ++--
sys/msdosfs/msdosfs_fat.c | 18 ++----------------
2 files changed, 4 insertions(+), 18 deletions(-)
diffs (71 lines):
diff -r 6c34102eff5f -r b8cba0c057f6 sys/msdosfs/fat.h
--- a/sys/msdosfs/fat.h Tue Jul 27 03:56:13 1999 +0000
+++ b/sys/msdosfs/fat.h Tue Jul 27 05:38:02 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fat.h,v 1.12 1997/11/17 15:36:36 ws Exp $ */
+/* $NetBSD: fat.h,v 1.13 1999/07/27 05:38:02 cgd Exp $ */
/*-
* Copyright (C) 1994, 1997 Wolfgang Solfrank.
@@ -80,7 +80,7 @@
#define FAT16(pmp) (pmp->pm_fatmask == FAT16_MASK)
#define FAT32(pmp) (pmp->pm_fatmask == FAT32_MASK)
-#define MSDOSFSEOF(pmp, cn) ((((cn) | ~(pmp)->pm_fatmask) & CLUST_EOFS) == CLUST_EOFS)
+#define MSDOSFSEOF(pmp, cn) ((cn) == (CLUST_EOFS & (pmp)->pm_fatmask))
#ifdef _KERNEL
/*
diff -r 6c34102eff5f -r b8cba0c057f6 sys/msdosfs/msdosfs_fat.c
--- a/sys/msdosfs/msdosfs_fat.c Tue Jul 27 03:56:13 1999 +0000
+++ b/sys/msdosfs/msdosfs_fat.c Tue Jul 27 05:38:02 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_fat.c,v 1.30 1998/08/09 20:52:20 perry Exp $ */
+/* $NetBSD: msdosfs_fat.c,v 1.31 1999/07/27 05:38:03 cgd Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -216,7 +216,7 @@
/*
* Stop with all reserved clusters, not just with EOF.
*/
- if ((cn | ~pmp->pm_fatmask) >= CLUST_RSRVD)
+ if (cn >= (CLUST_RSRVD & pmp->pm_fatmask))
goto hiteof;
byteoffset = FATOFS(pmp, cn);
fatblock(pmp, byteoffset, &bn, &bsize, &bo);
@@ -238,15 +238,6 @@
if (FAT12(pmp) && (prevcn & 1))
cn >>= 4;
cn &= pmp->pm_fatmask;
-
- /*
- * Force the special cluster numbers
- * to be the same for all cluster sizes
- * to let the rest of msdosfs handle
- * all cases the same.
- */
- if ((cn | ~pmp->pm_fatmask) >= CLUST_RSRVD)
- cn |= ~pmp->pm_fatmask;
}
if (!MSDOSFSEOF(pmp, cn)) {
@@ -554,9 +545,6 @@
if (FAT12(pmp) & (cn & 1))
readcn >>= 4;
readcn &= pmp->pm_fatmask;
- /* map reserved fat entries to same values for all fats */
- if ((readcn | ~pmp->pm_fatmask) >= CLUST_RSRVD)
- readcn |= ~pmp->pm_fatmask;
*oldcontents = readcn;
}
if (function & FAT_SET) {
@@ -901,8 +889,6 @@
break;
}
cluster &= pmp->pm_fatmask;
- if ((cluster | ~pmp->pm_fatmask) >= CLUST_RSRVD)
- cluster |= pmp->pm_fatmask;
}
if (bp)
updatefats(pmp, bp, bn);
Home |
Main Index |
Thread Index |
Old Index