24#define _WIN32_WINNT 0x0601
25#define NTDDI_VERSION 0x06020000
26#define _CRT_SECURE_NO_WARNINGS
27#define _NO_CRT_STDIO_INLINE
32#pragma warning(disable:4163)
33#pragma warning(disable:4311)
34#pragma warning(disable:4312)
36#pragma GCC diagnostic push
37#pragma GCC diagnostic ignored "-Wsign-compare"
38#pragma GCC diagnostic ignored "-Wsign-conversion"
58#pragma GCC diagnostic pop
82#define UNUSED(x) (void)(x)
84#define BTRFS_NODE_TYPE_CCB 0x2295
85#define BTRFS_NODE_TYPE_FCB 0x2296
87#define ALLOC_TAG 0x7442484D
88#define ALLOC_TAG_ZLIB 0x7A42484D
90#define UID_NOBODY 65534
91#define GID_NOBODY 65534
93#define EA_NTACL "security.NTACL"
94#define EA_NTACL_HASH 0x45922146
96#define EA_DOSATTRIB "user.DOSATTRIB"
97#define EA_DOSATTRIB_HASH 0x914f9939
99#define EA_REPARSE "user.reparse"
100#define EA_REPARSE_HASH 0xfabad1fe
102#define EA_EA "user.EA"
103#define EA_EA_HASH 0x8270dd43
105#define EA_CASE_SENSITIVE "user.casesensitive"
106#define EA_CASE_SENSITIVE_HASH 0x1a9d97d4
108#define EA_PROP_COMPRESSION "btrfs.compression"
109#define EA_PROP_COMPRESSION_HASH 0x20ccdf69
111#define MAX_EXTENT_SIZE 0x8000000
112#define COMPRESSED_EXTENT_SIZE 0x20000
114#define READ_AHEAD_GRANULARITY COMPRESSED_EXTENT_SIZE
116#ifndef IO_REPARSE_TAG_LX_SYMLINK
118#define IO_REPARSE_TAG_LX_SYMLINK 0xa000001d
120#define IO_REPARSE_TAG_AF_UNIX 0x80000023
121#define IO_REPARSE_TAG_LX_FIFO 0x80000024
122#define IO_REPARSE_TAG_LX_CHR 0x80000025
123#define IO_REPARSE_TAG_LX_BLK 0x80000026
127#define BTRFS_VOLUME_PREFIX L"\\Device\\Btrfs{"
129#if defined(_MSC_VER) || defined(__clang__)
131#define except __except
132#define finally __finally
136#define except(x) if (0 && (x))
137#define finally if (1)
142#ifndef InterlockedIncrement64
143#define InterlockedIncrement64(a) __sync_add_and_fetch(a, 1)
147#ifndef FILE_SUPPORTS_BLOCK_REFCOUNTING
148#define FILE_SUPPORTS_BLOCK_REFCOUNTING 0x08000000
151#ifndef FILE_SUPPORTS_POSIX_UNLINK_RENAME
152#define FILE_SUPPORTS_POSIX_UNLINK_RENAME 0x00000400
155#ifndef FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
156#define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000
165#define FILE_CS_FLAG_CASE_SENSITIVE_DIR 1
172#define FILE_CS_FLAG_CASE_SENSITIVE_DIR 1
182#define FSCTL_DUPLICATE_EXTENTS_TO_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 209, METHOD_BUFFERED, FILE_WRITE_ACCESS)
198#define FSCTL_GET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 159, METHOD_BUFFERED, FILE_ANY_ACCESS)
199#define FSCTL_SET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 160, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
203#define __drv_aliasesMem
204#define _Dispatch_type_(a)
205#define _Lock_level_order_(a,b)
213#define MAX_HASH_SIZE 32
644 unsigned int inlen, outlen, off, space_left;
688#define VCB_TYPE_CONTROL 2
689#define VCB_TYPE_VOLUME 3
690#define VCB_TYPE_PDO 4
691#define VCB_TYPE_BUS 5
693#define BALANCE_OPTS_DATA 0
694#define BALANCE_OPTS_METADATA 1
695#define BALANCE_OPTS_SYSTEM 2
765#ifdef DEBUG_CHUNK_LOCKS
766 LONG chunk_locks_held;
978 if (!
Irp->MdlAddress) {
979 return Irp->UserBuffer;
986 return (
t->seconds * 10000000) + (
t->nanoseconds / 100) + 116444736000000000;
992 out->seconds =
l / 10000000;
1000 startoff = off % (num_stripes * stripe_length);
1001 initoff = (off / (num_stripes * stripe_length)) * stripe_length;
1004 *stripeoff = initoff + startoff - (*
stripe * stripe_length);
1013 return (
r->id << 40) | (
inode & 0xffffffffff);
1016#define keycmp(key1, key2)\
1017 ((key1.obj_id < key2.obj_id) ? -1 :\
1018 ((key1.obj_id > key2.obj_id) ? 1 :\
1019 ((key1.obj_type < key2.obj_type) ? -1 :\
1020 ((key1.obj_type > key2.obj_type) ? 1 :\
1021 ((key1.offset < key2.offset) ? -1 :\
1022 ((key1.offset > key2.offset) ? 1 :\
1028 n = (
n +
a) & ~(
a - 1);
1097#if defined(_X86_) || defined(_AMD64_)
1116#ifndef DEBUG_FCB_REFCOUNTS
1135#ifdef DEBUG_CHUNK_LOCKS
1136#define acquire_chunk_lock(c, Vcb) { ExAcquireResourceExclusiveLite(&c->lock, true); InterlockedIncrement(&Vcb->chunk_locks_held); }
1137#define release_chunk_lock(c, Vcb) { InterlockedDecrement(&Vcb->chunk_locks_held); ExReleaseResourceLite(&c->lock); }
1139#define acquire_chunk_lock(c, Vcb) ExAcquireResourceExclusiveLite(&(c)->lock, true)
1140#define release_chunk_lock(c, Vcb) ExReleaseResourceLite(&(c)->lock)
1174#define funcname __FUNCTION__
1176#define funcname __func__
1197#define __attribute__(x)
1205#ifdef DEBUG_LONG_MESSAGES
1207#define MSG(fn, file, line, s, level, ...) (!log_started || level <= debug_log_level) ? _debug_message(fn, file, line, s, ##__VA_ARGS__) : (void)0
1209#define TRACE(s, ...) MSG(funcname, __FILE__, __LINE__, s, 3, ##__VA_ARGS__)
1210#define WARN(s, ...) MSG(funcname, __FILE__, __LINE__, s, 2, ##__VA_ARGS__)
1211#define FIXME(s, ...) MSG(funcname, __FILE__, __LINE__, s, 1, ##__VA_ARGS__)
1212#define ERR(s, ...) MSG(funcname, __FILE__, __LINE__, s, 1, ##__VA_ARGS__)
1218#define MSG(fn, s, level, ...) (!log_started || level <= debug_log_level) ? _debug_message(fn, s, ##__VA_ARGS__) : (void)0
1220#define TRACE(s, ...) MSG(funcname, s, 3, ##__VA_ARGS__)
1221#define WARN(s, ...) MSG(funcname, s, 2, ##__VA_ARGS__)
1222#define FIXME(s, ...) MSG(funcname, s, 1, ##__VA_ARGS__)
1223#define ERR(s, ...) MSG(funcname, s, 1, ##__VA_ARGS__)
1231#define TRACE(s, ...) do { } while(0)
1232#define WARN(s, ...) do { } while(0)
1233#define FIXME(s, ...) DbgPrint("Btrfs FIXME : %s : " s, funcname, ##__VA_ARGS__)
1234#define ERR(s, ...) DbgPrint("Btrfs ERR : %s : " s, funcname, ##__VA_ARGS__)
1238#ifdef DEBUG_FCB_REFCOUNTS
1240#define free_fcb(fcb) _free_fcb(fcb, funcname)
1248#define SHA256_HASH_SIZE 32
1251void blake2b(
void *
out,
size_t outlen,
const void*
in,
size_t inlen);
1252#define BLAKE2_HASH_SIZE 32
1586 void*
out,
unsigned int outlen,
unsigned int off,
calc_job**
pcj);
1637#define makedev(major, minor) (((minor) & 0xFF) | (((major) & 0xFFF) << 8) | (((uint64_t)((minor) & ~0xFF)) << 12) | (((uint64_t)((major) & ~0xFFF)) << 32))
1655#define FSRTL_FCB_HEADER_V2 2
1658#define FSRTL_ADVANCED_FCB_HEADER_NEW FSRTL_ADVANCED_FCB_HEADER
1669 PVOID ReservedForRemote;
1671 PVOID ReservedContext;
1674#define FSRTL_FCB_HEADER_V2 2
1696 while (le != &
Vcb->trees) {
1699 ERR(
"tree %p: root %I64x, level %u, first key (%I64x,%x,%I64x)\n",
1714 if (
fcb->
Vcb->options.compress_force)
1726#ifdef DEBUG_FCB_REFCOUNTS
1727#ifdef DEBUG_LONG_MESSAGES
1728#define increase_fileref_refcount(fileref) {\
1729 LONG rc = InterlockedIncrement(&fileref->refcount);\
1730 MSG(funcname, __FILE__, __LINE__, "fileref %p: refcount now %i\n", 1, fileref, rc);\
1733#define increase_fileref_refcount(fileref) {\
1734 LONG rc = InterlockedIncrement(&fileref->refcount);\
1735 MSG(funcname, "fileref %p: refcount now %i\n", 1, fileref, rc);\
1739#define increase_fileref_refcount(fileref) InterlockedIncrement(&fileref->refcount)
1743#define int3 __debugbreak()
1745#define int3 asm("int3;")
1748#define hex_digit(c) ((c) <= 9) ? ((c) + '0') : ((c) - 10 + 'a')
1753#define __S_IFMT 0170000
1754#define __S_IFDIR 0040000
1755#define __S_IFCHR 0020000
1756#define __S_IFBLK 0060000
1757#define __S_IFREG 0100000
1758#define __S_IFIFO 0010000
1759#define __S_IFLNK 0120000
1760#define __S_IFSOCK 0140000
1761#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
1764#define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
1768#define S_IRUSR 0000400
1772#define S_IWUSR 0000200
1776#define S_IXUSR 0000100
1780#define S_IFDIR __S_IFDIR
1781#define S_IFREG __S_IFREG
1785#define S_IRGRP (S_IRUSR >> 3)
1789#define S_IWGRP (S_IWUSR >> 3)
1793#define S_IXGRP (S_IXUSR >> 3)
1797#define S_IROTH (S_IRGRP >> 3)
1801#define S_IWOTH (S_IWGRP >> 3)
1805#define S_IXOTH (S_IXGRP >> 3)
1809#define S_ISUID 0004000
1813#define S_ISGID 0002000
1817#define S_ISVTX 0001000
1821#define major(rdev) ((((rdev) >> 8) & 0xFFF) | ((uint32_t)((rdev) >> 32) & ~0xFFF))
1822#define minor(rdev) (((rdev) & 0xFF) | ((uint32_t)((rdev) >> 12) & ~0xFF))
1836 ULONG ReadOperationCount,
ULONG WriteOperationCount,
ULONG FlushOperationCount);
1844#ifndef CC_ENABLE_DISK_IO_ACCOUNTING
1845#define CC_ENABLE_DISK_IO_ACCOUNTING 0x00000010
1848#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA)
1929 IN ULONG ProcessInformationLength,
_STLP_VENDOR_CSTD::ldiv_t div(long __x, long __y)
unsigned short int uint16_t
static __inline uint32_t get_extent_data_refcount(uint8_t type, void *data)
void void void NTSTATUS void NTSTATUS skip_to_difference(device_extension *Vcb, traverse_ptr *tp, traverse_ptr *tp2, bool *ended1, bool *ended2) __attribute__((nonnull(1
NTSTATUS __stdcall compat_FsRtlValidateReparsePointBuffer(IN ULONG BufferLength, IN PREPARSE_DATA_BUFFER ReparseBuffer)
NTSTATUS load_stored_free_space_cache(device_extension *Vcb, chunk *c, bool load_only, PIRP Irp)
void mark_fcb_dirty(_In_ fcb *fcb)
NTSTATUS read_file(fcb *fcb, uint8_t *data, uint64_t start, uint64_t length, ULONG *pbr, PIRP Irp) __attribute__((nonnull(1
struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER * PFSCTL_GET_INTEGRITY_INFORMATION_BUFFER
NTSTATUS(__stdcall * tFsRtlValidateReparsePointBuffer)(ULONG BufferLength, PREPARSE_DATA_BUFFER ReparseBuffer)
void do_shutdown(PIRP Irp)
uint8_t gdiv(uint8_t a, uint8_t b)
NTSTATUS pnp_surprise_removal(PDEVICE_OBJECT DeviceObject, PIRP Irp)
@ Batch_DeleteInodeExtRef
NTSTATUS registry_load_volume_options(device_extension *Vcb)
void reap_filerefs(device_extension *Vcb, file_ref *fr)
NTSTATUS write_file(device_extension *Vcb, PIRP Irp, bool wait, bool deferred_write) __attribute__((nonnull(1
void log_device_error(_In_ device_extension *Vcb, _Inout_ device *dev, _In_ int error)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY * rollback
_Post_satisfies_ static stripe __inline void get_raid0_offset(_In_ uint64_t off, _In_ uint64_t stripe_length, _In_ uint16_t num_stripes, _Out_ uint64_t *stripeoff, _Out_ uint16_t *stripe)
uint64_t get_extent_refcount(device_extension *Vcb, uint64_t address, uint64_t size, PIRP Irp)
static __inline FAST_IO_POSSIBLE fast_io_possible(fcb *fcb)
CACHE_MANAGER_CALLBACKS cache_callbacks
NTSTATUS zlib_compress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen, unsigned int level, unsigned int *space_left)
NTSTATUS get_device_pnp_name(_In_ PDEVICE_OBJECT DeviceObject, _Out_ PUNICODE_STRING pnp_name, _Out_ const GUID **guid)
bool add_thread_job(device_extension *Vcb, PIRP Irp)
NTSTATUS delete_fileref(_In_ file_ref *fileref, _In_opt_ PFILE_OBJECT FileObject, _In_ bool make_orphan, _In_opt_ PIRP Irp, _In_ LIST_ENTRY *rollback)
void free_fileref(_Inout_ file_ref *fr)
VOID(NTAPI * PPS_POST_PROCESS_INIT_ROUTINE)(VOID)
NTSTATUS stop_scrub(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER * PFSCTL_SET_INTEGRITY_INFORMATION_BUFFER
static __inline void print_open_trees(device_extension *Vcb)
uint64_t find_extent_shared_tree_refcount(device_extension *Vcb, uint64_t address, uint64_t parent, PIRP Irp)
NTSTATUS query_balance(device_extension *Vcb, void *data, ULONG length)
uint8_t gmul(uint8_t a, uint8_t b)
struct _file_ref file_ref
NTSTATUS flush_fcb(fcb *fcb, bool cache, LIST_ENTRY *batchlist, PIRP Irp)
void add_user_mapping(WCHAR *sidstring, ULONG sidstringlength, uint32_t uid)
void do_calc_job(device_extension *Vcb, uint8_t *data, uint32_t sectors, void *csum)
void disk_arrival(PUNICODE_STRING devpath)
NTSTATUS(__stdcall * tIoUnregisterPlugPlayNotificationEx)(PVOID NotificationEntry)
void void free_trees_root(device_extension *Vcb, root *r) __attribute__((nonnull(1
void add_trim_entry_avoid_sb(device_extension *Vcb, device *dev, uint64_t address, uint64_t size)
NTSTATUS resume_balance(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
NTSTATUS pause_scrub(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void * data
NTSTATUS zlib_decompress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen)
void galois_double(uint8_t *data, uint32_t len)
NTSTATUS load_cache_chunk(device_extension *Vcb, chunk *c, PIRP Irp)
NTSTATUS NTSTATUS write_file2(device_extension *Vcb, PIRP Irp, LARGE_INTEGER offset, void *buf, ULONG *length, bool paging_io, bool no_cache, bool wait, bool deferred_write, bool write_irp, LIST_ENTRY *rollback) __attribute__((nonnull(1
NTSTATUS alloc_chunk(device_extension *Vcb, uint64_t flags, chunk **pc, bool full_size) __attribute__((nonnull(1
void chunk_lock_range(_In_ device_extension *Vcb, _In_ chunk *c, _In_ uint64_t start, _In_ uint64_t length)
void add_group_mapping(WCHAR *sidstring, ULONG sidstringlength, uint32_t gid)
NTSTATUS check_csum(device_extension *Vcb, uint8_t *data, uint32_t sectors, void *csum)
NTSTATUS NTSTATUS NTSTATUS NTSTATUS NTSTATUS excise_extents(device_extension *Vcb, fcb *fcb, uint64_t start_data, uint64_t end_data, PIRP Irp, LIST_ENTRY *rollback) __attribute__((nonnull(1
NTSTATUS send_subvol(device_extension *Vcb, void *data, ULONG datalen, PFILE_OBJECT FileObject, PIRP Irp)
NTSTATUS zstd_decompress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen)
uint32_t mount_max_inline
void void void add_rollback(_In_ LIST_ENTRY *rollback, _In_ enum rollback_type type, _In_ __drv_aliasesMem void *ptr) __attribute__((nonnull(1
void raid6_recover2(uint8_t *sectors, uint16_t num_stripes, ULONG sector_size, uint16_t missing1, uint16_t missing2, uint8_t *out)
void blake2b(void *out, size_t outlen, const void *in, size_t inlen)
void space_list_add2(LIST_ENTRY *list, LIST_ENTRY *list_size, uint64_t address, uint64_t length, chunk *c, LIST_ENTRY *rollback)
void reap_fileref(device_extension *Vcb, file_ref *fr)
#define _Dispatch_type_(a)
NTSTATUS add_space_entry(LIST_ENTRY *list, LIST_ENTRY *list_size, uint64_t offset, uint64_t size)
BOOLEAN(__stdcall * tPsIsDiskCountersEnabled)()
uint64_t get_extent_flags(device_extension *Vcb, uint64_t address, PIRP Irp)
static const char lxgid[]
void void void NTSTATUS void NTSTATUS NTSTATUS remove_drive_letter(PDEVICE_OBJECT mountmgr, PUNICODE_STRING devpath)
NTSTATUS create_root(_In_ _Requires_exclusive_lock_held_(_Curr_->tree_lock) device_extension *Vcb, _In_ uint64_t id, _Out_ root **rootptr, _In_ bool no_tree, _In_ uint64_t offset, _In_opt_ PIRP Irp)
void void void NTSTATUS commit_batch_list(_Requires_exclusive_lock_held_(_Curr_->tree_lock) device_extension *Vcb, LIST_ENTRY *batchlist, PIRP Irp) __attribute__((nonnull(1
NTSTATUS utf16_to_utf8(char *dest, ULONG dest_max, ULONG *dest_len, WCHAR *src, ULONG src_len)
struct _RTL_USER_PROCESS_PARAMETERS RTL_USER_PROCESS_PARAMETERS
struct _LDR_DATA_TABLE_ENTRY * PLDR_DATA_TABLE_ENTRY
uint32_t sid_to_uid(PSID sid)
NTSTATUS bool find_data_address_in_chunk(device_extension *Vcb, chunk *c, uint64_t length, uint64_t *address) __attribute__((nonnull(1
struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER FSCTL_GET_INTEGRITY_INFORMATION_BUFFER
NTSTATUS get_reparse_point(PFILE_OBJECT FileObject, void *buffer, DWORD buflen, ULONG_PTR *retlen)
static __inline uint64_t unix_time_to_win(BTRFS_TIME *t)
static __inline void win_time_to_unix(LARGE_INTEGER t, BTRFS_TIME *out)
uint32_t inherit_mode(fcb *parfcb, bool is_dir)
NTSTATUS lzo_decompress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen, uint32_t inpageoff)
void(__stdcall * xor_func)(uint8_t *buf1, uint8_t *buf2, uint32_t len)
void flush_subvol_fcbs(root *subvol)
NTSTATUS registry_mark_volume_unmounted(BTRFS_UUID *uuid)
NTSTATUS update_dev_item(device_extension *Vcb, device *device, PIRP Irp)
void chunk_unlock_range(_In_ device_extension *Vcb, _In_ chunk *c, _In_ uint64_t start, _In_ uint64_t length)
NTSTATUS mountmgr_add_drive_letter(PDEVICE_OBJECT mountmgr, PUNICODE_STRING devpath)
struct _RTL_USER_PROCESS_PARAMETERS * PRTL_USER_PROCESS_PARAMETERS
struct _fcb_nonpaged fcb_nonpaged
NTSTATUS uid_to_sid(uint32_t uid, PSID *sid)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool prealloc
NTSTATUS add_calc_job_comp(device_extension *Vcb, uint8_t compression, void *in, unsigned int inlen, void *out, unsigned int outlen, calc_job **pcj)
void fcb_get_sd(fcb *fcb, struct _fcb *parent, bool look_for_xattr, PIRP Irp)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t _In_ uint64_t decoded_size
NTSTATUS do_write_file(fcb *fcb, uint64_t start_data, uint64_t end_data, void *data, PIRP Irp, bool file_write, uint32_t irp_offset, LIST_ENTRY *rollback) __attribute__((nonnull(1
void free_fcb(_Inout_ fcb *fcb)
NTSTATUS do_write_job(device_extension *Vcb, PIRP Irp)
NTSTATUS increase_extent_refcount_data(device_extension *Vcb, uint64_t address, uint64_t size, uint64_t root, uint64_t inode, uint64_t offset, uint32_t refcount, PIRP Irp)
NTSTATUS NTSTATUS NTSTATUS void free_write_data_stripes(write_data_context *wtc) __attribute__((nonnull(1)))
ULONG get_reparse_tag_fcb(fcb *fcb)
uint64_t get_extent_data_ref_hash2(uint64_t root, uint64_t objid, uint64_t offset)
void space_list_subtract2(LIST_ENTRY *list, LIST_ENTRY *list_size, uint64_t address, uint64_t length, chunk *c, LIST_ENTRY *rollback)
VOID(__stdcall * tCcSetAdditionalCacheAttributesEx)(PFILE_OBJECT FileObject, ULONG Flags)
uint32_t mount_allow_degraded
NTSTATUS NTSTATUS void free_tree(tree *t) __attribute__((nonnull(1)))
BOOLEAN(__stdcall * tFsRtlCheckLockForOplockRequest)(PFILE_LOCK FileLock, PLARGE_INTEGER AllocationSize)
uint32_t mount_skip_balance
NTSTATUS find_chunk_usage(_In_ _Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, _In_opt_ PIRP Irp)
@ WriteDataStatus_Pending
@ WriteDataStatus_Cancelled
@ WriteDataStatus_Cancelling
@ WriteDataStatus_Success
void mark_fileref_dirty(_In_ file_ref *fileref)
NTSTATUS stream_set_end_of_file_information(device_extension *Vcb, uint16_t end, fcb *fcb, file_ref *fileref, bool advance_only)
NTSTATUS do_read_job(PIRP Irp)
uint32_t find_extent_shared_data_refcount(device_extension *Vcb, uint64_t address, uint64_t parent, PIRP Irp)
uint32_t mount_zlib_level
struct _LDR_DATA_TABLE_ENTRY LDR_DATA_TABLE_ENTRY
NTSTATUS open_fileref_child(_Requires_lock_held_(_Curr_->tree_lock) _Requires_exclusive_lock_held_(_Curr_->fcb_lock) _In_ device_extension *Vcb, _In_ file_ref *sf, _In_ PUNICODE_STRING name, _In_ bool case_sensitive, _In_ bool lastpart, _In_ bool streampart, _In_ POOL_TYPE pooltype, _Out_ file_ref **psf2, _In_opt_ PIRP Irp)
NTSTATUS NTSTATUS read_stream(fcb *fcb, uint8_t *data, uint64_t start, ULONG length, ULONG *pbr) __attribute__((nonnull(1
NTSTATUS query_scrub(device_extension *Vcb, KPROCESSOR_MODE processor_mode, void *data, ULONG length)
NTSTATUS pause_balance(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
VOID(__stdcall * tFsRtlUpdateDiskCounters)(ULONG64 BytesRead, ULONG64 BytesWritten)
ULONG get_file_attributes(_In_ _Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, _In_ root *r, _In_ uint64_t inode, _In_ uint8_t type, _In_ bool dotfile, _In_ bool ignore_xa, _In_opt_ PIRP Irp)
static __inline uint64_t make_file_id(root *r, uint64_t inode)
NTSTATUS open_fileref(_Requires_lock_held_(_Curr_->tree_lock) _Requires_exclusive_lock_held_(_Curr_->fcb_lock) _In_ device_extension *Vcb, _Out_ file_ref **pfr, _In_ PUNICODE_STRING fnus, _In_opt_ file_ref *related, _In_ bool parent, _Out_opt_ USHORT *parsed, _Out_opt_ ULONG *fn_offset, _In_ POOL_TYPE pooltype, _In_ bool case_sensitive, _In_opt_ PIRP Irp)
NTSTATUS add_calc_job_decomp(device_extension *Vcb, uint8_t compression, void *in, unsigned int inlen, void *out, unsigned int outlen, unsigned int off, calc_job **pcj)
#define _Lock_level_order_(a, b)
NTSTATUS vol_read(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS update_chunk_caches(device_extension *Vcb, PIRP Irp, LIST_ENTRY *rollback)
NTSTATUS flush_partial_stripe(device_extension *Vcb, chunk *c, partial_stripe *ps)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
uint32_t mount_zstd_level
_In_ fcb _In_ chunk _In_ uint64_t start_data
NTSTATUS set_reparse_point(PIRP Irp)
struct _write_data_context write_data_context
bool has_open_children(file_ref *fileref)
NTSTATUS pnp_query_remove_device(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS vol_close(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
@ calc_thread_decomp_zlib
@ calc_thread_decomp_zstd
void add_changed_extent_ref(chunk *c, uint64_t address, uint64_t size, uint64_t root, uint64_t objid, uint64_t offset, uint32_t count, bool no_csum)
NTSTATUS load_csum(_Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, void *csum, uint64_t start, uint64_t length, PIRP Irp)
NTSTATUS decrease_extent_refcount_tree(device_extension *Vcb, uint64_t address, uint64_t size, uint64_t root, uint8_t level, PIRP Irp)
bool is_top_level(_In_ PIRP Irp)
void remove_fcb_from_subvol(_In_ _Requires_exclusive_lock_held_(_Curr_->Vcb->fcb_lock) fcb *fcb)
NTSTATUS do_write(device_extension *Vcb, PIRP Irp)
bool check_sector_csum(device_extension *Vcb, void *buf, void *csum)
uint32_t mount_compress_type
static const char lxdev[]
void init_fast_io_dispatch(FAST_IO_DISPATCH **fiod)
struct _volume_device_extension volume_device_extension
void boot_add_device(DEVICE_OBJECT *pdo)
static __inline POPLOCK fcb_oplock(fcb *fcb)
NTSTATUS remove_device(device_extension *Vcb, void *data, ULONG length, KPROCESSOR_MODE processor_mode)
bool check_superblock_checksum(superblock *sb)
NTSTATUS NTSTATUS NTSTATUS NTSTATUS NTSTATUS chunk * get_chunk_from_address(device_extension *Vcb, uint64_t address) __attribute__((nonnull(1)))
NTSTATUS NTSTATUS NTSTATUS NTSTATUS extend_file(fcb *fcb, file_ref *fileref, uint64_t end, bool prealloc, PIRP Irp, LIST_ENTRY *rollback) __attribute__((nonnull(1
void free_vol(volume_device_extension *vde)
NTSTATUS stop_balance(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
void do_rollback(device_extension *Vcb, LIST_ENTRY *rollback) __attribute__((nonnull(1
void find_gid(struct _fcb *fcb, struct _fcb *parfcb, PSECURITY_SUBJECT_CONTEXT subjcont)
VOID(__stdcall * tPsUpdateDiskCounters)(PEPROCESS Process, ULONG64 BytesRead, ULONG64 BytesWritten, ULONG ReadOperationCount, ULONG WriteOperationCount, ULONG FlushOperationCount)
NTSTATUS start_balance(device_extension *Vcb, void *data, ULONG length, KPROCESSOR_MODE processor_mode)
NTSTATUS load_tree(device_extension *Vcb, uint64_t addr, uint8_t *buf, root *r, tree **pt) __attribute__((nonnull(1
_In_ uint16_t _Out_ ULONG * atts
NTSTATUS(__stdcall * tFsRtlGetEcpListFromIrp)(PIRP Irp, PECP_LIST *EcpList)
void galois_divpower(uint8_t *data, uint8_t div, uint32_t readlen)
void watch_registry(HANDLE regh)
void void void NTSTATUS void clear_batch_list(device_extension *Vcb, LIST_ENTRY *batchlist) __attribute__((nonnull(1
void queue_notification_fcb(_In_ file_ref *fileref, _In_ ULONG filter_match, _In_ ULONG action, _In_opt_ PUNICODE_STRING stream)
NTSTATUS increase_extent_refcount(device_extension *Vcb, uint64_t address, uint64_t size, uint8_t type, void *data, KEY *firstitem, uint8_t level, PIRP Irp)
@ ROLLBACK_SUBTRACT_SPACE
NTSTATUS NTSTATUS NTSTATUS truncate_file(fcb *fcb, uint64_t end, PIRP Irp, LIST_ENTRY *rollback) __attribute__((nonnull(1
uint32_t mount_no_root_dir
NTSTATUS dismount_volume(device_extension *Vcb, bool shutdown, PIRP Irp)
NTSTATUS write_compressed(fcb *fcb, uint64_t start_data, uint64_t end_data, void *data, PIRP Irp, LIST_ENTRY *rollback)
uint32_t mount_flush_interval
NTSTATUS clear_free_space_cache(device_extension *Vcb, LIST_ENTRY *batchlist, PIRP Irp)
NTSTATUS write_data_phys(_In_ PDEVICE_OBJECT device, _In_ PFILE_OBJECT fileobj, _In_ uint64_t address, _In_reads_bytes_(length) void *data, _In_ uint32_t length)
NTSTATUS update_chunk_caches_tree(device_extension *Vcb, PIRP Irp)
NTSTATUS open_fileref_by_inode(_Requires_exclusive_lock_held_(_Curr_->fcb_lock) device_extension *Vcb, root *subvol, uint64_t inode, file_ref **pfr, PIRP Irp)
NTSTATUS set_reparse_point2(fcb *fcb, REPARSE_DATA_BUFFER *rdb, ULONG buflen, ccb *ccb, file_ref *fileref, PIRP Irp, LIST_ENTRY *rollback)
NTSTATUS NTSTATUS bool bool find_prev_item(_Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, const traverse_ptr *tp, traverse_ptr *prev_tp, PIRP Irp) __attribute__((nonnull(1
NTSTATUS NTSTATUS do_load_tree(device_extension *Vcb, tree_holder *th, root *r, tree *t, tree_data *td, PIRP Irp) __attribute__((nonnull(1
BOOLEAN(__stdcall * tFsRtlAreThereCurrentOrInProgressFileLocks)(PFILE_LOCK FileLock)
void space_list_add(chunk *c, uint64_t address, uint64_t length, LIST_ENTRY *rollback)
_Ret_maybenull_ root * find_default_subvol(_In_ _Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, _In_opt_ PIRP Irp)
struct _PEB_LDR_DATA * PPEB_LDR_DATA
NTSTATUS bool void NTSTATUS add_extent_to_fcb(_In_ fcb *fcb, _In_ uint64_t offset, _In_reads_bytes_(edsize) EXTENT_DATA *ed, _In_ uint16_t edsize, _In_ bool unique, _In_opt_ _When_(return >=0, __drv_aliasesMem) void *csum, _In_ LIST_ENTRY *rollback) __attribute__((nonnull(1
NTSTATUS(__stdcall * tFsRtlGetNextExtraCreateParameter)(PECP_LIST EcpList, PVOID CurrentEcpContext, LPGUID NextEcpType, PVOID *NextEcpContext, ULONG *NextEcpContextSize)
NTSTATUS NTSTATUS NTSTATUS write_data_complete(device_extension *Vcb, uint64_t address, void *data, uint32_t length, PIRP Irp, chunk *c, bool file_write, uint64_t irp_offset, ULONG priority) __attribute__((nonnull(1
PEPROCESS __stdcall PsGetThreadProcess(_In_ PETHREAD Thread)
NTSTATUS open_fcb(_Requires_lock_held_(_Curr_->tree_lock) _Requires_exclusive_lock_held_(_Curr_->fcb_lock) device_extension *Vcb, root *subvol, uint64_t inode, uint8_t type, PANSI_STRING utf8, bool always_add_hl, fcb *parent, fcb **pfcb, POOL_TYPE pooltype, PIRP Irp)
void init_device(_In_ device_extension *Vcb, _Inout_ device *dev, _In_ bool get_nums)
NTSTATUS read_send_buffer(device_extension *Vcb, PFILE_OBJECT FileObject, void *data, ULONG datalen, ULONG_PTR *retlen, KPROCESSOR_MODE processor_mode)
void calc_sha256(uint8_t *hash, const void *input, size_t len)
void volume_removal(PUNICODE_STRING devpath)
NTSTATUS NTSTATUS bool bool void free_trees(device_extension *Vcb) __attribute__((nonnull(1)))
static const char lxmod[]
void update_extent_flags(device_extension *Vcb, uint64_t address, uint64_t flags, PIRP Irp)
NTSTATUS sync_read_phys(_In_ PDEVICE_OBJECT DeviceObject, _In_ PFILE_OBJECT FileObject, _In_ uint64_t StartingOffset, _In_ ULONG Length, _Out_writes_bytes_(Length) PUCHAR Buffer, _In_ bool override)
static const char lxuid[]
struct _tree_data tree_data
void trim_whole_device(device *dev)
NTSTATUS vol_device_control(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _device_extension device_extension
struct _FILE_ID_128 * PFILE_ID_128
void add_fcb_to_subvol(_In_ _Requires_exclusive_lock_held_(_Curr_->Vcb->fcb_lock) fcb *fcb)
void protect_superblocks(_Inout_ chunk *c)
NTSTATUS check_file_name_valid(_In_ PUNICODE_STRING us, _In_ bool posix, _In_ bool stream)
void init_file_cache(_In_ PFILE_OBJECT FileObject, _In_ CC_FILE_SIZES *ccfs)
BOOLEAN(__stdcall * tCcCopyWriteEx)(PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, ULONG Length, BOOLEAN Wait, PVOID Buffer, PETHREAD IoIssuerThread)
NTSTATUS decrease_extent_refcount(device_extension *Vcb, uint64_t address, uint64_t size, uint8_t type, void *data, KEY *firstitem, uint8_t level, uint64_t parent, bool superseded, PIRP Irp)
NTSTATUS lzo_compress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen, unsigned int *space_left)
NTSTATUS find_item(_In_ _Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, _In_ root *r, _Out_ traverse_ptr *tp, _In_ const KEY *searchkey, _In_ bool ignore, _In_opt_ PIRP Irp) __attribute__((nonnull(1
NTSTATUS delete_reparse_point(PIRP Irp)
NTSTATUS insert_tree_item(_In_ _Requires_exclusive_lock_held_(_Curr_->tree_lock) device_extension *Vcb, _In_ root *r, _In_ uint64_t obj_id, _In_ uint8_t obj_type, _In_ uint64_t offset, _In_reads_bytes_opt_(size) _When_(return >=0, __drv_aliasesMem) void *data, _In_ uint16_t size, _Out_opt_ traverse_ptr *ptp, _In_opt_ PIRP Irp) __attribute__((nonnull(1
NTSTATUS bool void NTSTATUS void add_extent(_In_ fcb *fcb, _In_ LIST_ENTRY *prevextle, _In_ __drv_aliasesMem extent *newext) __attribute__((nonnull(1
void get_sector_csum(device_extension *Vcb, void *buf, void *csum)
void remove_volume_child(_Inout_ _Requires_exclusive_lock_held_(_Curr_->child_lock) _Releases_exclusive_lock_(_Curr_->child_lock) _In_ volume_device_extension *vde, _In_ volume_child *vc, _In_ bool skip_dev)
uint32_t mount_no_barrier
void uninit(_In_ device_extension *Vcb)
void calc_tree_checksum(device_extension *Vcb, tree_header *th)
void read_registry(PUNICODE_STRING regpath, bool refresh)
bool fcb_is_inline(fcb *fcb)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP Irp
bool is_extent_unique(device_extension *Vcb, uint64_t address, uint64_t size, PIRP Irp)
NTSTATUS NTSTATUS void clear_rollback(LIST_ENTRY *rollback) __attribute__((nonnull(1)))
NTSTATUS registry_mark_volume_mounted(BTRFS_UUID *uuid)
bool volume_arrival(PUNICODE_STRING devpath, bool fve_callback)
struct _FILE_ID_128 FILE_ID_128
NTSTATUS fileref_get_filename(file_ref *fileref, PUNICODE_STRING fn, USHORT *name_offset, ULONG *preqlen)
NTSTATUS do_tree_writes(device_extension *Vcb, LIST_ENTRY *tree_writes, bool no_free)
NTSTATUS start_scrub(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
void do_unlock_volume(device_extension *Vcb)
struct _DUPLICATE_EXTENTS_DATA DUPLICATE_EXTENTS_DATA
NTSTATUS look_for_balance_item(_Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb)
NTSTATUS update_changed_extent_ref(device_extension *Vcb, chunk *c, uint64_t address, uint64_t size, uint64_t root, uint64_t objid, uint64_t offset, int32_t count, bool no_csum, bool superseded, PIRP Irp)
void space_list_merge(LIST_ENTRY *spacelist, LIST_ENTRY *spacelist_size, LIST_ENTRY *deleting)
struct _DUPLICATE_EXTENTS_DATA * PDUPLICATE_EXTENTS_DATA
bool check_tree_checksum(device_extension *Vcb, tree_header *th)
NTSTATUS get_tree_new_address(device_extension *Vcb, tree *t, PIRP Irp, LIST_ENTRY *rollback)
void send_notification_fileref(_In_ file_ref *fileref, _In_ ULONG filter_match, _In_ ULONG action, _In_opt_ PUNICODE_STRING stream)
void insert_dir_child_into_hash_lists(fcb *fcb, dir_child *dc)
uint32_t mount_compress_force
NTSTATUS fsctl_request(PDEVICE_OBJECT DeviceObject, PIRP *Pirp, uint32_t type)
#define FSRTL_FCB_HEADER_V2
static __inline uint16_t get_extent_data_len(uint8_t type)
void reap_fcbs(device_extension *Vcb)
NTSTATUS dev_ioctl(_In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG ControlCode, _In_reads_bytes_opt_(InputBufferSize) PVOID InputBuffer, _In_ ULONG InputBufferSize, _Out_writes_bytes_opt_(OutputBufferSize) PVOID OutputBuffer, _In_ ULONG OutputBufferSize, _In_ bool Override, _Out_opt_ IO_STATUS_BLOCK *iosb)
NTSTATUS allocate_cache(device_extension *Vcb, bool *changed, PIRP Irp, LIST_ENTRY *rollback)
void calc_thread_main(device_extension *Vcb, calc_job *cj)
fcb * create_fcb(device_extension *Vcb, POOL_TYPE pool_type)
BOOLEAN(__stdcall * tCcCopyReadEx)(PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, ULONG Length, BOOLEAN Wait, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, PETHREAD IoIssuerThread)
NTSTATUS NTSTATUS bool find_next_item(_Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, const traverse_ptr *tp, traverse_ptr *next_tp, bool ignore, PIRP Irp) __attribute__((nonnull(1
struct _root_cache root_cache
NTSTATUS vol_write(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
bool find_metadata_address_in_chunk(device_extension *Vcb, chunk *c, uint64_t *address)
NTSTATUS utf8_to_utf16(WCHAR *dest, ULONG dest_max, ULONG *dest_len, char *src, ULONG src_len)
void get_tree_checksum(device_extension *Vcb, tree_header *th, void *csum)
ULONG get_reparse_tag(device_extension *Vcb, root *subvol, uint64_t inode, uint8_t type, ULONG atts, bool lxss, PIRP Irp)
NTSTATUS NTSTATUS NTSTATUS do_read(PIRP Irp, bool wait, ULONG *bytes_read)
NTSTATUS fcb_get_new_sd(fcb *fcb, file_ref *parfileref, ACCESS_STATE *as)
NTSTATUS add_dir_child(fcb *fcb, uint64_t inode, bool subvol, PANSI_STRING utf8, PUNICODE_STRING name, uint8_t type, dir_child **pdc)
uint32_t mount_clear_cache
struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER FSCTL_SET_INTEGRITY_INFORMATION_BUFFER
PDEVICE_OBJECT PhysicalDeviceObject
file_ref * create_fileref(device_extension *Vcb)
NTSTATUS NTSTATUS delete_tree_item(_In_ _Requires_exclusive_lock_held_(_Curr_->tree_lock) device_extension *Vcb, _Inout_ traverse_ptr *tp) __attribute__((nonnull(1
static __inline void * map_user_buffer(PIRP Irp, ULONG priority)
void space_list_subtract(chunk *c, uint64_t address, uint64_t length, LIST_ENTRY *rollback)
void remove_dir_child_from_hash_lists(fcb *fcb, dir_child *dc)
static __inline uint64_t fcb_alloc_size(fcb *fcb)
NTSTATUS find_file_in_dir(PUNICODE_STRING filename, fcb *fcb, root **subvol, uint64_t *inode, dir_child **pdc, bool case_sensitive)
uint32_t get_num_of_processors()
struct _PEB_LDR_DATA PEB_LDR_DATA
NTSTATUS decrease_extent_refcount_data(device_extension *Vcb, uint64_t address, uint64_t size, uint64_t root, uint64_t inode, uint64_t offset, uint32_t refcount, bool superseded, PIRP Irp)
NTSTATUS vol_create(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS bool void get_raid56_lock_range(chunk *c, uint64_t address, uint64_t length, uint64_t *lockaddr, uint64_t *locklen) __attribute__((nonnull(1
static __inline bool is_subvol_readonly(root *r, PIRP Irp)
bool is_tree_unique(device_extension *Vcb, tree *t, PIRP Irp)
NTSTATUS resume_scrub(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
void add_checksum_entry(device_extension *Vcb, uint64_t address, ULONG length, void *csum, PIRP Irp)
NTSTATUS NTSTATUS find_item_to_level(device_extension *Vcb, root *r, traverse_ptr *tp, const KEY *searchkey, bool ignore, uint8_t level, PIRP Irp) __attribute__((nonnull(1
NTSTATUS load_dir_children(_Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, fcb *fcb, bool ignore_size, PIRP Irp)
_Ret_maybenull_ device * find_device_from_uuid(_In_ device_extension *Vcb, _In_ BTRFS_UUID *uuid)
void add_volume_device(superblock *sb, PUNICODE_STRING devpath, uint64_t length, ULONG disk_num, ULONG part_num)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t _In_ uint64_t _In_ bool file_write
static __inline bool write_fcb_compressed(fcb *fcb)
NTSTATUS zstd_compress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen, uint32_t level, unsigned int *space_left)
_In_ PFCB _In_ LONGLONG FileOffset
_In_ PFCB _In_ LONGLONG StartingOffset
#define _Releases_exclusive_lock_(lock)
#define _Requires_lock_held_(lock)
#define _Acquires_exclusive_lock_(lock)
#define _Acquires_shared_lock_(lock)
#define _Requires_lock_not_held_(lock)
#define _Create_lock_level_(level)
#define _Releases_lock_(lock)
#define _Requires_exclusive_lock_held_(lock)
static WCHAR superseded[MAX_STRING_RESOURCE_LEN]
#define crc32(crc, buf, len)
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
_In_ uint64_t _In_ uint64_t _In_ uint64_t generation
#define TYPE_EXTENT_DATA_REF
#define BTRFS_SUBVOL_READONLY
#define TYPE_SHARED_BLOCK_REF
#define TYPE_SHARED_DATA_REF
#define TYPE_TREE_BLOCK_REF
#define TYPE_EXTENT_REF_V0
bool insert_extent_chunk(_In_ device_extension *Vcb, _In_ fcb *fcb, _In_ chunk *c, _In_ uint64_t start_data, _In_ uint64_t length, _In_ bool prealloc, _In_opt_ void *data, _In_opt_ PIRP Irp, _In_ LIST_ENTRY *rollback, _In_ uint8_t compression, _In_ uint64_t decoded_size, _In_ bool file_write, _In_ uint64_t irp_offset)
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
#define ExAcquireResourceExclusiveLite(res, wait)
#define ExAcquireResourceSharedLite(res, wait)
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
_In_ PECP_LIST _In_opt_ PVOID CurrentEcpContext
_In_ PECP_LIST _In_opt_ PVOID _Out_opt_ LPGUID _Outptr_opt_ PVOID * NextEcpContext
_In_ PECP_LIST _In_opt_ PVOID _Out_opt_ LPGUID NextEcpType
_Must_inspect_result_ _In_ FSRTL_ALLOCATE_ECPLIST_FLAGS _Outptr_ PECP_LIST * EcpList
_In_ PECP_LIST _In_opt_ PVOID _Out_opt_ LPGUID _Outptr_opt_ PVOID _Out_opt_ ULONG * NextEcpContextSize
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
localAdvHdr FileContextSupportPointer
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
#define FsRtlAreThereCurrentFileLocks(FL)
struct _ECP_LIST * PECP_LIST
enum _FAST_IO_POSSIBLE FAST_IO_POSSIBLE
#define FSRTL_FLAG2_IS_PAGING_FILE
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLenum const GLvoid * addr
GLboolean GLboolean GLboolean GLboolean a
GLenum GLenum GLenum input
enum _PROCESSINFOCLASS PROCESSINFOCLASS
int const JOCTET unsigned int datalen
static PIO_STATUS_BLOCK iosb
#define _Function_class_(x)
#define _In_reads_bytes_(size)
#define _Out_writes_bytes_(size)
#define _When_(expr, annos)
#define _In_reads_bytes_opt_(size)
#define _Post_satisfies_(cond)
#define _Out_writes_bytes_opt_(size)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
_In_ HANDLE ProcessHandle
NTSYSAPI NTSTATUS NTAPI ZwQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
DRIVER_DISPATCH(nfs41_FsdDispatch)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define FILE_ATTRIBUTE_SPARSE_FILE
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
BOOLEAN NTAPI FsRtlOplockIsFastIoPossible(IN POPLOCK Oplock)
DRIVER_ADD_DEVICE AddDevice
#define BTRFS_INODE_NOCOMPRESS
#define BTRFS_INODE_COMPRESS
#define BTRFS_INODE_NODATACOW
#define IRP_MJ_DIRECTORY_CONTROL
#define IRP_MJ_DEVICE_CONTROL
#define IRP_MJ_SET_INFORMATION
#define IRP_MJ_QUERY_INFORMATION
INT WSAAPI shutdown(IN SOCKET s, IN INT how)
PULONG MinorVersion OPTIONAL
LARGE_INTEGER SourceFileOffset
LARGE_INTEGER TargetFileOffset
UNICODE_STRING FullDllName
LIST_ENTRY InMemoryOrderLinks
struct _LIST_ENTRY * Flink
LIST_ENTRY InMemoryOrderModuleList
PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
UNICODE_STRING CommandLine
UNICODE_STRING ImagePathName
bool user_set_change_time
bool user_set_access_time
bool manage_volume_privilege
uint64_t query_dir_offset
bool allow_extended_dasd_io
bool user_set_creation_time
UNICODE_STRING query_string
LIST_ENTRY * trees_ptrs[256]
ERESOURCE dirty_subvols_lock
drv_calc_threads calcthreads
NPAGED_LOOKASIDE_LIST fcb_np_lookaside
PAGED_LOOKASIDE_LIST name_bit_lookaside
PAGED_LOOKASIDE_LIST fileref_lookaside
KEVENT flush_thread_finished
unsigned int sector_shift
KTIMER flush_thread_timer
_Has_lock_level_(tree_lock) ERESOURCE tree_lock
PFILE_OBJECT locked_fileobj
ERESOURCE dirty_filerefs_lock
PAGED_LOOKASIDE_LIST tree_data_lookaside
FAST_MUTEX trees_list_mutex
PAGED_LOOKASIDE_LIST fcb_lookaside
PAGED_LOOKASIDE_LIST traverse_ptr_lookaside
LIST_ENTRY dirty_filerefs
_Has_lock_level_(fcb_lock) ERESOURCE fcb_lock
NPAGED_LOOKASIDE_LIST range_lock_lookaside
HANDLE flush_thread_handle
ERESOURCE dirty_fcbs_lock
PAGED_LOOKASIDE_LIST batch_item_lookaside
struct _volume_device_extension * vde
ERESOURCE dir_children_lock
SECTION_OBJECT_POINTERS segment_object
ERESOURCE paging_resource
LIST_ENTRY list_entry_all
LIST_ENTRY dir_children_index
struct _file_ref * fileref
PKTHREAD lazy_writer_thread
LIST_ENTRY dir_children_hash
LIST_ENTRY ** hash_ptrs_uc
struct _device_extension * Vcb
LIST_ENTRY dir_children_hash_uc
ANSI_STRING reparse_xattr
bool reparse_xattr_changed
enum prop_compression_type prop_compression
LIST_ENTRY list_entry_dirty
struct _fcb_nonpaged * nonpaged
SHARE_ACCESS share_access
bool prop_compression_changed
FSRTL_ADVANCED_FCB_HEADER Header
struct _file_ref * parent