1 /* $Id: mcb.c,v 1.17 2004/12/30 18:30:05 ion Exp $
3 * reactos/ntoskrnl/fs/mcb.c
8 #include <internal/debug.h>
10 /**********************************************************************
24 FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb
,
27 IN LONGLONG SectorCount
)
34 * FsRtlAddMcbEntry: Obsolete
39 FsRtlAddMcbEntry (IN PMCB Mcb
,
44 return FsRtlAddLargeMcbEntry(& Mcb
->LargeMcb
,
47 (LONGLONG
) SectorCount
);
54 FsRtlGetNextLargeMcbEntry(IN PLARGE_MCB Mcb
,
58 OUT PLONGLONG SectorCount
)
69 FsRtlGetNextMcbEntry (IN PMCB Mcb
,
73 OUT PULONG SectorCount
)
75 BOOLEAN Return
= FALSE
;
78 LONGLONG llSectorCount
;
80 /* Call the Large version */
81 Return
= FsRtlGetNextLargeMcbEntry(&Mcb
->LargeMcb
,
87 /* Return everything typecasted */
90 *SectorCount
= (ULONG
)llSectorCount
;
92 /* And return the original value */
101 FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb
,
102 IN POOL_TYPE PoolType
)
105 Mcb
->PoolType
= PoolType
;
109 * FsRtlInitializeMcb: Obsolete
113 FsRtlInitializeMcb (IN PMCB Mcb
,
114 IN POOL_TYPE PoolType
)
116 FsRtlInitializeLargeMcb(& Mcb
->LargeMcb
, PoolType
);
124 FsRtlLookupLargeMcbEntry(IN PLARGE_MCB Mcb
,
126 OUT PLONGLONG Lbn OPTIONAL
,
127 OUT PLONGLONG SectorCountFromLbn OPTIONAL
,
128 OUT PLONGLONG StartingLbn OPTIONAL
,
129 OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL
,
130 OUT PULONG Index OPTIONAL
)
141 FsRtlLookupLastLargeMcbEntryAndIndex (
142 IN PLARGE_MCB OpaqueMcb
,
143 OUT PLONGLONG LargeVbn
,
144 OUT PLONGLONG LargeLbn
,
155 PFSRTL_PER_STREAM_CONTEXT
157 FsRtlLookupPerStreamContextInternal (
158 IN PFSRTL_ADVANCED_FCB_HEADER StreamContext
,
159 IN PVOID OwnerId OPTIONAL
,
160 IN PVOID InstanceId OPTIONAL
170 PVOID
/* PFSRTL_PER_FILE_OBJECT_CONTEXT*/
172 FsRtlLookupPerFileObjectContext (
173 IN PFSRTL_ADVANCED_FCB_HEADER StreamContext
,
174 IN PVOID OwnerId OPTIONAL
,
175 IN PVOID InstanceId OPTIONAL
186 FsRtlLookupLastLargeMcbEntry(IN PLARGE_MCB Mcb
,
199 FsRtlLookupLastMcbEntry(IN PMCB Mcb
,
203 BOOLEAN Return
= FALSE
;
207 /* Call the Large version */
208 Return
= FsRtlLookupLastLargeMcbEntry(&Mcb
->LargeMcb
,
212 /* Return everything typecasted */
216 /* And return the original value */
225 FsRtlLookupMcbEntry(IN PMCB Mcb
,
228 OUT PULONG SectorCount OPTIONAL
,
231 BOOLEAN Return
= FALSE
;
233 LONGLONG llSectorCount
;
235 /* Call the Large version */
236 Return
= FsRtlLookupLargeMcbEntry(&Mcb
->LargeMcb
,
244 /* Return everything typecasted */
246 if (SectorCount
) *SectorCount
= (ULONG
)llSectorCount
;
248 /* And return the original value */
257 FsRtlNumberOfRunsInLargeMcb(IN PLARGE_MCB Mcb
)
260 ExAcquireFastMutex (Mcb
->FastMutex
);
261 NumberOfRuns
=Mcb
->PairCount
;
262 ExReleaseFastMutex (Mcb
->FastMutex
);
263 return(NumberOfRuns
);
268 * FsRtlNumberOfRunsInMcb: Obsolete
273 FsRtlNumberOfRunsInMcb (IN PMCB Mcb
)
275 return FsRtlNumberOfRunsInLargeMcb(& Mcb
->LargeMcb
);
283 FsRtlRemoveLargeMcbEntry(IN PLARGE_MCB Mcb
,
285 IN LONGLONG SectorCount
)
295 FsRtlRemoveMcbEntry (IN PMCB Mcb
,
297 IN ULONG SectorCount
)
299 /* Call the large function */
300 return FsRtlRemoveLargeMcbEntry(&Mcb
->LargeMcb
,
302 (LONGLONG
)SectorCount
);
313 IN BOOLEAN SelfSynchronized
323 FsRtlSplitLargeMcb(IN PLARGE_MCB Mcb
,
336 FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb
,
344 * FsRtlTruncateMcb: Obsolete
349 FsRtlTruncateMcb (IN PMCB Mcb
,
352 FsRtlTruncateLargeMcb (& Mcb
->LargeMcb
, (LONGLONG
) Vbn
);
360 FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb
)
366 * FsRtlUninitializeMcb: Obsolete
371 FsRtlUninitializeMcb (IN PMCB Mcb
)
373 FsRtlUninitializeLargeMcb(& Mcb
->LargeMcb
);