ReactOS 0.4.17-dev-1196-gb6224c3
fastio.c
Go to the documentation of this file.
1/*
2 * ReactOS kernel
3 * Copyright (C) 2008 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 * COPYRIGHT: See COPYING in the top level directory
20 * PROJECT: ReactOS kernel
21 * FILE: drivers/filesystem/ntfs/fastio.c
22 * PURPOSE: NTFS filesystem driver
23 * PROGRAMMER: Pierre Schweitzer
24 */
25
26/* INCLUDES *****************************************************************/
27
28#include <ntddk.h>
29
30#define NDEBUG
31#include <debug.h>
32
33#include "ntfs.h"
34
35/* FUNCTIONS ****************************************************************/
36
42{
44
46
47 /* The paging writes below take it shared as well, size changes exclude us */
49 return FALSE;
50
51 /* Let Cc know it doesn't have to acquire the file again for the flush */
52 if (IoGetTopLevelIrp() == NULL)
54
55 return TRUE;
56}
57
58
59VOID
63{
65
67
70
72}
73
74
80{
82
84
85 /* Keep size changes out while we read ahead */
87 return FALSE;
88
89 if (IoGetTopLevelIrp() == NULL)
91
92 return TRUE;
93}
94
95
96VOID
100{
102
104
107
109}
110
112NTAPI
122{
123 PNTFS_FCB Fcb = (PNTFS_FCB)FileObject->FsContext;
124 LARGE_INTEGER LargeLength;
125
128
129 LargeLength.QuadPart = Length;
131
133 return FALSE;
134
136 (Fcb->Vcb->Flags & VCB_VOLUME_DISMOUNTED))
137 {
138 return FALSE;
139 }
140
142 {
145 }
146
150 {
151 return FALSE;
152 }
153
154 /* Growing the file updates its record, leave that to the IRP path */
155 return (FileOffset->QuadPart + Length <= Fcb->RFCB.FileSize.QuadPart);
156}
157
159NTAPI
169{
171 return FALSE;
172
174}
175
177NTAPI
187{
189 return FALSE;
190
192}
193
194/* EOF */
unsigned char BOOLEAN
Definition: actypes.h:127
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:160
_In_ PFCB Fcb
Definition: cdprocs.h:159
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID NTAPI NtfsRelLazyWrite(_In_ PVOID Context)
Definition: fastio.c:61
BOOLEAN NTAPI NtfsAcqLazyWrite(_In_ PVOID Context, _In_ BOOLEAN Wait)
Definition: fastio.c:39
VOID NTAPI NtfsRelReadAhead(_In_ PVOID Context)
Definition: fastio.c:98
BOOLEAN NTAPI NtfsAcqReadAhead(_In_ PVOID Context, _In_ BOOLEAN Wait)
Definition: fastio.c:77
PNTFS_GLOBAL_DATA NtfsGlobalData
Definition: ntfs.c:36
FAST_IO_CHECK_IF_POSSIBLE NtfsFastIoCheckIfPossible
Definition: ntfs.h:1043
#define VCB_VOLUME_DISMOUNTED
Definition: ntfs.h:148
FAST_IO_READ NtfsFastIoRead
Definition: ntfs.h:1044
struct _FCB * PNTFS_FCB
FAST_IO_WRITE NtfsFastIoWrite
Definition: ntfs.h:1045
#define NTFS_TYPE_FCB
Definition: ntfs.h:89
#define ExAcquireResourceSharedLite(res, wait)
Definition: env_spec_w32.h:621
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2666
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN CheckForReadOperation
Definition: fatprocs.h:2667
BOOLEAN NTAPI FsRtlFastCheckLockForWrite(IN PFILE_LOCK FileLock, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN ULONG Key, IN PFILE_OBJECT FileObject, IN PVOID Process)
Definition: filelock.c:784
BOOLEAN NTAPI FsRtlFastCheckLockForRead(IN PFILE_LOCK FileLock, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN ULONG Key, IN PFILE_OBJECT FileObject, IN PVOID Process)
Definition: filelock.c:750
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
#define ASSERT(a)
Definition: mode.c:44
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
BOOLEAN NtfsFCBIsEncrypted(PNTFS_FCB Fcb)
Definition: fcb.c:179
BOOLEAN NTAPI NtfsIsRegularFileObject(_In_ PFILE_OBJECT FileObject)
Definition: fcb.c:153
BOOLEAN NtfsFCBIsCompressed(PNTFS_FCB Fcb)
Definition: fcb.c:173
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
BOOLEAN NTAPI FsRtlCopyRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:64
BOOLEAN NTAPI FsRtlCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:264
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1875
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2032
ULONG Type
Definition: ntfs.h:96
BOOLEAN EnableWriteSupport
Definition: ntfs.h:182
Definition: cdstruc.h:902
PVCB Vcb
Definition: cdstruc.h:933
ERESOURCE PagingIoResource
Definition: ntfs.h:606
NTFSIDENTIFIER Identifier
Definition: ntfs.h:595
FILE_LOCK FileLock
Definition: fatstruc.h:1071
ERESOURCE MainResource
Definition: ntfs.h:607
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2061
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
* PFILE_OBJECT
Definition: iotypes.h:1998
#define PsGetCurrentProcess
Definition: psfuncs.h:17