ReactOS  0.4.15-dev-499-g1f31905
fastio.c
Go to the documentation of this file.
1 /* Copyright (c) Mark Harmstone 2016-17
2  *
3  * This file is part of WinBtrfs.
4  *
5  * WinBtrfs is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public Licence as published by
7  * the Free Software Foundation, either version 3 of the Licence, or
8  * (at your option) any later version.
9  *
10  * WinBtrfs 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 Lesser General Public Licence for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public Licence
16  * along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
17 
18 #include "btrfs_drv.h"
19 
21 
22 _Function_class_(FAST_IO_QUERY_BASIC_INFO)
23 static BOOLEAN __stdcall fast_query_basic_info(PFILE_OBJECT FileObject, BOOLEAN wait, PFILE_BASIC_INFORMATION fbi,
25  fcb* fcb;
26  ccb* ccb;
27 
29 
30  TRACE("(%p, %u, %p, %p, %p)\n", FileObject, wait, fbi, IoStatus, DeviceObject);
31 
32  if (!FileObject) {
34  return false;
35  }
36 
37  fcb = FileObject->FsContext;
38 
39  if (!fcb) {
41  return false;
42  }
43 
44  ccb = FileObject->FsContext2;
45 
46  if (!ccb) {
48  return false;
49  }
50 
53  return false;
54  }
55 
56  if (fcb->ads) {
57  if (!ccb->fileref || !ccb->fileref->parent || !ccb->fileref->parent->fcb) {
59  return false;
60  }
61 
62  fcb = ccb->fileref->parent->fcb;
63  }
64 
65  if (!ExAcquireResourceSharedLite(fcb->Header.Resource, wait)) {
67  return false;
68  }
69 
70  if (fcb == fcb->Vcb->dummy_fcb) {
72 
74  fbi->CreationTime = fbi->LastAccessTime = fbi->LastWriteTime = fbi->ChangeTime = time;
75  } else {
80  }
81 
83 
84  IoStatus->Status = STATUS_SUCCESS;
85  IoStatus->Information = sizeof(FILE_BASIC_INFORMATION);
86 
87  ExReleaseResourceLite(fcb->Header.Resource);
88 
90 
91  return true;
92 }
93 
94 _Function_class_(FAST_IO_QUERY_STANDARD_INFO)
95 static BOOLEAN __stdcall fast_query_standard_info(PFILE_OBJECT FileObject, BOOLEAN wait, PFILE_STANDARD_INFORMATION fsi,
97  fcb* fcb;
98  ccb* ccb;
99  bool ads;
100  ULONG adssize;
101 
103 
104  TRACE("(%p, %u, %p, %p, %p)\n", FileObject, wait, fsi, IoStatus, DeviceObject);
105 
106  if (!FileObject) {
108  return false;
109  }
110 
111  fcb = FileObject->FsContext;
112  ccb = FileObject->FsContext2;
113 
114  if (!fcb) {
116  return false;
117  }
118 
119  if (!ExAcquireResourceSharedLite(fcb->Header.Resource, wait)) {
121  return false;
122  }
123 
124  ads = fcb->ads;
125 
126  if (ads) {
127  struct _fcb* fcb2;
128 
129  if (!ccb || !ccb->fileref || !ccb->fileref->parent || !ccb->fileref->parent->fcb) {
130  ExReleaseResourceLite(fcb->Header.Resource);
132  return false;
133  }
134 
135  adssize = fcb->adsdata.Length;
136 
137  fcb2 = ccb->fileref->parent->fcb;
138 
139  ExReleaseResourceLite(fcb->Header.Resource);
140 
141  fcb = fcb2;
142 
143  if (!ExAcquireResourceSharedLite(fcb->Header.Resource, wait)) {
145  return false;
146  }
147 
148  fsi->AllocationSize.QuadPart = fsi->EndOfFile.QuadPart = adssize;
150  fsi->Directory = false;
151  } else {
156  }
157 
158  fsi->DeletePending = ccb->fileref ? ccb->fileref->delete_on_close : false;
159 
160  IoStatus->Status = STATUS_SUCCESS;
161  IoStatus->Information = sizeof(FILE_STANDARD_INFORMATION);
162 
163  ExReleaseResourceLite(fcb->Header.Resource);
164 
166 
167  return true;
168 }
169 
170 _Function_class_(FAST_IO_CHECK_IF_POSSIBLE)
174  fcb* fcb = FileObject->FsContext;
175  LARGE_INTEGER len2;
176 
177  UNUSED(Wait);
178  UNUSED(IoStatus);
180 
181  len2.QuadPart = Length;
182 
183  if (CheckForReadOperation) {
185  return true;
186  } else {
188  return true;
189  }
190 
191  return false;
192 }
193 
194 _Function_class_(FAST_IO_QUERY_NETWORK_OPEN_INFO)
195 static BOOLEAN __stdcall fast_io_query_network_open_info(PFILE_OBJECT FileObject, BOOLEAN Wait, FILE_NETWORK_OPEN_INFORMATION* fnoi,
197  fcb* fcb;
198  ccb* ccb;
199  file_ref* fileref;
200 
202 
203  TRACE("(%p, %u, %p, %p, %p)\n", FileObject, Wait, fnoi, IoStatus, DeviceObject);
204 
206 
207  fcb = FileObject->FsContext;
208 
209  if (!fcb || fcb == fcb->Vcb->volume_fcb) {
211  return false;
212  }
213 
214  ccb = FileObject->FsContext2;
215 
216  if (!ccb) {
218  return false;
219  }
220 
221  fileref = ccb->fileref;
222 
223  if (fcb == fcb->Vcb->dummy_fcb) {
225 
227  fnoi->CreationTime = fnoi->LastAccessTime = fnoi->LastWriteTime = fnoi->ChangeTime = time;
228  } else {
229  INODE_ITEM* ii;
230 
231  if (fcb->ads) {
232  if (!fileref || !fileref->parent) {
233  ERR("no fileref for stream\n");
235  return false;
236  }
237 
238  ii = &fileref->parent->fcb->inode_item;
239  } else
240  ii = &fcb->inode_item;
241 
246  }
247 
248  if (fcb->ads) {
250  fnoi->FileAttributes = fileref->parent->fcb->atts == 0 ? FILE_ATTRIBUTE_NORMAL : fileref->parent->fcb->atts;
251  } else {
255  }
256 
258 
259  return true;
260 }
261 
262 _Function_class_(FAST_IO_ACQUIRE_FOR_MOD_WRITE)
263 static NTSTATUS __stdcall fast_io_acquire_for_mod_write(PFILE_OBJECT FileObject, PLARGE_INTEGER EndingOffset,
265  fcb* fcb;
266 
268 
271 
272  fcb = FileObject->FsContext;
273 
274  if (!fcb)
276 
277  // Make sure we don't get interrupted by the flush thread, which can cause a deadlock
278 
279  if (!ExAcquireResourceSharedLite(&fcb->Vcb->tree_lock, false))
280  return STATUS_CANT_WAIT;
281 
282  if (!ExAcquireResourceExclusiveLite(fcb->Header.Resource, false)) {
283  ExReleaseResourceLite(&fcb->Vcb->tree_lock);
284  TRACE("returning STATUS_CANT_WAIT\n");
285  return STATUS_CANT_WAIT;
286  }
287 
288  // Ideally this would be PagingIoResource, but that doesn't play well with copy-on-write,
289  // as we can't guarantee that we won't need to do any reallocations.
290 
291  *ResourceToRelease = fcb->Header.Resource;
292 
293  TRACE("returning STATUS_SUCCESS\n");
294 
295  return STATUS_SUCCESS;
296 }
297 
298 _Function_class_(FAST_IO_RELEASE_FOR_MOD_WRITE)
299 static NTSTATUS __stdcall fast_io_release_for_mod_write(PFILE_OBJECT FileObject, struct _ERESOURCE *ResourceToRelease,
301  fcb* fcb;
302 
303  TRACE("(%p, %p, %p)\n", FileObject, ResourceToRelease, DeviceObject);
304 
306 
307  fcb = FileObject->FsContext;
308 
310 
311  ExReleaseResourceLite(&fcb->Vcb->tree_lock);
312 
313  return STATUS_SUCCESS;
314 }
315 
316 _Function_class_(FAST_IO_ACQUIRE_FOR_CCFLUSH)
317 static NTSTATUS __stdcall fast_io_acquire_for_ccflush(PFILE_OBJECT FileObject, PDEVICE_OBJECT DeviceObject) {
320 
322 
323  return STATUS_SUCCESS;
324 }
325 
326 _Function_class_(FAST_IO_RELEASE_FOR_CCFLUSH)
327 static NTSTATUS __stdcall fast_io_release_for_ccflush(PFILE_OBJECT FileObject, PDEVICE_OBJECT DeviceObject) {
330 
333 
334  return STATUS_SUCCESS;
335 }
336 
337 _Function_class_(FAST_IO_WRITE)
339  fcb* fcb = FileObject->FsContext;
340  bool ret;
341 
343 
344  if (!ExAcquireResourceSharedLite(&fcb->Vcb->tree_lock, Wait)) {
346  return false;
347  }
348 
349  if (!ExAcquireResourceExclusiveLite(fcb->Header.Resource, Wait)) {
350  ExReleaseResourceLite(&fcb->Vcb->tree_lock);
352  return false;
353  }
354 
356 
357  if (ret)
358  fcb->inode_item.st_size = fcb->Header.FileSize.QuadPart;
359 
360  ExReleaseResourceLite(fcb->Header.Resource);
361  ExReleaseResourceLite(&fcb->Vcb->tree_lock);
362 
364 
365  return ret;
366 }
367 
368 _Function_class_(FAST_IO_LOCK)
372  BOOLEAN ret;
373  fcb* fcb = FileObject->FsContext;
374 
375  TRACE("(%p, %I64x, %I64x, %p, %lx, %u, %u, %p, %p)\n", FileObject, FileOffset ? FileOffset->QuadPart : 0, Length ? Length->QuadPart : 0,
377 
378  if (fcb->type != BTRFS_TYPE_FILE) {
379  WARN("can only lock files\n");
381  IoStatus->Information = 0;
382  return true;
383  }
384 
386  ExAcquireResourceSharedLite(fcb->Header.Resource, true);
387 
389  ExclusiveLock, IoStatus, NULL, false);
390 
391  if (ret)
392  fcb->Header.IsFastIoPossible = fast_io_possible(fcb);
393 
394  ExReleaseResourceLite(fcb->Header.Resource);
396 
397  return ret;
398 }
399 
400 _Function_class_(FAST_IO_UNLOCK_SINGLE)
403  fcb* fcb = FileObject->FsContext;
404 
405  TRACE("(%p, %I64x, %I64x, %p, %lx, %p, %p)\n", FileObject, FileOffset ? FileOffset->QuadPart : 0, Length ? Length->QuadPart : 0,
407 
408  IoStatus->Information = 0;
409 
410  if (fcb->type != BTRFS_TYPE_FILE) {
411  WARN("can only lock files\n");
413  return true;
414  }
415 
417 
419 
420  fcb->Header.IsFastIoPossible = fast_io_possible(fcb);
421 
423 
424  return true;
425 }
426 
427 _Function_class_(FAST_IO_UNLOCK_ALL)
429  fcb* fcb = FileObject->FsContext;
430 
431  TRACE("(%p, %p, %p, %p)\n", FileObject, ProcessId, IoStatus, DeviceObject);
432 
433  IoStatus->Information = 0;
434 
435  if (fcb->type != BTRFS_TYPE_FILE) {
436  WARN("can only lock files\n");
438  return true;
439  }
440 
442 
443  ExAcquireResourceSharedLite(fcb->Header.Resource, true);
444 
446 
447  fcb->Header.IsFastIoPossible = fast_io_possible(fcb);
448 
449  ExReleaseResourceLite(fcb->Header.Resource);
450 
452 
453  return true;
454 }
455 
456 _Function_class_(FAST_IO_UNLOCK_ALL_BY_KEY)
457 static BOOLEAN __stdcall fast_io_unlock_all_by_key(PFILE_OBJECT FileObject, PVOID ProcessId, ULONG Key,
459  fcb* fcb = FileObject->FsContext;
460 
461  TRACE("(%p, %p, %lx, %p, %p)\n", FileObject, ProcessId, Key, IoStatus, DeviceObject);
462 
463  IoStatus->Information = 0;
464 
465  if (fcb->type != BTRFS_TYPE_FILE) {
466  WARN("can only lock files\n");
468  return true;
469  }
470 
472 
473  ExAcquireResourceSharedLite(fcb->Header.Resource, true);
474 
476 
477  fcb->Header.IsFastIoPossible = fast_io_possible(fcb);
478 
479  ExReleaseResourceLite(fcb->Header.Resource);
480 
482 
483  return true;
484 }
485 
488 
490 
491  FastIoDispatch.FastIoCheckIfPossible = fast_io_check_if_possible;
493  FastIoDispatch.FastIoWrite = fast_io_write;
494  FastIoDispatch.FastIoQueryBasicInfo = fast_query_basic_info;
495  FastIoDispatch.FastIoQueryStandardInfo = fast_query_standard_info;
496  FastIoDispatch.FastIoLock = fast_io_lock;
497  FastIoDispatch.FastIoUnlockSingle = fast_io_unlock_single;
498  FastIoDispatch.FastIoUnlockAll = fast_io_unlock_all;
499  FastIoDispatch.FastIoUnlockAllByKey = fast_io_unlock_all_by_key;
500  FastIoDispatch.FastIoQueryNetworkOpenInfo = fast_io_query_network_open_info;
501  FastIoDispatch.AcquireForModWrite = fast_io_acquire_for_mod_write;
506  FastIoDispatch.ReleaseForModWrite = fast_io_release_for_mod_write;
507  FastIoDispatch.AcquireForCcFlush = fast_io_acquire_for_ccflush;
508  FastIoDispatch.ReleaseForCcFlush = fast_io_release_for_ccflush;
509 
510  *fiod = &FastIoDispatch;
511 }
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
struct _file_ref * parent
Definition: btrfs_drv.h:368
_In_ PLARGE_INTEGER EndingOffset
Definition: iotypes.h:1556
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2706
PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle
Definition: iotypes.h:1699
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:752
#define FsRtlEnterFileSystem
adns_state ads
Definition: adh-query.c:35
BTRFS_TIME otime
Definition: btrfs.h:296
#define FsRtlExitFileSystem
BOOLEAN NTAPI FsRtlMdlReadCompleteDev(IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1011
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2659
LARGE_INTEGER LastAccessTime
Definition: nt_native.h:940
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ PLARGE_INTEGER _Out_ struct _ERESOURCE ** ResourceToRelease
Definition: iotypes.h:1557
BOOLEAN NTAPI FsRtlMdlWriteCompleteDev(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1198
#define WARN(fmt,...)
Definition: debug.h:112
LONG NTSTATUS
Definition: precomp.h:26
void init_fast_io_dispatch(FAST_IO_DISPATCH **fiod)
Definition: fastio.c:486
PFAST_IO_MDL_READ MdlRead
Definition: iotypes.h:1708
PFAST_IO_PREPARE_MDL_WRITE PrepareMdlWrite
Definition: iotypes.h:1710
PFAST_IO_UNLOCK_ALL FastIoUnlockAll
Definition: iotypes.h:1700
PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo
Definition: iotypes.h:1706
__u16 time
Definition: mkdosfs.c:366
ACCESS_MASK access
Definition: btrfs_drv.h:398
BOOLEAN NTAPI FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG LockKey, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1272
PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite
Definition: iotypes.h:1717
PFAST_IO_MDL_READ_COMPLETE MdlReadComplete
Definition: iotypes.h:1709
BTRFS_TIME st_ctime
Definition: btrfs.h:294
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN CheckForReadOperation
Definition: fatprocs.h:2659
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
NTSTATUS NTAPI FsRtlFastUnlockAllByKey(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN ULONG Key, IN PVOID Context OPTIONAL)
Definition: filelock.c:1087
NTSTATUS NTAPI FsRtlFastUnlockSingle(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN PEPROCESS Process, IN ULONG Key, IN PVOID Context OPTIONAL, IN BOOLEAN AlreadySynchronized)
Definition: filelock.c:829
static __inline bool is_subvol_readonly(root *r, PIRP Irp)
Definition: btrfs_drv.h:1041
PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo
Definition: iotypes.h:1696
uint32_t st_nlink
Definition: btrfs.h:285
_Function_class_(FAST_IO_QUERY_BASIC_INFO)
Definition: fastio.c:22
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG BOOLEAN FailImmediately
Definition: fatprocs.h:2706
struct _FAST_IO_DISPATCH FAST_IO_DISPATCH
#define PsGetCurrentProcess
Definition: psfuncs.h:17
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define UNUSED(x)
Definition: btrfs_drv.h:86
uint8_t type
Definition: btrfs_drv.h:302
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:588
BTRFS_TIME st_mtime
Definition: btrfs.h:295
static __inline uint64_t unix_time_to_win(BTRFS_TIME *t)
Definition: recv.cpp:1180
FILE_LOCK lock
Definition: btrfs_drv.h:305
BOOLEAN NTAPI FsRtlMdlReadDev(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG LockKey, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1025
FSRTL_ADVANCED_FCB_HEADER Header
Definition: btrfs_drv.h:294
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2659
uint64_t st_size
Definition: btrfs.h:282
#define TRACE(s)
Definition: solgame.cpp:4
LARGE_INTEGER LastWriteTime
Definition: nt_native.h:941
struct _fcb fcb
Definition: btrfs_drv.h:1357
#define S_ISDIR(mode)
Definition: various.h:18
PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey
Definition: iotypes.h:1701
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
struct _file_ref * fileref
Definition: btrfs_drv.h:316
#define __stdcall
Definition: typedefs.h:25
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
LARGE_INTEGER AllocationSize
Definition: propsheet.cpp:54
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
* PFILE_OBJECT
Definition: iotypes.h:1957
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
BTRFS_TIME st_atime
Definition: btrfs.h:293
int ret
PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush
Definition: iotypes.h:1718
LARGE_INTEGER CreationTime
Definition: nt_native.h:939
PFAST_IO_LOCK FastIoLock
Definition: iotypes.h:1698
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
#define FILE_STANDARD_INFORMATION
Definition: disk.h:54
NTSTATUS NTAPI FsRtlFastUnlockAll(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN PVOID Context OPTIONAL)
Definition: filelock.c:1026
static __inline FAST_IO_POSSIBLE fast_io_possible(fcb *fcb)
Definition: btrfs_drv.h:1690
INODE_ITEM inode_item
Definition: btrfs_drv.h:303
LARGE_INTEGER ChangeTime
Definition: nt_native.h:942
PFAST_IO_ACQUIRE_FOR_MOD_WRITE AcquireForModWrite
Definition: iotypes.h:1707
#define ERR(fmt,...)
Definition: debug.h:110
FAST_IO_DISPATCH FastIoDispatch
Definition: fastio.c:20
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1694
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
PFAST_IO_WRITE FastIoWrite
Definition: iotypes.h:1695
ULONG atts
Definition: btrfs_drv.h:308
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
static __inline uint64_t fcb_alloc_size(fcb *fcb)
Definition: btrfs_drv.h:1870
struct _root * subvol
Definition: btrfs_drv.h:299
ANSI_STRING adsdata
Definition: btrfs_drv.h:345
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
Definition: iotypes.h:1697
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG BOOLEAN BOOLEAN ExclusiveLock
Definition: fatprocs.h:2706
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
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
#define BTRFS_TYPE_FILE
Definition: shellext.h:85
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
bool ads
Definition: btrfs_drv.h:341
PFAST_IO_MDL_WRITE_COMPLETE MdlWriteComplete
Definition: iotypes.h:1711
unsigned int ULONG
Definition: retypes.h:1
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
Definition: iotypes.h:1693
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
struct _ccb ccb
file_ref * fileref
Definition: btrfs_drv.h:399
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
return STATUS_SUCCESS
Definition: btrfs.c:3014
PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush
Definition: iotypes.h:1719
#define FsRtlFastLock(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)
Definition: fsrtlfuncs.h:1581
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:786
struct _device_extension * Vcb
Definition: btrfs_drv.h:298
LONGLONG QuadPart
Definition: typedefs.h:113
ULONG SizeOfFastIoDispatch
Definition: iotypes.h:1692
#define STATUS_CANT_WAIT
Definition: ntstatus.h:438
IN BOOLEAN Wait
Definition: fatprocs.h:1538
uint32_t st_mode
Definition: btrfs.h:288
#define FILE_BASIC_INFORMATION
Definition: disk.h:53
bool delete_on_close
Definition: btrfs_drv.h:360