Fix splitting of cells (noticed by Hartmut).
[reactos.git] / reactos / ntoskrnl / fs / mcb.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/fs/mcb.c
6 * PURPOSE: No purpose listed.
7 *
8 * PROGRAMMERS: No programmer listed.
9 */
10
11 #include <ntoskrnl.h>
12 #include <internal/debug.h>
13
14 /**********************************************************************
15 * NAME EXPORTED
16 *
17 * DESCRIPTION
18 *
19 * ARGUMENTS
20 *
21 * RETURN VALUE
22 *
23 * NOTES
24 *
25 * @unimplemented
26 */
27 BOOLEAN STDCALL
28 FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb,
29 IN LONGLONG Vbn,
30 IN LONGLONG Lbn,
31 IN LONGLONG SectorCount)
32 {
33 UNIMPLEMENTED;
34 return(FALSE);
35 }
36
37 /*
38 * FsRtlAddMcbEntry: Obsolete
39 *
40 * @implemented
41 */
42 BOOLEAN STDCALL
43 FsRtlAddMcbEntry (IN PMCB Mcb,
44 IN VBN Vbn,
45 IN LBN Lbn,
46 IN ULONG SectorCount)
47 {
48 return FsRtlAddLargeMcbEntry(& Mcb->DummyFieldThatSizesThisStructureCorrectly,
49 (LONGLONG) Vbn,
50 (LONGLONG) Lbn,
51 (LONGLONG) SectorCount);
52 }
53
54 /*
55 * @unimplemented
56 */
57 BOOLEAN STDCALL
58 FsRtlGetNextLargeMcbEntry(IN PLARGE_MCB Mcb,
59 IN ULONG RunIndex,
60 OUT PLONGLONG Vbn,
61 OUT PLONGLONG Lbn,
62 OUT PLONGLONG SectorCount)
63 {
64 UNIMPLEMENTED;
65 return(FALSE);
66 }
67
68
69 /*
70 * @implemented
71 */
72 BOOLEAN STDCALL
73 FsRtlGetNextMcbEntry (IN PMCB Mcb,
74 IN ULONG RunIndex,
75 OUT PVBN Vbn,
76 OUT PLBN Lbn,
77 OUT PULONG SectorCount)
78 {
79 BOOLEAN Return = FALSE;
80 LONGLONG llVbn;
81 LONGLONG llLbn;
82 LONGLONG llSectorCount;
83
84 /* Call the Large version */
85 Return = FsRtlGetNextLargeMcbEntry(&Mcb->DummyFieldThatSizesThisStructureCorrectly,
86 RunIndex,
87 &llVbn,
88 &llLbn,
89 &llSectorCount);
90
91 /* Return everything typecasted */
92 *Vbn = (ULONG)llVbn;
93 *Lbn = (ULONG)llLbn;
94 *SectorCount = (ULONG)llSectorCount;
95
96 /* And return the original value */
97 return(Return);
98 }
99
100
101 /*
102 * @unimplemented
103 */
104 VOID STDCALL
105 FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb,
106 IN POOL_TYPE PoolType)
107 {
108 UNIMPLEMENTED;
109 Mcb->BaseMcb.PoolType = PoolType;
110 }
111
112 /*
113 * FsRtlInitializeMcb: Obsolete
114 * @implemented
115 */
116 VOID STDCALL
117 FsRtlInitializeMcb (IN PMCB Mcb,
118 IN POOL_TYPE PoolType)
119 {
120 FsRtlInitializeLargeMcb(& Mcb->DummyFieldThatSizesThisStructureCorrectly, PoolType);
121 }
122
123
124 /*
125 * @unimplemented
126 */
127 BOOLEAN STDCALL
128 FsRtlLookupLargeMcbEntry(IN PLARGE_MCB Mcb,
129 IN LONGLONG Vbn,
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)
135 {
136 UNIMPLEMENTED;
137 return(FALSE);
138 }
139
140 /*
141 * @unimplemented
142 */
143 BOOLEAN
144 STDCALL
145 FsRtlLookupLastLargeMcbEntryAndIndex (
146 IN PLARGE_MCB OpaqueMcb,
147 OUT PLONGLONG LargeVbn,
148 OUT PLONGLONG LargeLbn,
149 OUT PULONG Index
150 )
151 {
152 UNIMPLEMENTED;
153 return(FALSE);
154 }
155
156 /*
157 * @unimplemented
158 */
159 PFSRTL_PER_STREAM_CONTEXT
160 STDCALL
161 FsRtlLookupPerStreamContextInternal (
162 IN PFSRTL_ADVANCED_FCB_HEADER StreamContext,
163 IN PVOID OwnerId OPTIONAL,
164 IN PVOID InstanceId OPTIONAL
165 )
166 {
167 UNIMPLEMENTED;
168 return(FALSE);
169 }
170
171 /*
172 * @unimplemented
173 */
174 PVOID /* PFSRTL_PER_FILE_OBJECT_CONTEXT*/
175 STDCALL
176 FsRtlLookupPerFileObjectContext (
177 IN PFSRTL_ADVANCED_FCB_HEADER StreamContext,
178 IN PVOID OwnerId OPTIONAL,
179 IN PVOID InstanceId OPTIONAL
180 )
181 {
182 UNIMPLEMENTED;
183 return(FALSE);
184 }
185
186 /*
187 * @unimplemented
188 */
189 BOOLEAN STDCALL
190 FsRtlLookupLastLargeMcbEntry(IN PLARGE_MCB Mcb,
191 OUT PLONGLONG Vbn,
192 OUT PLONGLONG Lbn)
193 {
194 UNIMPLEMENTED;
195 return(FALSE);
196 }
197
198
199 /*
200 * @implemented
201 */
202 BOOLEAN STDCALL
203 FsRtlLookupLastMcbEntry(IN PMCB Mcb,
204 OUT PVBN Vbn,
205 OUT PLBN Lbn)
206 {
207 BOOLEAN Return = FALSE;
208 LONGLONG llVbn;
209 LONGLONG llLbn;
210
211 /* Call the Large version */
212 Return = FsRtlLookupLastLargeMcbEntry(&Mcb->DummyFieldThatSizesThisStructureCorrectly,
213 &llVbn,
214 &llLbn);
215
216 /* Return everything typecasted */
217 *Vbn = (ULONG)llVbn;
218 *Lbn = (ULONG)llLbn;
219
220 /* And return the original value */
221 return(Return);
222 }
223
224
225 /*
226 * @implemented
227 */
228 BOOLEAN STDCALL
229 FsRtlLookupMcbEntry(IN PMCB Mcb,
230 IN VBN Vbn,
231 OUT PLBN Lbn,
232 OUT PULONG SectorCount OPTIONAL,
233 OUT PULONG Index)
234 {
235 BOOLEAN Return = FALSE;
236 LONGLONG llLbn;
237 LONGLONG llSectorCount;
238
239 /* Call the Large version */
240 Return = FsRtlLookupLargeMcbEntry(&Mcb->DummyFieldThatSizesThisStructureCorrectly,
241 (LONGLONG)Vbn,
242 &llLbn,
243 &llSectorCount,
244 NULL,
245 NULL,
246 Index);
247
248 /* Return everything typecasted */
249 *Lbn = (ULONG)llLbn;
250 if (SectorCount) *SectorCount = (ULONG)llSectorCount;
251
252 /* And return the original value */
253 return(Return);
254 }
255
256
257 /*
258 * @implemented
259 */
260 ULONG STDCALL
261 FsRtlNumberOfRunsInLargeMcb(IN PLARGE_MCB Mcb)
262 {
263 ULONG NumberOfRuns;
264 ExAcquireFastMutex (Mcb->FastMutex);
265 NumberOfRuns=Mcb->BaseMcb.MaximumPairCount;
266 ExReleaseFastMutex (Mcb->FastMutex);
267 return(NumberOfRuns);
268 }
269
270
271 /*
272 * FsRtlNumberOfRunsInMcb: Obsolete
273 *
274 * @implemented
275 */
276 ULONG STDCALL
277 FsRtlNumberOfRunsInMcb (IN PMCB Mcb)
278 {
279 return FsRtlNumberOfRunsInLargeMcb(& Mcb->DummyFieldThatSizesThisStructureCorrectly);
280 }
281
282
283 /*
284 * @unimplemented
285 */
286 VOID STDCALL
287 FsRtlRemoveLargeMcbEntry(IN PLARGE_MCB Mcb,
288 IN LONGLONG Vbn,
289 IN LONGLONG SectorCount)
290 {
291 UNIMPLEMENTED;
292 }
293
294
295 /*
296 * @implemented
297 */
298 VOID STDCALL
299 FsRtlRemoveMcbEntry (IN PMCB Mcb,
300 IN VBN Vbn,
301 IN ULONG SectorCount)
302 {
303 /* Call the large function */
304 return FsRtlRemoveLargeMcbEntry(&Mcb->DummyFieldThatSizesThisStructureCorrectly,
305 (LONGLONG)Vbn,
306 (LONGLONG)SectorCount);
307 }
308
309
310 /*
311 * @unimplemented
312 */
313 VOID
314 STDCALL
315 FsRtlResetLargeMcb (
316 IN PLARGE_MCB Mcb,
317 IN BOOLEAN SelfSynchronized
318 )
319 {
320 UNIMPLEMENTED;
321 }
322
323 /*
324 * @unimplemented
325 */
326 BOOLEAN STDCALL
327 FsRtlSplitLargeMcb(IN PLARGE_MCB Mcb,
328 IN LONGLONG Vbn,
329 IN LONGLONG Amount)
330 {
331 UNIMPLEMENTED;
332 return(FALSE);
333 }
334
335
336 /*
337 * @unimplemented
338 */
339 VOID STDCALL
340 FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb,
341 IN LONGLONG Vbn)
342 {
343 UNIMPLEMENTED;
344 }
345
346
347 /*
348 * FsRtlTruncateMcb: Obsolete
349 *
350 * @implemented
351 */
352 VOID STDCALL
353 FsRtlTruncateMcb (IN PMCB Mcb,
354 IN VBN Vbn)
355 {
356 FsRtlTruncateLargeMcb (& Mcb->DummyFieldThatSizesThisStructureCorrectly, (LONGLONG) Vbn);
357 }
358
359
360 /*
361 * @unimplemented
362 */
363 VOID STDCALL
364 FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb)
365 {
366 UNIMPLEMENTED;
367 }
368
369 /*
370 * FsRtlUninitializeMcb: Obsolete
371 *
372 * @implemented
373 */
374 VOID STDCALL
375 FsRtlUninitializeMcb (IN PMCB Mcb)
376 {
377 FsRtlUninitializeLargeMcb(& Mcb->DummyFieldThatSizesThisStructureCorrectly);
378 }
379
380
381 /* EOF */
382