ReactOS 0.4.15-dev-7953-g1f49173
cache.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
24 fcb* fcb = FileObject->FsContext;
25
26 TRACE("(%p, %u)\n", Context, Wait);
27
28 if (!ExAcquireResourceSharedLite(&fcb->Vcb->tree_lock, Wait))
29 return false;
30
32 ExReleaseResourceLite(&fcb->Vcb->tree_lock);
33 return false;
34 }
35
37
39
40 return true;
41}
42
45 fcb* fcb = FileObject->FsContext;
46
47 TRACE("(%p)\n", Context);
48
50
52
53 ExReleaseResourceLite(&fcb->Vcb->tree_lock);
54
57}
58
61 fcb* fcb = FileObject->FsContext;
62
63 TRACE("(%p, %u)\n", Context, Wait);
64
66 return false;
67
69
70 return true;
71}
72
75 fcb* fcb = FileObject->FsContext;
76
77 TRACE("(%p)\n", Context);
78
80
83}
84
85void init_cache() {
90}
unsigned char BOOLEAN
#define NULL
Definition: types.h:112
static BOOLEAN __stdcall acquire_for_read_ahead(PVOID Context, BOOLEAN Wait)
Definition: cache.c:59
CACHE_MANAGER_CALLBACKS cache_callbacks
Definition: cache.c:20
void init_cache()
Definition: cache.c:85
static BOOLEAN __stdcall acquire_for_lazy_write(PVOID Context, BOOLEAN Wait)
Definition: cache.c:22
static void __stdcall release_from_read_ahead(PVOID Context)
Definition: cache.c:73
static void __stdcall release_from_lazy_write(PVOID Context)
Definition: cache.c:43
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
#define ExAcquireResourceSharedLite(res, wait)
Definition: env_spec_w32.h:621
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
#define KeGetCurrentThread
Definition: hal.h:55
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
#define TRACE(s)
Definition: solgame.cpp:4
PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite
Definition: cctypes.h:39
PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite
Definition: cctypes.h:40
PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead
Definition: cctypes.h:41
PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead
Definition: cctypes.h:42
PKTHREAD lazy_writer_thread
Definition: btrfs_drv.h:296
struct _device_extension * Vcb
Definition: btrfs_drv.h:287
FSRTL_ADVANCED_FCB_HEADER Header
Definition: btrfs_drv.h:283
#define __stdcall
Definition: typedefs.h:25
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
* PFILE_OBJECT
Definition: iotypes.h:1998