Lines Matching +full:cluster +full:- +full:index
3 /*-
4 * SPDX-License-Identifier: BSD-4-Clause
36 /*-
60 * de_dirclust contains the cluster number of the directory cluster
62 * de_diroffset is the index into the cluster for the entry describing
64 * de_StartCluster is the number of the first cluster of the file or directory.
67 * - Clusters 0 and 1 are reserved.
68 * - The first allocatable cluster is 2.
69 * - The root directory is of fixed size and all blocks that make it up
71 * - Cluster 0 refers to the root directory when it is found in the
73 * - Cluster 0 implies a 0 length file when found in the start cluster field
75 * - You can't use the cluster number 0 to derive the address of the root
77 * - Multiple directory entries can point to a directory. The entry in the
81 * - The root directory does not contain a "." or ".." entry.
82 * - Directory entries for directories are never changed once they are created
87 * - The length field in a directory entry pointing to a directory contains 0
89 * cluster chain until the "last cluster" marker is found.
93 * - A reference count for each denode will be kept since dos doesn't keep such
98 * Internal pseudo-offset for (nonexistent) directory entry for the root
104 * The FAT cache structure. fc_fsrcn is the filesystem relative cluster
105 * number that corresponds to the file relative cluster number in this
109 u_long fc_frcn; /* file relative cluster number */
110 u_long fc_fsrcn; /* filesystem relative cluster number */
116 * cluster of the file. The cache also helps sequential reads by
117 * remembering the last cluster read from the file. This also prevents us
118 * from having to rescan the FAT to find the next cluster to read. This
125 #define FC_LASTFC 1 /* entry for the last cluster in the file */
126 #define FC_NEXTTOLASTFC 2 /* entry for a close to the last cluster in
129 #define FCE_EMPTY 0xffffffff /* doesn't represent an actual cluster # */
135 (dep)->de_fc[(slot)].fc_frcn = (frcn); \
136 (dep)->de_fc[(slot)].fc_fsrcn = (fsrcn);
146 u_long de_dirclust; /* cluster of the directory file containing this entry */
147 u_long de_diroffset; /* offset of this entry in the directory cluster */
161 u_long de_StartCluster; /* starting cluster of file */
165 uint64_t de_inode; /* Inode number (really index of DOS style direntry) */
185 ((dep)->de_StartCluster |= getushort((dp)->deHighClust) << 16)
187 (memcpy((dep)->de_Name, (dp)->deName, 11), \
188 (dep)->de_Attributes = (dp)->deAttributes, \
189 (dep)->de_LowerCase = (dp)->deLowerCase, \
190 (dep)->de_CHun = (dp)->deCHundredth, \
191 (dep)->de_CTime = getushort((dp)->deCTime), \
192 (dep)->de_CDate = getushort((dp)->deCDate), \
193 (dep)->de_ADate = getushort((dp)->deADate), \
194 (dep)->de_MTime = getushort((dp)->deMTime), \
195 (dep)->de_MDate = getushort((dp)->deMDate), \
196 (dep)->de_StartCluster = getushort((dp)->deStartCluster), \
197 (dep)->de_FileSize = getulong((dp)->deFileSize), \
198 (FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0))
201 (memcpy((dp)->deName, (dep)->de_Name, 11), \
202 (dp)->deAttributes = (dep)->de_Attributes, \
203 (dp)->deLowerCase = (dep)->de_LowerCase, \
204 (dp)->deCHundredth = (dep)->de_CHun, \
205 putushort((dp)->deCTime, (dep)->de_CTime), \
206 putushort((dp)->deCDate, (dep)->de_CDate), \
207 putushort((dp)->deADate, (dep)->de_ADate), \
208 putushort((dp)->deMTime, (dep)->de_MTime), \
209 putushort((dp)->deMDate, (dep)->de_MDate), \
210 putushort((dp)->deStartCluster, (dep)->de_StartCluster), \
211 putulong((dp)->deFileSize, \
212 ((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \
213 putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16))
217 #define VTODE(vp) ((struct denode *)(vp)->v_data)
218 #define DETOV(de) ((de)->de_vnode)
223 : (((((uint64_t)pmp->pm_bpcluster * ((cn) - 2) + (off))) >> 5) \
224 + pmp->pm_RootDirEnts))
227 if ((dep)->de_flag & DE_UPDATE) { \
228 (dep)->de_flag |= DE_MODIFIED; \
229 timespec2fattime((mod), 0, &(dep)->de_MDate, \
230 &(dep)->de_MTime, NULL); \
231 (dep)->de_Attributes |= ATTR_ARCHIVE; \
233 if ((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95) { \
234 (dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
237 if ((dep)->de_flag & DE_ACCESS) { \
241 if (adate != (dep)->de_ADate) { \
242 (dep)->de_flag |= DE_MODIFIED; \
243 (dep)->de_ADate = adate; \
246 if ((dep)->de_flag & DE_CREATE) { \
247 timespec2fattime((cre), 0, &(dep)->de_CDate, \
248 &(dep)->de_CTime, &(dep)->de_CHun); \
249 (dep)->de_flag |= DE_MODIFIED; \
251 (dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
261 uint32_t defid_dirclust; /* cluster this dir entry came from */
262 uint32_t defid_dirofs; /* offset of entry within the cluster */