Give some flags longer and more mnemonic names.
This commit is contained in:
parent
a5d981ea62
commit
901f3bbe9f
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: denode.h,v 1.6 1994/07/18 21:38:08 cgd Exp $ */
|
||||
/* $NetBSD: denode.h,v 1.7 1994/07/19 04:29:55 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994 Wolfgang Solfrank.
|
||||
|
@ -163,9 +163,9 @@ struct denode {
|
|||
* Values for the de_flag field of the denode.
|
||||
*/
|
||||
#define DE_LOCKED 0x0001 /* directory entry is locked */
|
||||
#define DE_WANT 0x0002 /* someone wants this de */
|
||||
#define DE_UPD 0x0004 /* file has been modified */
|
||||
#define DE_MOD 0x0080 /* denode wants to be written back to disk */
|
||||
#define DE_WANTED 0x0002 /* someone wants this de */
|
||||
#define DE_UPDATE 0x0004 /* file has been modified */
|
||||
#define DE_MODIFIED 0x0080 /* denode wants to be written back to disk */
|
||||
|
||||
/*
|
||||
* Transfer directory entries between internal and external form.
|
||||
|
@ -197,14 +197,14 @@ struct denode {
|
|||
#define DETOV(de) ((de)->de_vnode)
|
||||
|
||||
#define DE_UPDAT(dep, t, waitfor) \
|
||||
if (dep->de_flag & DE_UPD) \
|
||||
if (dep->de_flag & DE_UPDATE) \
|
||||
(void) deupdat(dep, t, waitfor);
|
||||
|
||||
#define DE_TIMES(dep, t) \
|
||||
if (dep->de_flag & DE_UPD) { \
|
||||
(dep)->de_flag |= DE_MOD; \
|
||||
if (dep->de_flag & DE_UPDATE) { \
|
||||
(dep)->de_flag |= DE_MODIFIED; \
|
||||
unix2dostime(t, &dep->de_Date, &dep->de_Time); \
|
||||
(dep)->de_flag &= ~DE_UPD; \
|
||||
(dep)->de_flag &= ~DE_UPDATE; \
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msdosfs_denode.c,v 1.7 1994/07/18 21:38:12 cgd Exp $ */
|
||||
/* $NetBSD: msdosfs_denode.c,v 1.8 1994/07/19 04:29:57 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994 Wolfgang Solfrank.
|
||||
|
@ -89,7 +89,7 @@ msdosfs_hashget(dev, dirclust, diroff)
|
|||
|| dep->de_refcnt == 0)
|
||||
continue;
|
||||
if (dep->de_flag & DE_LOCKED) {
|
||||
dep->de_flag |= DE_WANT;
|
||||
dep->de_flag |= DE_WANTED;
|
||||
sleep((caddr_t)dep, PINOD);
|
||||
break;
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ deupdat(dep, tp, waitfor)
|
|||
* directory entries that describe a directory do not ever get
|
||||
* updated. This is the way dos treats them.
|
||||
*/
|
||||
if ((dep->de_flag & DE_UPD) == 0 ||
|
||||
if ((dep->de_flag & DE_UPDATE) == 0 ||
|
||||
vp->v_mount->mnt_flag & MNT_RDONLY ||
|
||||
dep->de_Attributes & ATTR_DIRECTORY ||
|
||||
dep->de_refcnt <= 0)
|
||||
|
@ -343,7 +343,7 @@ deupdat(dep, tp, waitfor)
|
|||
*/
|
||||
TIMEVAL_TO_TIMESPEC(&time, &ts);
|
||||
unix2dostime(&ts, &dep->de_Date, &dep->de_Time);
|
||||
dep->de_flag &= ~DE_UPD;
|
||||
dep->de_flag &= ~DE_UPDATE;
|
||||
|
||||
/*
|
||||
* Copy the directory entry out of the denode into the cluster it
|
||||
|
@ -474,7 +474,7 @@ detrunc(dep, length, flags, cred, p)
|
|||
* we free the trailing clusters.
|
||||
*/
|
||||
dep->de_FileSize = length;
|
||||
dep->de_flag |= DE_UPD;
|
||||
dep->de_flag |= DE_UPDATE;
|
||||
vflags = (length > 0 ? V_SAVE : 0) | V_SAVEMETA;
|
||||
vinvalbuf(DETOV(dep), vflags, cred, p, 0, 0);
|
||||
allerror = deupdat(dep, &time, 1);
|
||||
|
@ -555,7 +555,7 @@ deextend(dep, length, cred)
|
|||
}
|
||||
}
|
||||
|
||||
dep->de_flag |= DE_UPD;
|
||||
dep->de_flag |= DE_UPDATE;
|
||||
dep->de_FileSize = length;
|
||||
return deupdat(dep, &time, 1);
|
||||
}
|
||||
|
@ -664,7 +664,7 @@ msdosfs_inactive(ap)
|
|||
VOP_LOCK(vp);
|
||||
if (dep->de_refcnt <= 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) {
|
||||
error = detrunc(dep, (u_long) 0, 0, NOCRED, NULL);
|
||||
dep->de_flag |= DE_UPD;
|
||||
dep->de_flag |= DE_UPDATE;
|
||||
dep->de_Name[0] = SLOT_DELETED;
|
||||
}
|
||||
DE_UPDAT(dep, &time, 0);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msdosfs_fat.c,v 1.8 1994/07/18 21:38:14 cgd Exp $ */
|
||||
/* $NetBSD: msdosfs_fat.c,v 1.9 1994/07/19 04:29:58 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994 Wolfgang Solfrank.
|
||||
|
@ -867,8 +867,8 @@ fillinusemap(pmp)
|
|||
* If this pointer is 0, do not return the cluster number.
|
||||
* flags - see fat.h
|
||||
*
|
||||
* NOTE: This function is not responsible for turning on the DE_UPD bit of the
|
||||
* de_flag field of the denode and it does not change the de_FileSize
|
||||
* NOTE: This function is not responsible for turning on the DE_UPDATE bit of
|
||||
* the de_flag field of the denode and it does not change the de_FileSize
|
||||
* field. This is left for the caller to do.
|
||||
*/
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msdosfs_lookup.c,v 1.12 1994/07/18 21:38:16 cgd Exp $ */
|
||||
/* $NetBSD: msdosfs_lookup.c,v 1.13 1994/07/19 04:30:00 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994 Wolfgang Solfrank.
|
||||
|
@ -321,7 +321,7 @@ notfound:;
|
|||
dp->de_fndoffset = slotoffset;
|
||||
dp->de_fndclust = slotcluster;
|
||||
}
|
||||
/* dp->de_flag |= DE_UPD; /* never update dos directories */
|
||||
/* dp->de_flag |= DE_UPDATE; /* never update dos directories */
|
||||
cnp->cn_flags |= SAVENAME;
|
||||
if (!lockparent)/* leave searched dir locked? */
|
||||
VOP_UNLOCK(vdp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msdosfs_vfsops.c,v 1.17 1994/07/18 21:38:18 cgd Exp $ */
|
||||
/* $NetBSD: msdosfs_vfsops.c,v 1.18 1994/07/19 04:30:03 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994 Wolfgang Solfrank.
|
||||
|
@ -640,7 +640,7 @@ loop:
|
|||
if (VOP_ISLOCKED(vp)) /* file is busy */
|
||||
continue;
|
||||
dep = VTODE(vp);
|
||||
if ((dep->de_flag & DE_UPD) == 0 &&
|
||||
if ((dep->de_flag & DE_UPDATE) == 0 &&
|
||||
vp->v_dirtyblkhd.lh_first == NULL)
|
||||
continue;
|
||||
if (vget(vp, 1)) /* not there anymore? */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msdosfs_vnops.c,v 1.16 1994/07/18 21:38:20 cgd Exp $ */
|
||||
/* $NetBSD: msdosfs_vnops.c,v 1.17 1994/07/19 04:30:06 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994 Wolfgang Solfrank.
|
||||
|
@ -384,7 +384,7 @@ msdosfs_setattr(ap)
|
|||
return error;
|
||||
}
|
||||
if (vap->va_mtime.ts_sec != VNOVAL) {
|
||||
dep->de_flag |= DE_UPD;
|
||||
dep->de_flag |= DE_UPDATE;
|
||||
if (error = deupdat(dep, &vap->va_mtime, 1))
|
||||
return error;
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ msdosfs_setattr(ap)
|
|||
dep->de_Attributes &= ~ATTR_READONLY;
|
||||
else
|
||||
dep->de_Attributes |= ATTR_READONLY;
|
||||
dep->de_flag |= DE_UPD;
|
||||
dep->de_flag |= DE_UPDATE;
|
||||
}
|
||||
|
||||
if (vap->va_flags != VNOVAL) {
|
||||
|
@ -412,7 +412,7 @@ msdosfs_setattr(ap)
|
|||
dep->de_flag &= 0xffff0000;
|
||||
dep->de_flag |= (vap->va_flags & 0xffff);
|
||||
}
|
||||
dep->de_flag |= DE_UPD;
|
||||
dep->de_flag |= DE_UPDATE;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
@ -695,7 +695,7 @@ msdosfs_write(ap)
|
|||
bawrite(bp);
|
||||
} else
|
||||
bdwrite(bp);
|
||||
dep->de_flag |= DE_UPD;
|
||||
dep->de_flag |= DE_UPDATE;
|
||||
} while (error == 0 && uio->uio_resid > 0);
|
||||
|
||||
/*
|
||||
|
@ -1678,7 +1678,7 @@ msdosfs_lock(ap)
|
|||
struct denode *dep = VTODE(ap->a_vp);
|
||||
|
||||
while (dep->de_flag & DE_LOCKED) {
|
||||
dep->de_flag |= DE_WANT;
|
||||
dep->de_flag |= DE_WANTED;
|
||||
if (dep->de_lockholder == curproc->p_pid)
|
||||
panic("msdosfs_lock: locking against myself");
|
||||
dep->de_lockwaiter = curproc->p_pid;
|
||||
|
@ -1702,8 +1702,8 @@ msdosfs_unlock(ap)
|
|||
panic("msdosfs_unlock: denode not locked");
|
||||
dep->de_lockholder = 0;
|
||||
dep->de_flag &= ~DE_LOCKED;
|
||||
if (dep->de_flag & DE_WANT) {
|
||||
dep->de_flag &= ~DE_WANT;
|
||||
if (dep->de_flag & DE_WANTED) {
|
||||
dep->de_flag &= ~DE_WANTED;
|
||||
wakeup((caddr_t) dep);
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue