3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/fs/mcb.c
6 * PURPOSE: No purpose listed.
8 * PROGRAMMERS: No programmer listed.
12 #include <internal/debug.h>
14 /**********************************************************************
28 FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb
,
31 IN LONGLONG SectorCount
)
38 * FsRtlAddMcbEntry: Obsolete
43 FsRtlAddMcbEntry (IN PMCB Mcb
,
48 return FsRtlAddLargeMcbEntry(& Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
51 (LONGLONG
) SectorCount
);
58 FsRtlGetNextLargeMcbEntry(IN PLARGE_MCB Mcb
,
62 OUT PLONGLONG SectorCount
)
73 FsRtlGetNextMcbEntry (IN PMCB Mcb
,
77 OUT PULONG SectorCount
)
79 BOOLEAN Return
= FALSE
;
82 LONGLONG llSectorCount
;
84 /* Call the Large version */
85 Return
= FsRtlGetNextLargeMcbEntry(&Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
91 /* Return everything typecasted */
94 *SectorCount
= (ULONG
)llSectorCount
;
96 /* And return the original value */
105 FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb
,
106 IN POOL_TYPE PoolType
)
109 Mcb
->BaseMcb
.PoolType
= PoolType
;
113 * FsRtlInitializeMcb: Obsolete
117 FsRtlInitializeMcb (IN PMCB Mcb
,
118 IN POOL_TYPE PoolType
)
120 FsRtlInitializeLargeMcb(& Mcb
->DummyFieldThatSizesThisStructureCorrectly
, PoolType
);
128 FsRtlLookupLargeMcbEntry(IN PLARGE_MCB Mcb
,
130 OUT PLONGLONG Lbn OPTIONAL
,
131 OUT PLONGLONG SectorCountFromLbn OPTIONAL
,
132 OUT PLONGLONG StartingLbn OPTIONAL
,
133 OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL
,
134 OUT PULONG Index OPTIONAL
)
145 FsRtlLookupLastLargeMcbEntryAndIndex (
146 IN PLARGE_MCB OpaqueMcb
,
147 OUT PLONGLONG LargeVbn
,
148 OUT PLONGLONG LargeLbn
,
159 PFSRTL_PER_STREAM_CONTEXT
161 FsRtlLookupPerStreamContextInternal (
162 IN PFSRTL_ADVANCED_FCB_HEADER StreamContext
,
163 IN PVOID OwnerId OPTIONAL
,
164 IN PVOID InstanceId OPTIONAL
174 PVOID
/* PFSRTL_PER_FILE_OBJECT_CONTEXT*/
176 FsRtlLookupPerFileObjectContext (
177 IN PFSRTL_ADVANCED_FCB_HEADER StreamContext
,
178 IN PVOID OwnerId OPTIONAL
,
179 IN PVOID InstanceId OPTIONAL
190 FsRtlLookupLastLargeMcbEntry(IN PLARGE_MCB Mcb
,
203 FsRtlLookupLastMcbEntry(IN PMCB Mcb
,
207 BOOLEAN Return
= FALSE
;
211 /* Call the Large version */
212 Return
= FsRtlLookupLastLargeMcbEntry(&Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
216 /* Return everything typecasted */
220 /* And return the original value */
229 FsRtlLookupMcbEntry(IN PMCB Mcb
,
232 OUT PULONG SectorCount OPTIONAL
,
235 BOOLEAN Return
= FALSE
;
237 LONGLONG llSectorCount
;
239 /* Call the Large version */
240 Return
= FsRtlLookupLargeMcbEntry(&Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
248 /* Return everything typecasted */
250 if (SectorCount
) *SectorCount
= (ULONG
)llSectorCount
;
252 /* And return the original value */
261 FsRtlNumberOfRunsInLargeMcb(IN PLARGE_MCB Mcb
)
264 ExAcquireFastMutex (Mcb
->FastMutex
);
265 NumberOfRuns
=Mcb
->BaseMcb
.MaximumPairCount
;
266 ExReleaseFastMutex (Mcb
->FastMutex
);
267 return(NumberOfRuns
);
272 * FsRtlNumberOfRunsInMcb: Obsolete
277 FsRtlNumberOfRunsInMcb (IN PMCB Mcb
)
279 return FsRtlNumberOfRunsInLargeMcb(& Mcb
->DummyFieldThatSizesThisStructureCorrectly
);
287 FsRtlRemoveLargeMcbEntry(IN PLARGE_MCB Mcb
,
289 IN LONGLONG SectorCount
)
299 FsRtlRemoveMcbEntry (IN PMCB Mcb
,
301 IN ULONG SectorCount
)
303 /* Call the large function */
304 return FsRtlRemoveLargeMcbEntry(&Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
306 (LONGLONG
)SectorCount
);
317 IN BOOLEAN SelfSynchronized
327 FsRtlSplitLargeMcb(IN PLARGE_MCB Mcb
,
340 FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb
,
348 * FsRtlTruncateMcb: Obsolete
353 FsRtlTruncateMcb (IN PMCB Mcb
,
356 FsRtlTruncateLargeMcb (& Mcb
->DummyFieldThatSizesThisStructureCorrectly
, (LONGLONG
) Vbn
);
364 FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb
)
370 * FsRtlUninitializeMcb: Obsolete
375 FsRtlUninitializeMcb (IN PMCB Mcb
)
377 FsRtlUninitializeLargeMcb(& Mcb
->DummyFieldThatSizesThisStructureCorrectly
);