Ensure that deHighClust in direntry always initialized.
Noticed by: Carl Mascott <cmascott@world.std.com> Don't write access time of a file more than once per day. (Its precision is 1 day anyway). Don't try to write access and creation time in nonwin95 case. Suggested by: bde (long time ago).
This commit is contained in:
parent
289bdf33d3
commit
9d9fdb45c5
@ -1,4 +1,4 @@
|
||||
/* $Id: denode.h,v 1.16 1998/05/17 18:00:42 bde Exp $ */
|
||||
/* $Id: denode.h,v 1.17 1998/11/21 00:20:24 dt Exp $ */
|
||||
/* $NetBSD: denode.h,v 1.25 1997/11/17 15:36:28 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -194,8 +194,6 @@ struct denode {
|
||||
(dep)->de_FileSize = getulong((dp)->deFileSize), \
|
||||
(FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0))
|
||||
|
||||
#define DE_EXTERNALIZE32(dp, dep) \
|
||||
putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)
|
||||
#define DE_EXTERNALIZE(dp, dep) \
|
||||
(bcopy((dep)->de_Name, (dp)->deName, 11), \
|
||||
(dp)->deAttributes = (dep)->de_Attributes, \
|
||||
@ -209,7 +207,7 @@ struct denode {
|
||||
putushort((dp)->deStartCluster, (dep)->de_StartCluster), \
|
||||
putulong((dp)->deFileSize, \
|
||||
((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \
|
||||
(FAT32((dep)->de_pmp) ? DE_EXTERNALIZE32((dp), (dep)) : 0))
|
||||
putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16))
|
||||
|
||||
#define de_forw de_chain[0]
|
||||
#define de_back de_chain[1]
|
||||
@ -219,21 +217,33 @@ struct denode {
|
||||
#define VTODE(vp) ((struct denode *)(vp)->v_data)
|
||||
#define DETOV(de) ((de)->de_vnode)
|
||||
|
||||
#define DETIMES(dep, acc, mod, cre) \
|
||||
if ((dep)->de_flag & (DE_UPDATE | DE_CREATE | DE_ACCESS)) { \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
if ((dep)->de_flag & DE_UPDATE) { \
|
||||
unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, NULL); \
|
||||
(dep)->de_Attributes |= ATTR_ARCHIVE; \
|
||||
} \
|
||||
if (!((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95)) { \
|
||||
if ((dep)->de_flag & DE_ACCESS) \
|
||||
unix2dostime((acc), &(dep)->de_ADate, NULL, NULL); \
|
||||
if ((dep)->de_flag & DE_CREATE) \
|
||||
unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, &(dep)->de_CHun); \
|
||||
} \
|
||||
(dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
|
||||
}
|
||||
#define DETIMES(dep, acc, mod, cre) do { \
|
||||
if ((dep)->de_flag & DE_UPDATE) { \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, \
|
||||
NULL); \
|
||||
(dep)->de_Attributes |= ATTR_ARCHIVE; \
|
||||
} \
|
||||
if ((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95) { \
|
||||
(dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
|
||||
break; \
|
||||
} \
|
||||
if ((dep)->de_flag & DE_ACCESS) { \
|
||||
u_int16_t adate; \
|
||||
\
|
||||
unix2dostime((acc), &adate, NULL, NULL); \
|
||||
if (adate != (dep)->de_ADate) { \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
(dep)->de_ADate = adate; \
|
||||
} \
|
||||
} \
|
||||
if ((dep)->de_flag & DE_CREATE) { \
|
||||
unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, \
|
||||
&(dep)->de_CHun); \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
} \
|
||||
(dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
|
||||
} while (0);
|
||||
|
||||
/*
|
||||
* This overlays the fid structure (see mount.h)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: denode.h,v 1.16 1998/05/17 18:00:42 bde Exp $ */
|
||||
/* $Id: denode.h,v 1.17 1998/11/21 00:20:24 dt Exp $ */
|
||||
/* $NetBSD: denode.h,v 1.25 1997/11/17 15:36:28 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -194,8 +194,6 @@ struct denode {
|
||||
(dep)->de_FileSize = getulong((dp)->deFileSize), \
|
||||
(FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0))
|
||||
|
||||
#define DE_EXTERNALIZE32(dp, dep) \
|
||||
putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)
|
||||
#define DE_EXTERNALIZE(dp, dep) \
|
||||
(bcopy((dep)->de_Name, (dp)->deName, 11), \
|
||||
(dp)->deAttributes = (dep)->de_Attributes, \
|
||||
@ -209,7 +207,7 @@ struct denode {
|
||||
putushort((dp)->deStartCluster, (dep)->de_StartCluster), \
|
||||
putulong((dp)->deFileSize, \
|
||||
((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \
|
||||
(FAT32((dep)->de_pmp) ? DE_EXTERNALIZE32((dp), (dep)) : 0))
|
||||
putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16))
|
||||
|
||||
#define de_forw de_chain[0]
|
||||
#define de_back de_chain[1]
|
||||
@ -219,21 +217,33 @@ struct denode {
|
||||
#define VTODE(vp) ((struct denode *)(vp)->v_data)
|
||||
#define DETOV(de) ((de)->de_vnode)
|
||||
|
||||
#define DETIMES(dep, acc, mod, cre) \
|
||||
if ((dep)->de_flag & (DE_UPDATE | DE_CREATE | DE_ACCESS)) { \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
if ((dep)->de_flag & DE_UPDATE) { \
|
||||
unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, NULL); \
|
||||
(dep)->de_Attributes |= ATTR_ARCHIVE; \
|
||||
} \
|
||||
if (!((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95)) { \
|
||||
if ((dep)->de_flag & DE_ACCESS) \
|
||||
unix2dostime((acc), &(dep)->de_ADate, NULL, NULL); \
|
||||
if ((dep)->de_flag & DE_CREATE) \
|
||||
unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, &(dep)->de_CHun); \
|
||||
} \
|
||||
(dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
|
||||
}
|
||||
#define DETIMES(dep, acc, mod, cre) do { \
|
||||
if ((dep)->de_flag & DE_UPDATE) { \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, \
|
||||
NULL); \
|
||||
(dep)->de_Attributes |= ATTR_ARCHIVE; \
|
||||
} \
|
||||
if ((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95) { \
|
||||
(dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
|
||||
break; \
|
||||
} \
|
||||
if ((dep)->de_flag & DE_ACCESS) { \
|
||||
u_int16_t adate; \
|
||||
\
|
||||
unix2dostime((acc), &adate, NULL, NULL); \
|
||||
if (adate != (dep)->de_ADate) { \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
(dep)->de_ADate = adate; \
|
||||
} \
|
||||
} \
|
||||
if ((dep)->de_flag & DE_CREATE) { \
|
||||
unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, \
|
||||
&(dep)->de_CHun); \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
} \
|
||||
(dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
|
||||
} while (0);
|
||||
|
||||
/*
|
||||
* This overlays the fid structure (see mount.h)
|
||||
|
Loading…
Reference in New Issue
Block a user