ReactOS  0.4.14-dev-41-g31d7680
btrfs_drv.h
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 #pragma once
19 
20 #ifndef __REACTOS__
21 #undef _WIN32_WINNT
22 #undef NTDDI_VERSION
23 
24 #define _WIN32_WINNT 0x0601
25 #define NTDDI_VERSION 0x06020000 // Win 8
26 #define _CRT_SECURE_NO_WARNINGS
27 #define _NO_CRT_STDIO_INLINE
28 #endif /* __REACTOS__ */
29 
30 #ifdef _MSC_VER
31 #pragma warning(push)
32 #pragma warning(disable:4163)
33 #pragma warning(disable:4311)
34 #pragma warning(disable:4312)
35 #else
36 #pragma GCC diagnostic push
37 #pragma GCC diagnostic ignored "-Wsign-compare"
38 #pragma GCC diagnostic ignored "-Wsign-conversion"
39 #endif
40 
41 #include <ntifs.h>
42 #include <ntddk.h>
43 #ifdef __REACTOS__
44 #include <ntdddisk.h>
45 #endif /* __REACTOS__ */
46 #include <mountmgr.h>
47 #ifdef __REACTOS__
48 #include <rtlfuncs.h>
49 #include <iotypes.h>
50 #include <pseh/pseh2.h>
51 #endif /* __REACTOS__ */
52 #include <windef.h>
53 #include <wdm.h>
54 
55 #ifdef _MSC_VER
56 #pragma warning(pop)
57 #else
58 #pragma GCC diagnostic pop
59 #endif
60 
61 #include <stdio.h>
62 #include <stdarg.h>
63 #include <stddef.h>
64 #include <stdint.h>
65 #include <stdbool.h>
66 #ifndef __REACTOS__
67 // Not actually used
68 #include <emmintrin.h>
69 #endif /* __REACTOS__ */
70 #include "btrfs.h"
71 #include "btrfsioctl.h"
72 
73 #ifdef __REACTOS__
74 C_ASSERT(sizeof(bool) == 1);
75 #endif
76 
77 #ifdef _DEBUG
78 // #define DEBUG_FCB_REFCOUNTS
79 // #define DEBUG_LONG_MESSAGES
80 // #define DEBUG_FLUSH_TIMES
81 // #define DEBUG_CHUNK_LOCKS
82 // #define DEBUG_TRIM_EMULATION
83 #define DEBUG_PARANOID
84 #endif
85 
86 #define UNUSED(x) (void)(x)
87 
88 #define BTRFS_NODE_TYPE_CCB 0x2295
89 #define BTRFS_NODE_TYPE_FCB 0x2296
90 
91 #define ALLOC_TAG 0x7442484D //'MHBt'
92 #define ALLOC_TAG_ZLIB 0x7A42484D //'MHBz'
93 
94 #define UID_NOBODY 65534
95 #define GID_NOBODY 65534
96 
97 #define EA_NTACL "security.NTACL"
98 #define EA_NTACL_HASH 0x45922146
99 
100 #define EA_DOSATTRIB "user.DOSATTRIB"
101 #define EA_DOSATTRIB_HASH 0x914f9939
102 
103 #define EA_REPARSE "user.reparse"
104 #define EA_REPARSE_HASH 0xfabad1fe
105 
106 #define EA_EA "user.EA"
107 #define EA_EA_HASH 0x8270dd43
108 
109 #define EA_CASE_SENSITIVE "user.casesensitive"
110 #define EA_CASE_SENSITIVE_HASH 0x1a9d97d4
111 
112 #define EA_PROP_COMPRESSION "btrfs.compression"
113 #define EA_PROP_COMPRESSION_HASH 0x20ccdf69
114 
115 #define MAX_EXTENT_SIZE 0x8000000 // 128 MB
116 #define COMPRESSED_EXTENT_SIZE 0x20000 // 128 KB
117 
118 #define READ_AHEAD_GRANULARITY COMPRESSED_EXTENT_SIZE // really ought to be a multiple of COMPRESSED_EXTENT_SIZE
119 
120 #define IO_REPARSE_TAG_LXSS_SYMLINK 0xa000001d // undocumented?
121 
122 #define IO_REPARSE_TAG_LXSS_SOCKET 0x80000023
123 #define IO_REPARSE_TAG_LXSS_FIFO 0x80000024
124 #define IO_REPARSE_TAG_LXSS_CHARDEV 0x80000025
125 #define IO_REPARSE_TAG_LXSS_BLOCKDEV 0x80000026
126 
127 #define BTRFS_VOLUME_PREFIX L"\\Device\\Btrfs{"
128 
129 #ifdef _MSC_VER
130 #define try __try
131 #define except __except
132 #define finally __finally
133 #else
134 #define try if (1)
135 #define except(x) if (0 && (x))
136 #define finally if (1)
137 #endif
138 
139 #ifndef FILE_SUPPORTS_BLOCK_REFCOUNTING
140 #define FILE_SUPPORTS_BLOCK_REFCOUNTING 0x08000000
141 #endif
142 
143 #ifndef FILE_SUPPORTS_POSIX_UNLINK_RENAME
144 #define FILE_SUPPORTS_POSIX_UNLINK_RENAME 0x00000400
145 #endif
146 
147 #ifndef FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
148 #define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000
149 #endif
150 
151 typedef struct _FILE_ID_128 {
154 
155 typedef struct _DUPLICATE_EXTENTS_DATA {
161 
162 #define FSCTL_DUPLICATE_EXTENTS_TO_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 209, METHOD_BUFFERED, FILE_WRITE_ACCESS)
163 
166  WORD Reserved;
167  DWORD Flags;
171 
174  WORD Reserved;
175  DWORD Flags;
177 
178 #define FSCTL_GET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 159, METHOD_BUFFERED, FILE_ANY_ACCESS)
179 #define FSCTL_SET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 160, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
180 
181 #ifndef __REACTOS__
182 #ifndef _MSC_VER
183 #define __drv_aliasesMem
184 #define _Requires_lock_held_(a)
185 #define _Requires_exclusive_lock_held_(a)
186 #define _Releases_lock_(a)
187 #define _Out_writes_bytes_opt_(a)
188 #define _Pre_satisfies_(a)
189 #define _Post_satisfies_(a)
190 #define _Releases_exclusive_lock_(a)
191 #define _Dispatch_type_(a)
192 #define _Create_lock_level_(a)
193 #define _Lock_level_order_(a,b)
194 #define _Has_lock_level_(a)
195 #define _Requires_lock_not_held_(a)
196 #define _Acquires_exclusive_lock_(a)
197 #define _Acquires_shared_lock_(a)
198 #endif
199 #endif
200 
201 _Create_lock_level_(tree_lock)
202 _Create_lock_level_(fcb_lock)
203 _Lock_level_order_(tree_lock, fcb_lock)
204 
205 struct _device_extension;
206 
207 typedef struct _fcb_nonpaged {
213 } fcb_nonpaged;
214 
215 struct _root;
216 
217 typedef struct {
220  bool unique;
221  bool ignore;
222  bool inserted;
224 
226 
228 } extent;
229 
230 typedef struct {
236 } hardlink;
237 
238 struct _file_ref;
239 
240 typedef struct {
254 } dir_child;
255 
261 };
262 
263 typedef struct {
267  bool dirty;
268  char data[1];
269 } xattr;
270 
271 typedef struct _fcb {
277  struct _root* subvol;
284  bool deleted;
302 
308 
309  bool dirty;
317  bool created;
318 
319  bool ads;
324 
328 } fcb;
329 
330 typedef struct {
333 
334 typedef struct _file_ref {
340  bool deleted;
341  bool created;
346  struct _file_ref* parent;
349 
350  bool dirty;
351 
354 } file_ref;
355 
356 typedef struct {
358  struct _ccb* ccb;
359  void* context;
363 } send_info;
364 
365 typedef struct _ccb {
376  bool reserving;
386  bool lxss;
389 } ccb;
390 
391 struct _device_extension;
392 
393 typedef struct {
396  struct _tree* tree;
397 } tree_holder;
398 
399 typedef struct _tree_data {
402  bool ignore;
403  bool inserted;
404 
405  union {
407 
408  struct {
411  };
412  };
413 } tree_data;
414 
415 typedef struct {
417 } tree_nonpaged;
418 
419 typedef struct _tree {
426  struct _tree* parent;
428  struct _root* root;
435  bool write;
436  bool is_unique;
439 } tree;
440 
441 typedef struct {
443 } root_nonpaged;
444 
445 typedef struct _root {
447  LONGLONG lastinode; // signed so we can use InterlockedIncrement64
451  bool dirty;
452  bool received;
462 } root;
463 
478 };
479 
480 typedef struct {
482  void* data;
484  enum batch_operation operation;
486 } batch_item;
487 
488 typedef struct {
489  root* r;
492 } batch_root;
493 
494 typedef struct {
497 } traverse_ptr;
498 
499 typedef struct _root_cache {
501  struct _root_cache* next;
502 } root_cache;
503 
504 typedef struct {
509 } space;
510 
511 typedef struct {
515  bool removable;
516  bool seeding;
517  bool readonly;
518  bool reloc;
519  bool trim;
520  bool can_flush;
522  ULONG disk_num;
523  ULONG part_num;
524  uint64_t stats[5];
530 } device;
531 
532 typedef struct {
537 } range_lock;
538 
539 typedef struct {
547 
548 typedef struct {
566  bool created;
567  bool readonly;
568  bool reloc;
571  bool changed;
578 
581 } chunk;
582 
583 typedef struct {
589  bool no_csum;
595 
596 typedef struct {
598 
599  union {
602  };
603 
606 
607 typedef struct {
609  void* data;
612 } sys_chunk;
613 
614 typedef struct {
618  LONG pos, done;
622 } calc_job;
623 
624 typedef struct {
628  bool quit;
630 
631 typedef struct {
638 
639 typedef struct {
640  bool ignore;
641  bool compress;
644  bool readonly;
652  bool no_trim;
655 } mount_options;
656 
657 #define VCB_TYPE_FS 1
658 #define VCB_TYPE_CONTROL 2
659 #define VCB_TYPE_VOLUME 3
660 #define VCB_TYPE_PDO 4
661 #define VCB_TYPE_BUS 5
662 
663 #define BALANCE_OPTS_DATA 0
664 #define BALANCE_OPTS_METADATA 1
665 #define BALANCE_OPTS_SYSTEM 2
666 
667 typedef struct {
672  bool paused;
673  bool stopping;
674  bool removing;
675  bool shrinking;
681 } balance_info;
682 
683 typedef struct {
686  bool recovered;
688  bool parity;
690 
691  union {
692  struct {
697  } data;
698 
699  struct {
703  } metadata;
704  };
705 } scrub_error;
706 
707 typedef struct {
712  bool stopping;
713  bool paused;
724 } scrub_info;
725 
727 
728 typedef struct _device_extension {
734 #ifdef DEBUG_CHUNK_LOCKS
735  LONG chunk_locks_held;
736 #endif
739  bool readonly;
740  bool removing;
741  bool locked;
745  bool trim;
751  _Has_lock_level_(fcb_lock) ERESOURCE fcb_lock;
754  _Has_lock_level_(tree_lock) ERESOURCE tree_lock;
809 
810 typedef struct {
813 
814 typedef struct {
820 
821 typedef struct {
829  bool seeding;
835 } volume_child;
836 
837 struct pdo_device_extension;
838 
839 typedef struct _volume_device_extension {
848  bool removing;
851 
852 typedef struct pdo_device_extension {
857  bool removable;
858 
863 
866 
867 typedef struct {
871 } uid_map;
872 
873 typedef struct {
877 } gid_map;
878 
886 };
887 
888 struct _write_data_context;
889 
890 typedef struct {
900 
901 typedef struct _write_data_context {
905  bool need_wait;
909 
910 typedef struct {
916 } tree_write;
917 
918 typedef struct {
921 } name_bit;
922 
924 _Acquires_shared_lock_(Vcb->fcb_lock)
925 static __inline void acquire_fcb_lock_shared(device_extension* Vcb) {
926  ExAcquireResourceSharedLite(&Vcb->fcb_lock, true);
927 }
928 
929 _Requires_lock_not_held_(Vcb->fcb_lock)
931 static __inline void acquire_fcb_lock_exclusive(device_extension* Vcb) {
932  ExAcquireResourceExclusiveLite(&Vcb->fcb_lock, true);
933 }
934 
936 _Releases_lock_(Vcb->fcb_lock)
937 static __inline void release_fcb_lock(device_extension* Vcb) {
938  ExReleaseResourceLite(&Vcb->fcb_lock);
939 }
940 
941 static __inline void* map_user_buffer(PIRP Irp, ULONG priority) {
942  if (!Irp->MdlAddress) {
943  return Irp->UserBuffer;
944  } else {
945  return MmGetSystemAddressForMdlSafe(Irp->MdlAddress, priority);
946  }
947 }
948 
950  return (t->seconds * 10000000) + (t->nanoseconds / 100) + 116444736000000000;
951 }
952 
953 static __inline void win_time_to_unix(LARGE_INTEGER t, BTRFS_TIME* out) {
954  ULONGLONG l = (ULONGLONG)t.QuadPart - 116444736000000000;
955 
956  out->seconds = l / 10000000;
957  out->nanoseconds = (uint32_t)((l % 10000000) * 100);
958 }
959 
960 _Post_satisfies_(*stripe>=0&&*stripe<num_stripes)
961 static __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) {
962  uint64_t initoff, startoff;
963 
964  startoff = off % (num_stripes * stripe_length);
965  initoff = (off / (num_stripes * stripe_length)) * stripe_length;
966 
967  *stripe = (uint16_t)(startoff / stripe_length);
968  *stripeoff = initoff + startoff - (*stripe * stripe_length);
969 }
970 
971 /* We only have 64 bits for a file ID, which isn't technically enough to be
972  * unique on Btrfs. We fudge it by having three bytes for the subvol and
973  * five for the inode, which should be good enough.
974  * Inodes are also 64 bits on Linux, but the Linux driver seems to get round
975  * this by tricking it into thinking subvols are separate volumes. */
976 static __inline uint64_t make_file_id(root* r, uint64_t inode) {
977  return (r->id << 40) | (inode & 0xffffffffff);
978 }
979 
980 #define keycmp(key1, key2)\
981  ((key1.obj_id < key2.obj_id) ? -1 :\
982  ((key1.obj_id > key2.obj_id) ? 1 :\
983  ((key1.obj_type < key2.obj_type) ? -1 :\
984  ((key1.obj_type > key2.obj_type) ? 1 :\
985  ((key1.offset < key2.offset) ? -1 :\
986  ((key1.offset > key2.offset) ? 1 :\
987  0))))))
988 
989 _Post_satisfies_(return>=n)
991  if (n & (a - 1))
992  n = (n + a) & ~(a - 1);
993 
994  return n;
995 }
996 
997 __inline static bool is_subvol_readonly(root* r, PIRP Irp) {
998  if (!(r->root_item.flags & BTRFS_SUBVOL_READONLY))
999  return false;
1000 
1001  if (!r->reserved)
1002  return true;
1003 
1004  return (!Irp || Irp->RequestorMode == UserMode) && PsGetCurrentProcess() != r->reserved ? true : false;
1005 }
1006 
1008  switch (type) {
1009  case TYPE_TREE_BLOCK_REF:
1010  return sizeof(TREE_BLOCK_REF);
1011 
1012  case TYPE_EXTENT_DATA_REF:
1013  return sizeof(EXTENT_DATA_REF);
1014 
1015  case TYPE_EXTENT_REF_V0:
1016  return sizeof(EXTENT_REF_V0);
1017 
1018  case TYPE_SHARED_BLOCK_REF:
1019  return sizeof(SHARED_BLOCK_REF);
1020 
1021  case TYPE_SHARED_DATA_REF:
1022  return sizeof(SHARED_DATA_REF);
1023 
1024  default:
1025  return 0;
1026  }
1027 }
1028 
1030  switch (type) {
1031  case TYPE_TREE_BLOCK_REF:
1032  return 1;
1033 
1034  case TYPE_EXTENT_DATA_REF:
1035  {
1037  return edr->count;
1038  }
1039 
1040  case TYPE_EXTENT_REF_V0:
1041  {
1042  EXTENT_REF_V0* erv0 = (EXTENT_REF_V0*)data;
1043  return erv0->count;
1044  }
1045 
1046  case TYPE_SHARED_BLOCK_REF:
1047  return 1;
1048 
1049  case TYPE_SHARED_DATA_REF:
1050  {
1052  return sdr->count;
1053  }
1054 
1055  default:
1056  return 0;
1057  }
1058 }
1059 
1060 // in btrfs.c
1063 
1064 _Success_(return)
1065 bool get_file_attributes_from_xattr(_In_reads_bytes_(len) char* val, _In_ uint16_t len, _Out_ ULONG* atts);
1066 
1068  _In_ uint8_t type, _In_ bool dotfile, _In_ bool ignore_xa, _In_opt_ PIRP Irp);
1069 
1071 bool get_xattr(_In_ _Requires_lock_held_(_Curr_->tree_lock) device_extension* Vcb, _In_ root* subvol, _In_ uint64_t inode, _In_z_ char* name, _In_ uint32_t crc32,
1073 
1074 #ifndef DEBUG_FCB_REFCOUNTS
1075 void free_fcb(_Inout_ fcb* fcb);
1076 #endif
1077 void free_fileref(_Inout_ file_ref* fr);
1079 bool is_top_level(_In_ PIRP Irp);
1081  _Out_ root** rootptr, _In_ bool no_tree, _In_ uint64_t offset, _In_opt_ PIRP Irp);
1084  _Out_writes_bytes_opt_(OutputBufferSize) PVOID OutputBuffer, _In_ ULONG OutputBufferSize, _In_ bool Override, _Out_opt_ IO_STATUS_BLOCK* iosb);
1085 bool is_file_name_valid(_In_ PUNICODE_STRING us, _In_ bool posix);
1088 
1089 #ifdef DEBUG_CHUNK_LOCKS
1090 #define acquire_chunk_lock(c, Vcb) { ExAcquireResourceExclusiveLite(&c->lock, true); InterlockedIncrement(&Vcb->chunk_locks_held); }
1091 #define release_chunk_lock(c, Vcb) { InterlockedDecrement(&Vcb->chunk_locks_held); ExReleaseResourceLite(&c->lock); }
1092 #else
1093 #define acquire_chunk_lock(c, Vcb) ExAcquireResourceExclusiveLite(&(c)->lock, true)
1094 #define release_chunk_lock(c, Vcb) ExReleaseResourceLite(&(c)->lock)
1095 #endif
1096 
1097 _Ret_z_
1100 void mark_fcb_dirty(_In_ fcb* fcb);
1101 void mark_fileref_dirty(_In_ file_ref* fileref);
1105 void init_device(_In_ device_extension* Vcb, _Inout_ device* dev, _In_ bool get_nums);
1108  _Out_writes_bytes_(Length) PUCHAR Buffer, _In_ bool override);
1112 
1113 _Function_class_(DRIVER_ADD_DEVICE)
1115 
1116 void reap_fcb(fcb* fcb);
1121 NTSTATUS utf8_to_utf16(WCHAR* dest, ULONG dest_max, ULONG* dest_len, char* src, ULONG src_len);
1122 NTSTATUS utf16_to_utf8(char* dest, ULONG dest_max, ULONG* dest_len, WCHAR* src, ULONG src_len);
1124 
1125 #ifdef _MSC_VER
1126 #define funcname __FUNCTION__
1127 #else
1128 #define funcname __func__
1129 #endif
1130 
1131 extern bool have_sse2;
1132 
1133 extern uint32_t mount_compress;
1136 extern uint32_t mount_zlib_level;
1137 extern uint32_t mount_zstd_level;
1139 extern uint32_t mount_max_inline;
1141 extern uint32_t mount_no_barrier;
1142 extern uint32_t mount_no_trim;
1145 extern uint32_t mount_readonly;
1146 extern uint32_t no_pnp;
1147 
1148 #ifdef _DEBUG
1149 
1150 extern bool log_started;
1151 extern uint32_t debug_log_level;
1152 
1153 #ifdef DEBUG_LONG_MESSAGES
1154 
1155 #define MSG(fn, file, line, s, level, ...) (!log_started || level <= debug_log_level) ? _debug_message(fn, file, line, s, ##__VA_ARGS__) : 0
1156 
1157 #define TRACE(s, ...) MSG(funcname, __FILE__, __LINE__, s, 3, ##__VA_ARGS__)
1158 #define WARN(s, ...) MSG(funcname, __FILE__, __LINE__, s, 2, ##__VA_ARGS__)
1159 #define FIXME(s, ...) MSG(funcname, __FILE__, __LINE__, s, 1, ##__VA_ARGS__)
1160 #define ERR(s, ...) MSG(funcname, __FILE__, __LINE__, s, 1, ##__VA_ARGS__)
1161 
1162 void _debug_message(_In_ const char* func, _In_ const char* file, _In_ unsigned int line, _In_ char* s, ...);
1163 
1164 #else
1165 
1166 #define MSG(fn, s, level, ...) (!log_started || level <= debug_log_level) ? _debug_message(fn, s, ##__VA_ARGS__) : 0
1167 
1168 #define TRACE(s, ...) MSG(funcname, s, 3, ##__VA_ARGS__)
1169 #define WARN(s, ...) MSG(funcname, s, 2, ##__VA_ARGS__)
1170 #define FIXME(s, ...) MSG(funcname, s, 1, ##__VA_ARGS__)
1171 #define ERR(s, ...) MSG(funcname, s, 1, ##__VA_ARGS__)
1172 
1173 void _debug_message(_In_ const char* func, _In_ char* s, ...);
1174 
1175 #endif
1176 
1177 #else
1178 
1179 #define TRACE(s, ...)
1180 #define WARN(s, ...)
1181 #define FIXME(s, ...) DbgPrint("Btrfs FIXME : %s : " s, funcname, ##__VA_ARGS__)
1182 #define ERR(s, ...) DbgPrint("Btrfs ERR : %s : " s, funcname, ##__VA_ARGS__)
1183 
1184 #endif
1185 
1186 #ifdef DEBUG_FCB_REFCOUNTS
1187 void _free_fcb(_Inout_ fcb* fcb, _In_ const char* func);
1188 #define free_fcb(fcb) _free_fcb(fcb, funcname)
1189 #endif
1190 
1191 // in fastio.c
1193 
1194 // in crc32c.c
1196 
1197 typedef struct {
1203 } rollback_space;
1204 
1205 typedef struct {
1208 } rollback_extent;
1209 
1215 };
1216 
1217 typedef struct {
1219  void* ptr;
1221 } rollback_item;
1222 
1223 typedef struct {
1228 } ea_item;
1229 
1230 static const char lxuid[] = "$LXUID";
1231 static const char lxgid[] = "$LXGID";
1232 static const char lxmod[] = "$LXMOD";
1233 static const char lxdev[] = "$LXDEV";
1234 
1235 // in treefuncs.c
1237  _In_ const KEY* searchkey, _In_ bool ignore, _In_opt_ PIRP Irp);
1239 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);
1240 bool find_prev_item(_Requires_lock_held_(_Curr_->tree_lock) device_extension* Vcb, const traverse_ptr* tp, traverse_ptr* prev_tp, PIRP Irp);
1246 void free_tree(tree* t);
1254 void clear_batch_list(device_extension* Vcb, LIST_ENTRY* batchlist);
1255 NTSTATUS skip_to_difference(device_extension* Vcb, traverse_ptr* tp, traverse_ptr* tp2, bool* ended1, bool* ended2);
1256 
1257 // in search.c
1259 
1260 _Function_class_(KSTART_ROUTINE)
1261 void __stdcall mountmgr_thread(_In_ void* context);
1262 
1263 _Function_class_(DRIVER_NOTIFICATION_CALLBACK_ROUTINE)
1265 
1269 
1270 _Function_class_(DRIVER_NOTIFICATION_CALLBACK_ROUTINE)
1272 
1274  _In_ volume_child* vc, _In_ bool skip_dev);
1275 
1276 // in cache.c
1278 void free_cache();
1280 
1281 // in write.c
1283 NTSTATUS write_file2(device_extension* Vcb, PIRP Irp, LARGE_INTEGER offset, void* buf, ULONG* length, bool paging_io, bool no_cache,
1284  bool wait, bool deferred_write, bool write_irp, LIST_ENTRY* rollback);
1289 NTSTATUS alloc_chunk(device_extension* Vcb, uint64_t flags, chunk** pc, bool full_size);
1294 
1298 
1303 
1313 void add_extent(_In_ fcb* fcb, _In_ LIST_ENTRY* prevextle, _In_ __drv_aliasesMem extent* newext);
1314 
1315 // in dirctrl.c
1316 
1319 NTSTATUS __stdcall drv_directory_control(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
1320 
1323 
1324 // in security.c
1325 
1328 NTSTATUS __stdcall drv_query_security(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
1329 
1333 
1334 void fcb_get_sd(fcb* fcb, struct _fcb* parent, bool look_for_xattr, PIRP Irp);
1335 void add_user_mapping(WCHAR* sidstring, ULONG sidstringlength, uint32_t uid);
1336 void add_group_mapping(WCHAR* sidstring, ULONG sidstringlength, uint32_t gid);
1339 NTSTATUS fcb_get_new_sd(fcb* fcb, file_ref* parfileref, ACCESS_STATE* as);
1340 void find_gid(struct _fcb* fcb, struct _fcb* parfcb, PSECURITY_SUBJECT_CONTEXT subjcont);
1341 
1342 // in fileinfo.c
1343 
1346 NTSTATUS __stdcall drv_set_information(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
1347 
1350 NTSTATUS __stdcall drv_query_information(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
1351 
1355 
1359 
1360 bool has_open_children(file_ref* fileref);
1362 NTSTATUS fileref_get_filename(file_ref* fileref, PUNICODE_STRING fn, USHORT* name_offset, ULONG* preqlen);
1365 
1366 // in reparse.c
1371 
1372 // in create.c
1373 
1377 
1379  _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,
1380  _In_ bool case_sensitive, _In_opt_ PIRP Irp);
1382  root* subvol, uint64_t inode, uint8_t type, PANSI_STRING utf8, bool always_add_hl, fcb* parent, fcb** pfcb, POOL_TYPE pooltype, PIRP Irp);
1384 NTSTATUS load_dir_children(_Requires_lock_held_(_Curr_->tree_lock) device_extension* Vcb, fcb* fcb, bool ignore_size, PIRP Irp);
1387  _In_ file_ref* sf, _In_ PUNICODE_STRING name, _In_ bool case_sensitive, _In_ bool lastpart, _In_ bool streampart,
1388  _In_ POOL_TYPE pooltype, _Out_ file_ref** psf2, _In_opt_ PIRP Irp);
1390 NTSTATUS find_file_in_dir(PUNICODE_STRING filename, fcb* fcb, root** subvol, uint64_t* inode, dir_child** pdc, bool case_sensitive);
1391 uint32_t inherit_mode(fcb* parfcb, bool is_dir);
1394 
1395 // in fsctl.c
1399 void flush_subvol_fcbs(root* subvol);
1400 bool fcb_is_inline(fcb* fcb);
1401 
1402 // in flushthread.c
1403 
1404 _Function_class_(KSTART_ROUTINE)
1405 void __stdcall flush_thread(void* context);
1406 
1409 NTSTATUS flush_fcb(fcb* fcb, bool cache, LIST_ENTRY* batchlist, PIRP Irp);
1413 NTSTATUS do_tree_writes(device_extension* Vcb, LIST_ENTRY* tree_writes, bool no_free);
1421 
1422 // in read.c
1423 
1427 
1430  _In_ ULONG priority);
1433 NTSTATUS do_read(PIRP Irp, bool wait, ULONG* bytes_read);
1435 void raid6_recover2(uint8_t* sectors, uint16_t num_stripes, ULONG sector_size, uint16_t missing1, uint16_t missing2, uint8_t* out);
1436 
1437 // in pnp.c
1438 
1442 
1445 
1446 // in free-space.c
1458 
1459 // in extent-tree.c
1462  uint32_t refcount, bool superseded, PIRP Irp);
1470  int32_t count, bool no_csum, bool superseded, PIRP Irp);
1477 
1478 // in worker-thread.c
1482 
1483 // in registry.c
1484 void read_registry(PUNICODE_STRING regpath, bool refresh);
1488 void watch_registry(HANDLE regh);
1489 
1490 // in compress.c
1494 NTSTATUS write_compressed_bit(fcb* fcb, uint64_t start_data, uint64_t end_data, void* data, bool* compressed, PIRP Irp, LIST_ENTRY* rollback);
1495 
1496 // in galois.c
1498 void galois_divpower(uint8_t* data, uint8_t div, uint32_t readlen);
1502 
1503 // in devctrl.c
1504 
1507 NTSTATUS __stdcall drv_device_control(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
1508 
1509 // in calcthread.c
1510 
1511 _Function_class_(KSTART_ROUTINE)
1512 void __stdcall calc_thread(void* context);
1513 
1515 void free_calc_job(calc_job* cj);
1516 
1517 // in balance.c
1525 
1526 _Function_class_(KSTART_ROUTINE)
1527 void __stdcall balance_thread(void* context);
1528 
1529 // in volume.c
1549 void add_volume_device(superblock* sb, PUNICODE_STRING devpath, uint64_t length, ULONG disk_num, ULONG part_num);
1551 
1552 _Function_class_(DRIVER_NOTIFICATION_CALLBACK_ROUTINE)
1554 
1555 // in scrub.c
1561 
1562 // in send.c
1565 
1566 // in fsrtl.c
1568 
1569 // in boot.c
1571 
1572 // based on function in sys/sysmacros.h
1573 #define makedev(major, minor) (((minor) & 0xFF) | (((major) & 0xFFF) << 8) | (((uint64_t)((minor) & ~0xFF)) << 12) | (((uint64_t)((major) & ~0xFFF)) << 32))
1574 
1575 #define fast_io_possible(fcb) (!FsRtlAreThereCurrentFileLocks(&fcb->lock) && !fcb->Vcb->readonly ? FastIoIsPossible : FastIoIsQuestionable)
1576 
1577 static __inline void print_open_trees(device_extension* Vcb) {
1578  LIST_ENTRY* le = Vcb->trees.Flink;
1579  while (le != &Vcb->trees) {
1581  tree_data* td = CONTAINING_RECORD(t->itemlist.Flink, tree_data, list_entry);
1582  ERR("tree %p: root %I64x, level %u, first key (%I64x,%x,%I64x)\n",
1583  t, t->root->id, t->header.level, td->key.obj_id, td->key.obj_type, td->key.offset);
1584 
1585  le = le->Flink;
1586  }
1587 }
1588 
1589 static __inline bool write_fcb_compressed(fcb* fcb) {
1590  // make sure we don't accidentally write the cache inodes or pagefile compressed
1592  return false;
1593 
1594  if (fcb->Vcb->options.compress_force)
1595  return true;
1596 
1598  return false;
1599 
1600  if (fcb->inode_item.flags & BTRFS_INODE_COMPRESS || fcb->Vcb->options.compress)
1601  return true;
1602 
1603  return false;
1604 }
1605 
1606 static __inline void do_xor(uint8_t* buf1, uint8_t* buf2, uint32_t len) {
1607  uint32_t j;
1608 #ifndef __REACTOS__
1609  __m128i x1, x2;
1610 #endif
1611 
1612 #ifndef __REACTOS__
1613  if (have_sse2 && ((uintptr_t)buf1 & 0xf) == 0 && ((uintptr_t)buf2 & 0xf) == 0) {
1614  while (len >= 16) {
1615  x1 = _mm_load_si128((__m128i*)buf1);
1616  x2 = _mm_load_si128((__m128i*)buf2);
1617  x1 = _mm_xor_si128(x1, x2);
1618  _mm_store_si128((__m128i*)buf1, x1);
1619 
1620  buf1 += 16;
1621  buf2 += 16;
1622  len -= 16;
1623  }
1624  }
1625 #endif
1626 
1627  for (j = 0; j < len; j++) {
1628  *buf1 ^= *buf2;
1629  buf1++;
1630  buf2++;
1631  }
1632 }
1633 
1634 #ifdef DEBUG_FCB_REFCOUNTS
1635 #ifdef DEBUG_LONG_MESSAGES
1636 #define increase_fileref_refcount(fileref) {\
1637  LONG rc = InterlockedIncrement(&fileref->refcount);\
1638  MSG(funcname, __FILE__, __LINE__, "fileref %p: refcount now %i\n", 1, fileref, rc);\
1639 }
1640 #else
1641 #define increase_fileref_refcount(fileref) {\
1642  LONG rc = InterlockedIncrement(&fileref->refcount);\
1643  MSG(funcname, "fileref %p: refcount now %i\n", 1, fileref, rc);\
1644 }
1645 #endif
1646 #else
1647 #define increase_fileref_refcount(fileref) InterlockedIncrement(&fileref->refcount)
1648 #endif
1649 
1650 #ifdef _MSC_VER
1651 #define int3 __debugbreak()
1652 #else
1653 #define int3 asm("int3;")
1654 #endif
1655 
1656 #define hex_digit(c) ((c) <= 9) ? ((c) + '0') : ((c) - 10 + 'a')
1657 
1658 // FIXME - find a way to catch unfreed trees again
1659 
1660 // from sys/stat.h
1661 #define __S_IFMT 0170000 /* These bits determine file type. */
1662 #define __S_IFDIR 0040000 /* Directory. */
1663 #define __S_IFCHR 0020000 /* Character device. */
1664 #define __S_IFBLK 0060000 /* Block device. */
1665 #define __S_IFREG 0100000 /* Regular file. */
1666 #define __S_IFIFO 0010000 /* FIFO. */
1667 #define __S_IFLNK 0120000 /* Symbolic link. */
1668 #define __S_IFSOCK 0140000 /* Socket. */
1669 #define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
1670 
1671 #ifndef S_ISDIR
1672 #define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
1673 #endif
1674 
1675 #ifndef S_IRUSR
1676 #define S_IRUSR 0000400
1677 #endif
1678 
1679 #ifndef S_IWUSR
1680 #define S_IWUSR 0000200
1681 #endif
1682 
1683 #ifndef S_IXUSR
1684 #define S_IXUSR 0000100
1685 #endif
1686 
1687 #ifdef __REACTOS__
1688 #define S_IFDIR __S_IFDIR
1689 #define S_IFREG __S_IFREG
1690 #endif /* __REACTOS__ */
1691 
1692 #ifndef S_IRGRP
1693 #define S_IRGRP (S_IRUSR >> 3)
1694 #endif
1695 
1696 #ifndef S_IWGRP
1697 #define S_IWGRP (S_IWUSR >> 3)
1698 #endif
1699 
1700 #ifndef S_IXGRP
1701 #define S_IXGRP (S_IXUSR >> 3)
1702 #endif
1703 
1704 #ifndef S_IROTH
1705 #define S_IROTH (S_IRGRP >> 3)
1706 #endif
1707 
1708 #ifndef S_IWOTH
1709 #define S_IWOTH (S_IWGRP >> 3)
1710 #endif
1711 
1712 #ifndef S_IXOTH
1713 #define S_IXOTH (S_IXGRP >> 3)
1714 #endif
1715 
1716 #ifndef S_ISUID
1717 #define S_ISUID 0004000
1718 #endif
1719 
1720 #ifndef S_ISGID
1721 #define S_ISGID 0002000
1722 #endif
1723 
1724 #ifndef S_ISVTX
1725 #define S_ISVTX 0001000
1726 #endif
1727 
1728 // based on functions in sys/sysmacros.h
1729 #define major(rdev) ((((rdev) >> 8) & 0xFFF) | ((uint32_t)((rdev) >> 32) & ~0xFFF))
1730 #define minor(rdev) (((rdev) & 0xFF) | ((uint32_t)((rdev) >> 12) & ~0xFF))
1731 
1732 static __inline uint64_t fcb_alloc_size(fcb* fcb) {
1733  if (S_ISDIR(fcb->inode_item.st_mode))
1734  return 0;
1735  else if (fcb->atts & FILE_ATTRIBUTE_SPARSE_FILE)
1736  return fcb->inode_item.st_blocks;
1737  else
1738  return sector_align(fcb->inode_item.st_size, fcb->Vcb->superblock.sector_size);
1739 }
1740 
1742 
1744  ULONG ReadOperationCount, ULONG WriteOperationCount, ULONG FlushOperationCount);
1745 
1747  PVOID Buffer, PETHREAD IoIssuerThread);
1748 
1750  PVOID Buffer, PIO_STATUS_BLOCK IoStatus, PETHREAD IoIssuerThread);
1751 
1752 #ifndef CC_ENABLE_DISK_IO_ACCOUNTING
1753 #define CC_ENABLE_DISK_IO_ACCOUNTING 0x00000010
1754 #endif
1755 
1756 #if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA)
1757 typedef struct _ECP_LIST ECP_LIST;
1758 typedef struct _ECP_LIST *PECP_LIST;
1759 #endif
1760 
1762 
1764 
1766 
1768 
1771 
1773 
1774 #ifndef __REACTOS__
1775 #ifndef _MSC_VER
1777 #endif
1778 
1779 // not in DDK headers - taken from winternl.h
1780 typedef struct _LDR_DATA_TABLE_ENTRY {
1789  union {
1792  };
1795 
1796 typedef struct _PEB_LDR_DATA {
1801 
1808 
1810 
1811 typedef struct _PEB {
1824 } PEB,*PPEB;
1825 #endif
1826 
1827 #ifdef _MSC_VER
1831  IN PROCESSINFOCLASS ProcessInformationClass,
1832  OUT PVOID ProcessInformation,
1833  IN ULONG ProcessInformationLength,
1835 );
1836 #endif
uint64_t get_extent_data_ref_hash2(uint64_t root, uint64_t objid, uint64_t offset)
Definition: extent-tree.c:34
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
void add_volume_device(superblock *sb, PUNICODE_STRING devpath, uint64_t length, ULONG disk_num, ULONG part_num)
Definition: volume.c:1105
NTSTATUS do_load_tree(device_extension *Vcb, tree_holder *th, root *r, tree *t, tree_data *td, PIRP Irp)
Definition: treefuncs.c:218
LIST_ENTRY * list_size
Definition: btrfs_drv.h:1199
SHARED_DATA_REF sdr
Definition: btrfs_drv.h:601
struct _file_ref * parent
Definition: btrfs_drv.h:346
Definition: cache.c:46
_Must_inspect_result_ _In_ FSRTL_ALLOCATE_ECPLIST_FLAGS _Outptr_ PECP_LIST * EcpList
Definition: fltkernel.h:2511
LIST_ENTRY list_entry
Definition: btrfs_drv.h:485
GLenum func
Definition: glext.h:6028
mount_options options
Definition: btrfs_drv.h:730
void free_fileref(_Inout_ file_ref *fr)
Definition: btrfs.c:1820
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1203
ULONG * bmparr
Definition: btrfs_drv.h:541
uint64_t obj_id
Definition: btrfs.h:127
void galois_double(uint8_t *data, uint32_t len)
Definition: galois.c:109
struct _FILE_ID_128 * PFILE_ID_128
void do_rollback(device_extension *Vcb, LIST_ENTRY *rollback)
Definition: treefuncs.c:1049
struct _DUPLICATE_EXTENTS_DATA DUPLICATE_EXTENTS_DATA
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
#define _Ret_z_
Definition: no_sal2.h:625
static PIO_STATUS_BLOCK iosb
Definition: file.c:98
struct _LDR_DATA_TABLE_ENTRY LDR_DATA_TABLE_ENTRY
BYTE Reserved4[104]
Definition: btrfs_drv.h:1818
void clear_rollback(LIST_ENTRY *rollback)
Definition: treefuncs.c:1028
NTSTATUS(* tIoUnregisterPlugPlayNotificationEx)(PVOID NotificationEntry)
Definition: btrfs_drv.h:1765
uint16_t last_stripe
Definition: btrfs_drv.h:574
GLint level
Definition: gl.h:1546
struct _root * root
Definition: btrfs_drv.h:428
#define IN
Definition: typedefs.h:38
PDEVICE_OBJECT buspdo
Definition: btrfs_drv.h:816
NTSTATUS zstd_decompress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen)
Definition: compress.c:1133
return
Definition: dirsup.c:529
bool has_address
Definition: btrfs_drv.h:423
struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER * PFSCTL_GET_INTEGRITY_INFORMATION_BUFFER
uint32_t mount_compress_type
Definition: btrfs.c:78
static const char lxuid[]
Definition: btrfs_drv.h:1230
NTSTATUS read_send_buffer(device_extension *Vcb, PFILE_OBJECT FileObject, void *data, ULONG datalen, ULONG_PTR *retlen, KPROCESSOR_MODE processor_mode)
Definition: send.c:3835
_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
Definition: btrfs_drv.h:1301
UNICODE_STRING pnp_name
Definition: btrfs_drv.h:827
void reap_fcb(fcb *fcb)
Definition: btrfs.c:1712
LIST_ENTRY trees
Definition: btrfs_drv.h:776
WCHAR * debug_desc
Definition: btrfs_drv.h:347
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesWritten
Definition: fltkernel.h:1293
LIST_ENTRY trees_hash
Definition: btrfs_drv.h:777
void trim_whole_device(device *dev)
Definition: fsctl.c:2698
struct _file_ref * fileref
Definition: btrfs_drv.h:250
uint16_t size
Definition: btrfs_drv.h:550
#define true
Definition: stdbool.h:37
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
_In_ ULONG cj
Definition: winddi.h:3540
root * data_reloc_root
Definition: btrfs_drv.h:770
LIST_ENTRY space
Definition: btrfs_drv.h:526
uint8_t obj_type
Definition: btrfs.h:128
NTSTATUS remove_device(device_extension *Vcb, void *data, ULONG length, KPROCESSOR_MODE processor_mode)
Definition: balance.c:3779
_In_ uint16_t len
Definition: btrfs_drv.h:1065
LIST_ENTRY dirty_filerefs
Definition: btrfs_drv.h:783
PFILE_OBJECT fileobj
Definition: btrfs_drv.h:513
bool skip_balance
Definition: btrfs_drv.h:650
scrub_info scrub
Definition: btrfs_drv.h:793
NTSTATUS do_read_job(PIRP Irp)
Definition: worker-thread.c:26
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
PAGED_LOOKASIDE_LIST batch_item_lookaside
Definition: btrfs_drv.h:800
void init_fast_io_dispatch(FAST_IO_DISPATCH **fiod)
Definition: fastio.c:468
LIST_ENTRY list_entry
Definition: btrfs_drv.h:579
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)
Definition: extent-tree.c:1950
NTSTATUS vol_query_volume_information(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:315
LIST_ENTRY list_entry
Definition: btrfs_drv.h:1227
chunk * c
Definition: btrfs_drv.h:914
#define FILE_ATTRIBUTE_SPARSE_FILE
Definition: ntifs_ex.h:380
uint32_t calc_crc32c(_In_ uint32_t seed, _In_reads_bytes_(msglen) uint8_t *msg, _In_ ULONG msglen)
Definition: crc32c.c:116
uint64_t start
Definition: btrfs_drv.h:533
NTSTATUS init_cache()
Definition: cache.c:85
LIST_ENTRY list_entry
Definition: btrfs_drv.h:527
uint64_t system_flags
Definition: btrfs_drv.h:761
rwlock_t lock
Definition: tcpcore.h:1163
void free_write_data_stripes(write_data_context *wtc)
Definition: write.c:2291
#define _Create_lock_level_(a)
Definition: btrfs_drv.h:192
LIST_ENTRY list_entry
Definition: btrfs_drv.h:593
#define _Dispatch_type_(a)
Definition: btrfs_drv.h:191
ULONG options
Definition: btrfs_drv.h:369
NTSTATUS fsctl_request(PDEVICE_OBJECT DeviceObject, PIRP *Pirp, uint32_t type)
Definition: fsctl.c:4838
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)
Definition: create.c:3932
PAGED_LOOKASIDE_LIST fcb_lookaside
Definition: btrfs_drv.h:802
#define IRP_MJ_QUERY_SECURITY
_In_ PFCB _In_ LONGLONG StartingOffset
Definition: cdprocs.h:282
#define error(str)
Definition: mkdosfs.c:1605
uint32_t adshash
Definition: btrfs_drv.h:320
bool paused
Definition: btrfs_drv.h:713
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
struct _root_cache root_cache
NPAGED_LOOKASIDE_LIST fcb_np_lookaside
Definition: btrfs_drv.h:806
PAGED_LOOKASIDE_LIST traverse_ptr_lookaside
Definition: btrfs_drv.h:799
static const char lxdev[]
Definition: btrfs_drv.h:1233
static __inline void do_xor(uint8_t *buf1, uint8_t *buf2, uint32_t len)
Definition: btrfs_drv.h:1606
NTSTATUS fileref_get_filename(file_ref *fileref, PUNICODE_STRING fn, USHORT *name_offset, ULONG *preqlen)
Definition: fileinfo.c:3172
uint64_t offset
Definition: btrfs_drv.h:694
void space_list_subtract(chunk *c, bool deleting, uint64_t address, uint64_t length, LIST_ENTRY *rollback)
Definition: free-space.c:2046
struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER * PFSCTL_SET_INTEGRITY_INFORMATION_BUFFER
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
NTSTATUS vol_set_security(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:875
Definition: http.c:6587
NTSTATUS start_scrub(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
Definition: scrub.c:3266
LIST_ENTRY list_entry
Definition: btrfs_drv.h:460
uint32_t count
Definition: btrfs.h:410
UNICODE_STRING name_uc
Definition: btrfs_drv.h:248
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
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)
Definition: write.c:2166
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
bool dirty
Definition: btrfs_drv.h:309
NTSTATUS vol_query_security(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:869
_In_ PIRP Irp
Definition: csq.h:116
superblock * sb
Definition: btrfs.c:4162
root * checksum_root
Definition: btrfs_drv.h:767
#define pt(x, y)
Definition: drawing.c:79
void add_user_mapping(WCHAR *sidstring, ULONG sidstringlength, uint32_t uid)
Definition: security.c:56
static const BYTE us[]
Definition: encode.c:689
bool inserted
Definition: btrfs_drv.h:403
void raid6_recover2(uint8_t *sectors, uint16_t num_stripes, ULONG sector_size, uint16_t missing1, uint16_t missing2, uint8_t *out)
Definition: read.c:842
tree_nonpaged * nonpaged
Definition: btrfs_drv.h:420
UNICODE_STRING us
Definition: btrfs_drv.h:919
NTSTATUS find_chunk_usage(_In_ _Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, _In_opt_ PIRP Irp)
Definition: btrfs.c:3781
NTSTATUS uid_to_sid(uint32_t uid, PSID *sid)
Definition: security.c:229
ULONG size
Definition: btrfs_drv.h:249
NTSTATUS load_tree(device_extension *Vcb, uint64_t addr, uint8_t *buf, root *r, tree **pt)
Definition: treefuncs.c:20
_In_ ULONG * pcj
Definition: winddi.h:3642
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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)
Definition: extent-tree.c:902
DRIVER_ADD_DEVICE AddDevice
Definition: parport.h:72
LIST_ENTRY list_entry
Definition: btrfs_drv.h:604
struct _FILE_ID_128 FILE_ID_128
root * root
Definition: btrfs_drv.h:500
uint64_t offset
Definition: btrfs_drv.h:551
IN PIRP Irp
Definition: btrfs_drv.h:1297
void fcb_get_sd(fcb *fcb, struct _fcb *parent, bool look_for_xattr, PIRP Irp)
Definition: security.c:511
GLuint GLuint GLsizei count
Definition: gl.h:1545
struct _tree tree
NTSTATUS compat_FsRtlValidateReparsePointBuffer(IN ULONG BufferLength, IN PREPARSE_DATA_BUFFER ReparseBuffer)
Definition: fsrtl.c:32
int ignore(int trapCode, ppc_trap_frame_t *trap)
Definition: mmuobject.c:296
bool reparse_xattr_changed
Definition: btrfs_drv.h:313
NTSTATUS do_write(device_extension *Vcb, PIRP Irp)
Definition: flushthread.c:7652
#define IRP_MJ_SET_SECURITY
struct _device_extension device_extension
unsigned char * PUCHAR
Definition: retypes.h:3
fcb * create_fcb(device_extension *Vcb, POOL_TYPE pool_type)
Definition: create.c:48
PDEVICE_OBJECT devobj
Definition: btrfs_drv.h:512
uint32_t mount_allow_degraded
Definition: btrfs.c:87
struct _root root
#define _In_reads_bytes_opt_(size)
Definition: no_sal2.h:230
superblock superblock
Definition: btrfs_drv.h:738
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
NTSTATUS registry_mark_volume_mounted(BTRFS_UUID *uuid)
Definition: registry.c:229
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
PDEVICE_OBJECT device
Definition: btrfs_drv.h:842
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)
Definition: create.c:598
NTSTATUS calc_csum(_In_ device_extension *Vcb, _In_reads_bytes_(sectors *Vcb->superblock.sector_size) uint8_t *data, _In_ uint32_t sectors, _Out_writes_bytes_(sectors *sizeof(uint32_t)) uint32_t *csum)
Definition: write.c:2782
#define FSRTL_FLAG2_IS_PAGING_FILE
Definition: fsrtltypes.h:57
bool can_flush
Definition: btrfs_drv.h:520
void reap_filerefs(device_extension *Vcb, file_ref *fr)
Definition: btrfs.c:1875
NTSTATUS(* tFsRtlValidateReparsePointBuffer)(ULONG BufferLength, PREPARSE_DATA_BUFFER ReparseBuffer)
Definition: btrfs_drv.h:1772
LONG NTSTATUS
Definition: precomp.h:26
PAGED_LOOKASIDE_LIST tree_data_lookaside
Definition: btrfs_drv.h:798
batch_operation
Definition: btrfs_drv.h:464
bool sd_deleted
Definition: btrfs_drv.h:310
VOID(* tCcSetAdditionalCacheAttributesEx)(PFILE_OBJECT FileObject, ULONG Flags)
Definition: btrfs_drv.h:1761
bool no_barrier
Definition: btrfs_drv.h:651
#define ERR(s,...)
Definition: btrfs_drv.h:1182
GLintptr offset
Definition: glext.h:5920
tree_holder treeholder
Definition: btrfs_drv.h:406
ERESOURCE fileref_lock
Definition: btrfs_drv.h:752
LIST_ENTRY InMemoryOrderModuleList
Definition: btrfs_drv.h:1799
enum prop_compression_type prop_compression
Definition: btrfs_drv.h:297
uint16_t size
Definition: btrfs_drv.h:409
bool lock_paused_balance
Definition: btrfs_drv.h:742
ANSI_STRING ea_xattr
Definition: btrfs_drv.h:292
KEVENT event
Definition: btrfs_drv.h:710
bool dirty
Definition: btrfs_drv.h:451
uint64_t data_flags
Definition: btrfs_drv.h:759
ERESOURCE range_locks_lock
Definition: btrfs_drv.h:562
LIST_ENTRY list_entry_hash
Definition: btrfs_drv.h:431
NTSTATUS update_chunk_caches(device_extension *Vcb, PIRP Irp, LIST_ENTRY *rollback)
Definition: free-space.c:1846
NTSTATUS flush_partial_stripe(device_extension *Vcb, chunk *c, partial_stripe *ps)
Definition: flushthread.c:5794
#define TYPE_TREE_BLOCK_REF
Definition: btrfs.h:33
void init_file_cache(_In_ PFILE_OBJECT FileObject, _In_ CC_FILE_SIZES *ccfs)
Definition: btrfs.c:3974
void free_fcb(_Inout_ fcb *fcb)
Definition: btrfs.c:1703
GLdouble n
Definition: glext.h:7729
BYTE Reserved2[1]
Definition: btrfs_drv.h:1814
ERESOURCE chunk_lock
Definition: btrfs_drv.h:787
bool removing
Definition: btrfs_drv.h:674
PKTHREAD lazy_writer_thread
Definition: btrfs_drv.h:285
ERESOURCE dirty_filerefs_lock
Definition: btrfs_drv.h:784
GLdouble GLdouble t
Definition: gl.h:2047
ERESOURCE load_tree_lock
Definition: btrfs_drv.h:442
bool dev_readonly
Definition: btrfs_drv.h:676
NTSTATUS vol_set_ea(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:303
bool xattrs_changed
Definition: btrfs_drv.h:316
#define _Acquires_exclusive_lock_(a)
Definition: btrfs_drv.h:196
LIST_ENTRY list_entry_dirty
Definition: btrfs_drv.h:461
NTSTATUS vol_flush_buffers(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:309
Definition: write.c:111
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
file_ref_nonpaged * nonpaged
Definition: btrfs_drv.h:342
ANSI_STRING utf8
Definition: btrfs_drv.h:244
FT_UInt sid
Definition: cffcmap.c:139
ROOT_ITEM root_item
Definition: btrfs_drv.h:450
LIST_ENTRY list_entry
Definition: btrfs_drv.h:225
ANSI_STRING reparse_xattr
Definition: btrfs_drv.h:291
PDEVICE_OBJECT pdo
Definition: btrfs_drv.h:844
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
uint64_t used
Definition: btrfs_drv.h:552
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)
Definition: extent-tree.c:453
HANDLE thread
Definition: btrfs_drv.h:668
void free_cache()
Definition: cache.c:100
uint8_t compress_type
Definition: btrfs_drv.h:643
LIST_ENTRY errors
Definition: btrfs_drv.h:723
void get_raid56_lock_range(chunk *c, uint64_t address, uint64_t length, uint64_t *lockaddr, uint64_t *locklen)
Definition: write.c:2150
uint64_t address
Definition: btrfs_drv.h:540
uint32_t hash
Definition: btrfs_drv.h:245
GLuint buffer
Definition: glext.h:5915
BYTE BeingDebugged
Definition: btrfs_drv.h:1813
struct _PEB_LDR_DATA * PPEB_LDR_DATA
PNOTIFY_SYNC NotifySync
Definition: btrfs_drv.h:755
uint16_t datalen
Definition: btrfs_drv.h:219
uint32_t mount_readonly
Definition: btrfs.c:88
uint32_t mount_no_trim
Definition: btrfs.c:85
struct _volume_device_extension * vde
Definition: btrfs_drv.h:732
HDC dc
Definition: cylfrac.c:34
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)
Definition: extent-tree.c:2075
KEVENT event
Definition: btrfs_drv.h:619
uint32_t crc32
Definition: btrfs.c:4163
ERESOURCE load_lock
Definition: btrfs_drv.h:753
bool have_sse2
Definition: btrfs.c:69
bool readonly
Definition: btrfs_drv.h:517
NTSTATUS stop_scrub(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
Definition: scrub.c:3443
ERESOURCE send_load_lock
Definition: btrfs_drv.h:794
NTSTATUS get_device_pnp_name(_In_ PDEVICE_OBJECT DeviceObject, _Out_ PUNICODE_STRING pnp_name, _Out_ const GUID **guid)
Definition: btrfs.c:4134
bool clear_cache
Definition: btrfs_drv.h:653
GLuint GLuint end
Definition: gl.h:1545
uint64_t length
Definition: btrfs_drv.h:534
uint64_t old_size
Definition: btrfs_drv.h:586
uint64_t chunk_estimate_phys_size(device_extension *Vcb, chunk *c, uint64_t u)
Definition: btrfs.c:3761
void free_calc_job(calc_job *cj)
Definition: calcthread.c:53
bool readonly
Definition: btrfs_drv.h:567
void watch_registry(HANDLE regh)
Definition: registry.c:1020
NTSTATUS find_file_in_dir(PUNICODE_STRING filename, fcb *fcb, root **subvol, uint64_t *inode, dir_child **pdc, bool case_sensitive)
Definition: create.c:147
LONG open_count
Definition: btrfs_drv.h:345
RTL_BITMAP bmp
Definition: btrfs_drv.h:543
LONGLONG lastinode
Definition: btrfs_drv.h:447
ACCESS_MASK access
Definition: btrfs_drv.h:377
LIST_ENTRY fcbs
Definition: btrfs_drv.h:458
unsigned short int uint16_t
Definition: acefiex.h:54
bool is_extent_unique(device_extension *Vcb, uint64_t address, uint64_t size, PIRP Irp)
Definition: extent-tree.c:1696
NTSTATUS read_file(fcb *fcb, uint8_t *data, uint64_t start, uint64_t length, ULONG *pbr, PIRP Irp)
Definition: read.c:2715
#define uint16_t
Definition: nsiface.idl:60
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1114
NTSTATUS truncate_file(fcb *fcb, uint64_t end, PIRP Irp, LIST_ENTRY *rollback)
Definition: write.c:3236
ULONG part_num
Definition: btrfs_drv.h:833
LIST_ENTRY list_entry
Definition: btrfs_drv.h:430
FAST_MUTEX HeaderMutex
Definition: btrfs_drv.h:208
NTSTATUS vol_write(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:204
ERESOURCE paging_resource
Definition: btrfs_drv.h:211
NTSTATUS do_write_job(device_extension *Vcb, PIRP Irp)
Definition: worker-thread.c:68
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1027
bool atts_changed
Definition: btrfs_drv.h:311
LONG refcount
Definition: btrfs_drv.h:620
const char * filename
Definition: ioapi.h:135
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
NTSTATUS write_file(device_extension *Vcb, PIRP Irp, bool wait, bool deferred_write)
Definition: write.c:4634
NTSTATUS utf8_to_utf16(WCHAR *dest, ULONG dest_max, ULONG *dest_len, char *src, ULONG src_len)
Definition: btrfs.c:734
BOOLEAN(* tCcCopyReadEx)(PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, ULONG Length, BOOLEAN Wait, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, PETHREAD IoIssuerThread)
Definition: btrfs_drv.h:1749
LIST_ENTRY old_refs
Definition: btrfs_drv.h:592
PSID sid
Definition: btrfs_drv.h:875
bool updated_extents
Definition: btrfs_drv.h:434
uint32_t debug_log_level
Definition: btrfs.c:75
NTSTATUS query_balance(device_extension *Vcb, void *data, ULONG length)
Definition: balance.c:3691
uint64_t parent
Definition: btrfs_drv.h:454
device * device
Definition: btrfs_drv.h:894
bool manage_volume_privilege
Definition: btrfs_drv.h:374
uint64_t offset
Definition: btrfs.h:129
LIST_ENTRY list_entry
Definition: btrfs_drv.h:920
_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)
Definition: btrfs_drv.h:961
uint8_t * data
Definition: btrfs_drv.h:410
LARGE_INTEGER resume_time
Definition: btrfs_drv.h:716
device ** devices
Definition: btrfs_drv.h:554
bool ignore
Definition: btrfs_drv.h:221
NTSTATUS utf16_to_utf8(char *dest, ULONG dest_max, ULONG *dest_len, WCHAR *src, ULONG src_len)
Definition: btrfs.c:823
LIST_ENTRY devices
Definition: btrfs_drv.h:733
bool has_wildcard
Definition: btrfs_drv.h:372
#define _Requires_exclusive_lock_held_(a)
Definition: btrfs_drv.h:185
uint64_t fcbs_version
Definition: btrfs_drv.h:456
CHAR InputBuffer[80]
Definition: conmgr.c:33
UNICODE_STRING bus_name
Definition: btrfs_drv.h:818
PAGED_LOOKASIDE_LIST name_bit_lookaside
Definition: btrfs_drv.h:803
#define _In_opt_
Definition: no_sal2.h:213
struct _DUPLICATE_EXTENTS_DATA * PDUPLICATE_EXTENTS_DATA
balance_info balance
Definition: btrfs_drv.h:792
NTSTATUS stop_balance(device_extension *Vcb, KPROCESSOR_MODE processor_mode)
Definition: balance.c:3764
NTSTATUS error
Definition: btrfs_drv.h:721
SECTION_OBJECT_POINTERS segment_object
Definition: btrfs_drv.h:209
UNICODE_STRING filename
Definition: btrfs_drv.h:379
NTSTATUS mountmgr_add_drive_letter(PDEVICE_OBJECT mountmgr, PUNICODE_STRING devpath)
Definition: volume.c:881
uint64_t chunks_left
Definition: btrfs_drv.h:670
void galois_divpower(uint8_t *data, uint8_t div, uint32_t readlen)
Definition: galois.c:55
VOID(NTAPI * PPS_POST_PROCESS_INIT_ROUTINE)(VOID)
Definition: btrfs_drv.h:1809
bool posix_delete
Definition: btrfs_drv.h:339
struct _write_data_context * context
Definition: btrfs_drv.h:891
KTIMER flush_thread_timer
Definition: btrfs_drv.h:789
BTRFS_UUID uuid
Definition: btrfs_drv.h:822
static WCHAR superseded[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1817
LIST_ENTRY list_entry_all
Definition: btrfs_drv.h:326
bool user_set_write_time
Definition: btrfs_drv.h:384
UNICODE_STRING query_string
Definition: btrfs_drv.h:371
uint64_t oldindex
Definition: btrfs_drv.h:337
uint32_t ULONG_PTR
Definition: typedefs.h:63
KEVENT finished
Definition: btrfs_drv.h:680
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)
Definition: create.c:1348
bool is_top_level(_In_ PIRP Irp)
Definition: btrfs.c:272
_In_ fcb _In_ chunk _In_ uint64_t start_data
Definition: btrfs_drv.h:1301
void * data
Definition: btrfs_drv.h:482
uint64_t length
Definition: btrfs_drv.h:1201
Definition: fs.h:78
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
struct _RTL_USER_PROCESS_PARAMETERS * PRTL_USER_PROCESS_PARAMETERS
uint64_t address
Definition: btrfs_drv.h:505
UNICODE_STRING name
Definition: btrfs_drv.h:841
PVOID DllBase
Definition: btrfs_drv.h:1784
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)
Definition: btrfs.c:2603
uint64_t num_children
Definition: btrfs_drv.h:859
PDEVICE_OBJECT pdo
Definition: btrfs_drv.h:856
uint32_t sid_to_uid(PSID sid)
Definition: security.c:310
UNICODE_STRING bus_name
Definition: btrfs_drv.h:846
uint32_t mount_clear_cache
Definition: btrfs.c:86
bool inserted
Definition: btrfs_drv.h:222
root * extent_root
Definition: btrfs_drv.h:766
LIST_ENTRY list_entry
Definition: btrfs_drv.h:401
uint32_t hash_uc
Definition: btrfs_drv.h:247
ERESOURCE dirty_subvols_lock
Definition: btrfs_drv.h:786
bool ea_changed
Definition: btrfs_drv.h:314
KEY firstitem
Definition: btrfs_drv.h:702
struct _PEB * PPEB
static __inline uint64_t make_file_id(root *r, uint64_t inode)
Definition: btrfs_drv.h:976
fcb * old_cache
Definition: btrfs_drv.h:556
NTSTATUS add_dir_child(fcb *fcb, uint64_t inode, bool subvol, PANSI_STRING utf8, PUNICODE_STRING name, uint8_t type, dir_child **pdc)
Definition: create.c:1757
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSTATUS pnp_surprise_removal(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:252
void chunk_lock_range(_In_ device_extension *Vcb, _In_ chunk *c, _In_ uint64_t start, _In_ uint64_t length)
Definition: btrfs.c:5405
struct _device_extension * Vcb
Definition: btrfs_drv.h:425
NTSTATUS update_chunk_caches_tree(device_extension *Vcb, PIRP Irp)
Definition: free-space.c:1916
SECURITY_DESCRIPTOR * sd
Definition: btrfs_drv.h:282
const GUID * guid
PSID sid
Definition: btrfs_drv.h:869
root_nonpaged * nonpaged
Definition: btrfs_drv.h:449
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
file_ref * create_fileref(device_extension *Vcb)
Definition: create.c:116
EXTENT_DATA_REF edr
Definition: btrfs_drv.h:600
uint64_t oldused
Definition: btrfs_drv.h:553
void disk_arrival(PDRIVER_OBJECT DriverObject, PUNICODE_STRING devpath)
Definition: search.c:261
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
uint64_t get_extent_flags(device_extension *Vcb, uint64_t address, PIRP Irp)
Definition: extent-tree.c:1834
tree * tree
Definition: btrfs_drv.h:495
uint8_t * scratch
Definition: btrfs_drv.h:906
PVOID Reserved3[2]
Definition: btrfs_drv.h:1815
LIST_ENTRY drop_roots
Definition: btrfs_drv.h:763
chunk * chunk
Definition: btrfs_drv.h:1202
LIST_ENTRY send_ops
Definition: btrfs_drv.h:796
uint8_t gpow2(uint8_t e)
Definition: galois.c:69
ULONG change_count
Definition: btrfs_drv.h:521
void space_list_add(chunk *c, uint64_t address, uint64_t length, LIST_ENTRY *rollback)
Definition: free-space.c:1958
uint32_t mount_zlib_level
Definition: btrfs.c:79
uint64_t generation
Definition: btrfs_drv.h:824
LIST_ENTRY items
Definition: btrfs_drv.h:490
NTSTATUS add_space_entry(LIST_ENTRY *list, LIST_ENTRY *list_size, uint64_t offset, uint64_t size)
Definition: free-space.c:189
uint64_t id
Definition: btrfs_drv.h:446
NTSTATUS load_dir_children(_Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, fcb *fcb, bool ignore_size, PIRP Irp)
Definition: create.c:468
static __inline bool is_subvol_readonly(root *r, PIRP Irp)
Definition: btrfs_drv.h:997
ERESOURCE changed_extents_lock
Definition: btrfs_drv.h:565
struct _tree * tree
Definition: btrfs_drv.h:396
CACHE_MANAGER_CALLBACKS * cache_callbacks
Definition: cache.c:20
LIST_ENTRY list_entry
Definition: btrfs_drv.h:807
#define BTRFS_INODE_COMPRESS
Definition: propsheet.h:87
long LONG
Definition: pedump.c:60
uint64_t address
Definition: btrfs_drv.h:1200
Definition: devices.h:37
ANSI_STRING value
Definition: btrfs_drv.h:1225
LIST_ENTRY list_entry
Definition: btrfs_drv.h:325
_In_ ULONG BufferLength
Definition: usbdlib.h:225
void chunk_unlock_range(_In_ device_extension *Vcb, _In_ chunk *c, _In_ uint64_t start, _In_ uint64_t length)
Definition: btrfs.c:5452
uint64_t offset
Definition: btrfs_drv.h:218
ULONG num_errors
Definition: btrfs_drv.h:722
#define e
Definition: ke_i.h:82
BOOLEAN(* tPsIsDiskCountersEnabled)()
Definition: btrfs_drv.h:1741
#define _Releases_lock_(a)
Definition: btrfs_drv.h:186
bool extents_changed
Definition: btrfs_drv.h:312
bool created
Definition: btrfs_drv.h:341
unsigned int uintptr_t
Definition: crtdefs.h:300
#define IRP_MJ_SET_EA
static PVOID ptr
Definition: dispmode.c:27
PEPROCESS PsGetThreadProcess(_In_ PETHREAD Thread)
#define __drv_aliasesMem
Definition: btrfs_drv.h:183
bool seeding
Definition: btrfs_drv.h:829
uint32_t mount_flush_interval
Definition: btrfs.c:81
bool changed
Definition: btrfs_drv.h:571
uint64_t address
Definition: btrfs_drv.h:684
tree_data * paritem
Definition: btrfs_drv.h:427
#define PsGetCurrentProcess
Definition: psfuncs.h:17
VOID(* tPsUpdateDiskCounters)(PEPROCESS Process, ULONG64 BytesRead, ULONG64 BytesWritten, ULONG ReadOperationCount, ULONG WriteOperationCount, ULONG FlushOperationCount)
Definition: btrfs_drv.h:1743
void flush_subvol_fcbs(root *subvol)
Definition: fsctl.c:244
uint32_t count
Definition: btrfs.h:397
LIST_ENTRY list_entry_balance
Definition: btrfs_drv.h:580
PFILE_OBJECT root_file
Definition: btrfs_drv.h:797
LIST_ENTRY list_entry
Definition: btrfs_drv.h:544
struct _RTL_USER_PROCESS_PARAMETERS RTL_USER_PROCESS_PARAMETERS
struct pdo_device_extension pdo_device_extension
void init_device(_In_ device_extension *Vcb, _Inout_ device *dev, _In_ bool get_nums)
Definition: btrfs.c:3301
uint64_t count
Definition: btrfs_drv.h:587
unsigned char BOOLEAN
NTSTATUS(* tFsRtlGetEcpListFromIrp)(PIRP Irp, PECP_LIST *EcpList)
Definition: btrfs_drv.h:1767
bool specific_file
Definition: btrfs_drv.h:373
bool trim
Definition: btrfs_drv.h:519
#define _Out_writes_bytes_opt_(a)
Definition: btrfs_drv.h:187
LIST_ENTRY ** hash_ptrs_uc
Definition: btrfs_drv.h:307
struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER FSCTL_SET_INTEGRITY_INFORMATION_BUFFER
bool allow_degraded
Definition: btrfs_drv.h:654
void mark_fcb_dirty(_In_ fcb *fcb)
Definition: btrfs.c:1664
void mark_fileref_dirty(_In_ file_ref *fileref)
Definition: btrfs.c:1686
root * r
Definition: btrfs_drv.h:489
char ext[3]
Definition: mkdosfs.c:358
PDEVICE_OBJECT devobj
Definition: btrfs_drv.h:825
#define _Out_writes_bytes_(size)
Definition: no_sal2.h:370
#define _Out_
Definition: no_sal2.h:323
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
Definition: parser.c:48
NTSTATUS vol_file_system_control(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:341
HANDLE thread
Definition: btrfs_drv.h:357
struct _tree * parent
Definition: btrfs_drv.h:426
LIST_ENTRY job_list
Definition: btrfs_drv.h:633
NTSTATUS(* tFsRtlGetNextExtraCreateParameter)(PECP_LIST EcpList, PVOID CurrentEcpContext, LPGUID NextEcpType, PVOID *NextEcpContext, ULONG *NextEcpContextSize)
Definition: btrfs_drv.h:1769
bool reloc
Definition: btrfs_drv.h:568
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
NTSTATUS find_item_to_level(device_extension *Vcb, root *r, traverse_ptr *tp, const KEY *searchkey, bool ignore, uint8_t level, PIRP Irp)
Definition: treefuncs.c:568
Definition: bufpool.h:45
void add_checksum_entry(device_extension *Vcb, uint64_t address, ULONG length, uint32_t *csum, PIRP Irp)
Definition: flushthread.c:2550
#define C_ASSERT(e)
Definition: intsafe.h:79
LARGE_INTEGER finish_time
Definition: btrfs_drv.h:715
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)
Definition: write.c:3939
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
uint8_t type
Definition: btrfs_drv.h:280
struct pdo_device_extension * pdode
Definition: btrfs_drv.h:845
void free_trees(device_extension *Vcb)
Definition: treefuncs.c:793
uint32_t hash
Definition: btrfs_drv.h:422
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
NTSTATUS write_data(_In_ device_extension *Vcb, _In_ uint64_t address, _In_reads_bytes_(length) void *data, _In_ uint32_t length, _In_ write_data_context *wtc, _In_opt_ PIRP Irp, _In_opt_ chunk *c, _In_ bool file_write, _In_ uint64_t irp_offset, _In_ ULONG priority)
Definition: write.c:1881
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
bool parity
Definition: btrfs_drv.h:688
ULONG ea_index
Definition: btrfs_drv.h:380
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
NTSTATUS commit_batch_list(_Requires_exclusive_lock_held_(_Curr_->tree_lock) device_extension *Vcb, LIST_ENTRY *batchlist, PIRP Irp)
Definition: treefuncs.c:2280
bool prop_compression_changed
Definition: btrfs_drv.h:315
LIST_ENTRY list_entry
Definition: btrfs_drv.h:536
LONG refcount
Definition: btrfs_drv.h:344
#define TYPE_EXTENT_DATA_REF
Definition: btrfs.h:34
bool unique
Definition: btrfs_drv.h:220
void reap_fileref(device_extension *Vcb, file_ref *fr)
Definition: btrfs.c:1840
FILE_LOCK lock
Definition: btrfs_drv.h:283
GLuint GLfloat * val
Definition: glext.h:7180
bool marked_as_orphan
Definition: btrfs_drv.h:299
_Success_(return) bool get_file_attributes_from_xattr(_In_reads_bytes_(len) char *val
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
typedef bool(CARDLIBPROC *pCanDragProc)(CardRegion &stackobj
void find_gid(struct _fcb *fcb, struct _fcb *parfcb, PSECURITY_SUBJECT_CONTEXT subjcont)
Definition: security.c:841
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
uint8_t gmul(uint8_t a, uint8_t b)
Definition: galois.c:73
r l[0]
Definition: byte_order.h:167
#define BTRFS_ROOT_ROOT
Definition: btrfs.h:50
static __inline bool write_fcb_compressed(fcb *fcb)
Definition: btrfs_drv.h:1589
ULONG ealen
Definition: btrfs_drv.h:293
void free_trees_root(device_extension *Vcb, root *r)
Definition: treefuncs.c:756
FSRTL_ADVANCED_FCB_HEADER Header
Definition: btrfs_drv.h:272
#define IRP_MJ_QUERY_EA
uint8_t * data
Definition: btrfs_drv.h:913
FAST_MUTEX
Definition: extypes.h:17
bool deleted
Definition: btrfs_drv.h:340
ERESOURCE dirty_fcbs_lock
Definition: btrfs_drv.h:782
NTSTATUS send_status
Definition: btrfs_drv.h:388
LARGE_INTEGER start_time
Definition: btrfs_drv.h:714
void update_extent_flags(device_extension *Vcb, uint64_t address, uint64_t flags, PIRP Irp)
Definition: extent-tree.c:1875
int64_t LONGLONG
Definition: typedefs.h:66
uint64_t last_alloc
Definition: btrfs_drv.h:573
#define _Requires_lock_not_held_(a)
Definition: btrfs_drv.h:195
#define _Out_opt_
Definition: no_sal2.h:339
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
bool add_thread_job(device_extension *Vcb, PIRP Irp)
LARGE_INTEGER SourceFileOffset
Definition: shellext.h:176
LONG send_ops
Definition: btrfs_drv.h:455
#define TYPE_SHARED_DATA_REF
Definition: btrfs.h:37
void reap_fcbs(device_extension *Vcb)
Definition: btrfs.c:1805
bool is_unique
Definition: btrfs_drv.h:436
uint64_t metadata_flags
Definition: btrfs_drv.h:760
uint64_t children_loaded
Definition: btrfs_drv.h:860
uint64_t st_size
Definition: btrfs.h:271
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
LIST_ENTRY DirNotifyList
Definition: btrfs_drv.h:756
LIST_ENTRY list_entry
Definition: btrfs_drv.h:1220
bool checked_for_orphans
Definition: btrfs_drv.h:457
NTSTATUS write_compressed_bit(fcb *fcb, uint64_t start_data, uint64_t end_data, void *data, bool *compressed, PIRP Irp, LIST_ENTRY *rollback)
Definition: compress.c:1093
LIST_ENTRY dir_children_hash_uc
Definition: btrfs_drv.h:305
LIST_ENTRY list_entry
Definition: btrfs_drv.h:689
GLsizeiptr size
Definition: glext.h:5919
LIST_ENTRY dir_children_index
Definition: btrfs_drv.h:303
struct _fcb fcb
Definition: btrfs_drv.h:1301
void clear_batch_list(device_extension *Vcb, LIST_ENTRY *batchlist)
Definition: treefuncs.c:1203
WCHAR * debug_desc
Definition: btrfs_drv.h:288
void free_tree(tree *t)
Definition: treefuncs.c:260
#define _Acquires_shared_lock_(a)
Definition: btrfs_drv.h:197
UCHAR flags
Definition: btrfs_drv.h:1226
bool sd_dirty
Definition: btrfs_drv.h:310
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)
Definition: flushthread.c:63
NTSTATUS vol_query_information(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:285
bool fcb_is_inline(fcb *fcb)
Definition: fsctl.c:3227
#define __kernel_entry
Definition: specstrings.h:50
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)
Definition: treefuncs.c:592
r parent
Definition: btrfs.c:2897
NTSYSAPI NTSTATUS NTAPI ZwQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
NTSTATUS status
Definition: btrfs_drv.h:678
uint64_t size
Definition: btrfs_drv.h:585
LIST_ENTRY xattrs
Definition: btrfs_drv.h:298
NTSTATUS vol_shutdown(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:863
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint32_t length
Definition: btrfs_drv.h:912
_STLP_VENDOR_CSTD::ldiv_t div(long __x, long __y)
Definition: _cstdlib.h:137
_Function_class_(DRIVER_ADD_DEVICE) NTSTATUS __stdcall AddDevice(PDRIVER_OBJECT DriverObject
static __inline void print_open_trees(device_extension *Vcb)
Definition: btrfs_drv.h:1577
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
bool has_new_address
Definition: btrfs_drv.h:433
INT POOL_TYPE
Definition: typedefs.h:76
uint64_t inode
Definition: btrfs_drv.h:278
KEVENT finished
Definition: btrfs_drv.h:711
NTSTATUS do_tree_writes(device_extension *Vcb, LIST_ENTRY *tree_writes, bool no_free)
Definition: flushthread.c:1604
LIST_ENTRY itemlist
Definition: btrfs_drv.h:429
uint64_t ULONGLONG
Definition: typedefs.h:65
KEVENT cleared_event
Definition: btrfs_drv.h:360
static __inline uint16_t get_extent_data_len(uint8_t type)
Definition: btrfs_drv.h:1007
KEVENT range_locks_event
Definition: btrfs_drv.h:563
LIST_ENTRY range_locks
Definition: btrfs_drv.h:561
bool user_set_change_time
Definition: btrfs_drv.h:385
#define _Ret_maybenull_
Definition: no_sal2.h:590
bool had_drive_letter
Definition: btrfs_drv.h:830
BYTE Reserved1[8]
Definition: btrfs_drv.h:1797
struct _file_ref file_ref
#define Vcb
Definition: cdprocs.h:1425
rollback_type
Definition: btrfs_drv.h:1210
static __inline void * map_user_buffer(PIRP Irp, ULONG priority)
Definition: btrfs_drv.h:941
#define S_ISDIR(mode)
Definition: btrfs_drv.h:1672
ULONG CheckSum
Definition: btrfs_drv.h:1790
NTSTATUS load_csum(_Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, uint32_t *csum, uint64_t start, uint64_t length, PIRP Irp)
Definition: create.c:414
const GLubyte * c
Definition: glext.h:8905
uint64_t root
Definition: btrfs_drv.h:700
UCHAR Identifier[16]
Definition: btrfs_drv.h:152
uint8_t * parity1
Definition: btrfs_drv.h:906
NTSTATUS check_csum(device_extension *Vcb, uint8_t *data, uint32_t sectors, uint32_t *csum)
Definition: read.c:85
LIST_ENTRY sys_chunks
Definition: btrfs_drv.h:774
_Ret_maybenull_ device * find_device_from_uuid(_In_ device_extension *Vcb, _In_ BTRFS_UUID *uuid)
Definition: btrfs.c:3184
LIST_ENTRY list_entry
Definition: btrfs_drv.h:864
PFILE_OBJECT locked_fileobj
Definition: btrfs_drv.h:746
unsigned short WORD
Definition: ntddk_ex.h:93
static FILE * out
Definition: regtests2xml.c:44
PVOID Reserved6
Definition: btrfs_drv.h:1791
KEVENT event
Definition: btrfs_drv.h:679
NTSTATUS vol_create(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:35
void log_device_error(_In_ device_extension *Vcb, _Inout_ device *dev, _In_ int error)
Definition: btrfs.c:5475
__m128i
Definition: emmintrin.h:24
bool removable
Definition: btrfs_drv.h:515
unsigned long DWORD
Definition: ntddk_ex.h:95
NPAGED_LOOKASIDE_LIST fileref_np_lookaside
Definition: btrfs_drv.h:805
#define TYPE_EXTENT_REF_V0
Definition: btrfs.h:35
GLuint address
Definition: glext.h:9393
LIST_ENTRY list_entry
Definition: btrfs_drv.h:611
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
LIST_ENTRY hardlinks
Definition: btrfs_drv.h:294
ERESOURCE lock
Definition: btrfs_drv.h:634
struct _file_ref * fileref
Definition: btrfs_drv.h:295
uint64_t subvol
Definition: btrfs_drv.h:693
uint32_t mount_skip_balance
Definition: btrfs.c:83
LIST_ENTRY list_entry_index
Definition: btrfs_drv.h:251
LIST_ENTRY extents
Definition: btrfs_drv.h:290
bool find_metadata_address_in_chunk(device_extension *Vcb, chunk *c, uint64_t *address)
Definition: flushthread.c:728
bool case_sensitive
Definition: btrfs_drv.h:300
#define __stdcall
Definition: typedefs.h:25
bool chunk_usage_found
Definition: btrfs_drv.h:773
#define _Inout_
Definition: no_sal2.h:244
uint64_t find_extent_shared_tree_refcount(device_extension *Vcb, uint64_t address, uint64_t parent, PIRP Irp)
Definition: extent-tree.c:2118
NTSTATUS write_compressed(fcb *fcb, uint64_t start_data, uint64_t end_data, void *data, PIRP Irp, LIST_ENTRY *rollback)
Definition: write.c:4103
uint32_t mount_no_barrier
Definition: btrfs.c:84
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ERESOURCE fileref_lock
Definition: btrfs_drv.h:331
bool allow_extended_dasd_io
Definition: btrfs_drv.h:375
struct _LDR_DATA_TABLE_ENTRY * PLDR_DATA_TABLE_ENTRY
struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER FSCTL_GET_INTEGRITY_INFORMATION_BUFFER
ERESOURCE child_lock
Definition: btrfs_drv.h:861
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
struct _tree_data tree_data
void * notification_entry
Definition: btrfs_drv.h:831
PDEVICE_OBJECT mounted_device
Definition: btrfs_drv.h:843
LARGE_INTEGER duration
Definition: btrfs_drv.h:717
* PFILE_OBJECT
Definition: iotypes.h:1955
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BYTE Reserved4[8]
Definition: btrfs_drv.h:1787
ULONG disk_num
Definition: btrfs_drv.h:832
struct _ccb * ccb
Definition: btrfs_drv.h:358
USHORT NodeType
Definition: btrfs_drv.h:366
GLbitfield flags
Definition: glext.h:7161
uint64_t total_chunks
Definition: btrfs_drv.h:669
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)
Definition: treefuncs.c:857
void volume_arrival(PDRIVER_OBJECT DriverObject, PUNICODE_STRING devpath)
Definition: search.c:490
LIST_ENTRY list_entry
Definition: btrfs_drv.h:915
bool stopping
Definition: btrfs_drv.h:712
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)
Definition: btrfs.c:1205
#define TYPE_SHARED_BLOCK_REF
Definition: btrfs.h:36
uint32_t mount_max_inline
Definition: btrfs.c:82
uint32_t hash
Definition: btrfs_drv.h:279
LIST_ENTRY list_entry
Definition: btrfs_drv.h:491
uchar inbuf[M_BLOCK]
Definition: unzcrash.c:40
LIST_ENTRY trim_list
Definition: btrfs_drv.h:529
uint32_t mount_compress_force
Definition: btrfs.c:77
void __stdcall check_system_root(PDRIVER_OBJECT DriverObject, PVOID Context, ULONG Count)
Definition: boot.c:204
ANSI_STRING name
Definition: btrfs_drv.h:1224
NTSTATUS update_dev_item(device_extension *Vcb, device *device, PIRP Irp)
Definition: flushthread.c:4052
WCHAR * file_desc_fileref(_In_ file_ref *fileref)
Definition: btrfs.c:1492
PEPROCESS reserved
Definition: btrfs_drv.h:453
unsigned __int64 ULONG64
Definition: imports.h:198
void add_group_mapping(WCHAR *sidstring, ULONG sidstringlength, uint32_t gid)
Definition: security.c:145
dir_child * dc
Definition: btrfs_drv.h:348
_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
Definition: btrfs_drv.h:1301
tree_data * item
Definition: btrfs_drv.h:496
PVOID Reserved2[2]
Definition: btrfs_drv.h:1783
unsigned char UCHAR
Definition: xmlstorage.h:181
LIST_ENTRY listentry
Definition: btrfs_drv.h:874
LIST_ENTRY children
Definition: btrfs_drv.h:343
NTSTATUS excise_extents(device_extension *Vcb, fcb *fcb, uint64_t start_data, uint64_t end_data, PIRP Irp, LIST_ENTRY *rollback)
Definition: write.c:2368
PFILE_OBJECT fileobj
Definition: btrfs_drv.h:826
struct _fcb_nonpaged fcb_nonpaged
uint32_t count
Definition: btrfs.h:419
UNICODE_STRING ImagePathName
Definition: btrfs_drv.h:1805
NTSTATUS decrease_extent_refcount_tree(device_extension *Vcb, uint64_t address, uint64_t size, uint64_t root, uint8_t level, PIRP Irp)
Definition: extent-tree.c:1559
bool space_changed
Definition: btrfs_drv.h:572
LIST_ENTRY dirty_subvols
Definition: btrfs_drv.h:785
GLenum const GLvoid * addr
Definition: glext.h:9621
tree_header header
Definition: btrfs_drv.h:421
ULONG SessionId
Definition: btrfs_drv.h:1823
PETHREAD thread
Definition: btrfs_drv.h:535
prop_compression_type
Definition: btrfs_drv.h:256
_In_ PECP_LIST _In_opt_ PVOID CurrentEcpContext
Definition: fltkernel.h:2621
LONG refcount
Definition: btrfs_drv.h:274
Definition: parse.h:22
BYTE Reserved1[2]
Definition: btrfs_drv.h:1812
bool recovered
Definition: btrfs_drv.h:686
bool uniqueness_determined
Definition: btrfs_drv.h:437
ULONG num_trim_entries
Definition: btrfs_drv.h:528
bool case_sensitive
Definition: btrfs_drv.h:381
#define NTSTATUS
Definition: precomp.h:20
bool has_open_children(file_ref *fileref)
Definition: fileinfo.c:436
_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
Definition: btrfs_drv.h:1301
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
Definition: btrfs_drv.h:1817
PAGED_LOOKASIDE_LIST fileref_lookaside
Definition: btrfs_drv.h:801
NTSTATUS flush_fcb(fcb *fcb, bool cache, LIST_ENTRY *batchlist, PIRP Irp)
Definition: flushthread.c:4771
_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 _In_ uint64_t irp_offset
Definition: btrfs_drv.h:1301
#define VOID
Definition: acefi.h:82
LIST_ENTRY changed_extents
Definition: btrfs_drv.h:560
tree_holder treeholder
Definition: btrfs_drv.h:448
uint64_t chunks_left
Definition: btrfs_drv.h:719
LIST_ENTRY all_fcbs
Definition: btrfs_drv.h:780
LIST_ENTRY list_entry_hash_uc
Definition: btrfs_drv.h:253
uint64_t index
Definition: btrfs_drv.h:242
uint8_t * buf
Definition: btrfs_drv.h:892
NTSTATUS lzo_decompress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen, uint32_t inpageoff)
Definition: compress.c:278
LIST_ENTRY list_entry_dirty
Definition: btrfs_drv.h:353
Definition: btrfs_drv.h:1780
GLenum GLsizei len
Definition: glext.h:6722
uint8_t * buf
Definition: btrfs_drv.h:438
unsigned char BYTE
Definition: mem.h:68
NTSTATUS get_tree_new_address(device_extension *Vcb, tree *t, PIRP Irp, LIST_ENTRY *rollback)
Definition: flushthread.c:862
GLdouble s
Definition: gl.h:2039
uint32_t zstd_level
Definition: btrfs_drv.h:646
Definition: _list.h:228
NTSTATUS vol_cleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:327
bool created
Definition: btrfs_drv.h:317
uint64_t data_scrubbed
Definition: btrfs_drv.h:720
_In_ PECP_LIST _In_opt_ PVOID _Out_opt_ LPGUID _Outptr_opt_ PVOID _Out_opt_ ULONG * NextEcpContextSize
Definition: fltkernel.h:2621
uint32_t flush_interval
Definition: btrfs_drv.h:647
fcb * fcb
Definition: btrfs_drv.h:335
Definition: typedefs.h:117
UNICODE_STRING CommandLine
Definition: btrfs_drv.h:1806
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)
Definition: extent-tree.c:891
GLenum src
Definition: glext.h:6340
LIST_ENTRY dirty_fcbs
Definition: btrfs_drv.h:781
PVOID Reserved5[52]
Definition: btrfs_drv.h:1819
bool seeding
Definition: btrfs_drv.h:516
uint32_t zlib_level
Definition: btrfs_drv.h:645
#define _Releases_exclusive_lock_(a)
Definition: btrfs_drv.h:190
uint32_t max_inline
Definition: btrfs_drv.h:648
uint64_t address
Definition: btrfs_drv.h:911
NTSTATUS set_reparse_point(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: reparse.c:367
INODE_ITEM inode_item
Definition: btrfs_drv.h:281
DRIVER_DISPATCH(nfs41_FsdDispatch)
NTSTATUS registry_load_volume_options(device_extension *Vcb)
Definition: registry.c:36
USHORT valuelen
Definition: btrfs_drv.h:266
NTSTATUS get_reparse_point(PDEVICE_OBJECT DeviceObject, PFILE_OBJECT FileObject, void *buffer, DWORD buflen, ULONG_PTR *retlen)
Definition: reparse.c:22
BYTE uint8_t
Definition: msvideo1.c:66
NTSTATUS start_balance(device_extension *Vcb, void *data, ULONG length, KPROCESSOR_MODE processor_mode)
Definition: balance.c:3499
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
uint64_t st_blocks
Definition: btrfs.h:272
uint64_t flags
Definition: btrfs.h:279
LIST_ENTRY partial_stripes
Definition: btrfs_drv.h:575
uint16_t edsize
Definition: write.c:2820
KEVENT flush_thread_finished
Definition: btrfs_drv.h:790
__u8 sector_size[2]
Definition: mkdosfs.c:361
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)
Definition: create.c:1576
LIST_ENTRY space_size
Definition: btrfs_drv.h:558
PDEVICE_OBJECT attached_device
Definition: btrfs_drv.h:847
NTSTATUS delete_fileref(_In_ file_ref *fileref, _In_opt_ PFILE_OBJECT FileObject, _In_ bool make_orphan, _In_opt_ PIRP Irp, _In_ LIST_ENTRY *rollback)
Definition: btrfs.c:2217
INT32 int32_t
Definition: types.h:71
uint32_t get_num_of_processors()
Definition: btrfs.c:3985
uint32_t mount_compress
Definition: btrfs.c:76
void add_extent(_In_ fcb *fcb, _In_ LIST_ENTRY *prevextle, _In_ __drv_aliasesMem extent *newext)
Definition: write.c:2351
LIST_ENTRY list_entry
Definition: btrfs_drv.h:898
uint16_t filename_length
Definition: btrfs_drv.h:695
NTSTATUS vol_set_information(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:291
ERESOURCE dir_children_lock
Definition: btrfs_drv.h:212
ULONG TimeDateStamp
Definition: btrfs_drv.h:1793
bool user_set_creation_time
Definition: btrfs_drv.h:382
LIST_ENTRY chunks
Definition: btrfs_drv.h:775
NTSTATUS allocate_cache(device_extension *Vcb, bool *changed, PIRP Irp, LIST_ENTRY *rollback)
Definition: free-space.c:1378
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)
Definition: treefuncs.c:548
NTSTATUS load_cache_chunk(device_extension *Vcb, chunk *c, PIRP Irp)
Definition: free-space.c:979
struct _write_data_context write_data_context
LIST_ENTRY list_entry
Definition: btrfs_drv.h:362
#define _In_
Definition: no_sal2.h:204
file_ref * root_fileref
Definition: btrfs_drv.h:749
struct _ECP_LIST * PECP_LIST
Definition: fsrtltypes.h:139
ULONG balance_num
Definition: btrfs_drv.h:677
bool reloc
Definition: btrfs_drv.h:518
HANDLE thread
Definition: btrfs_drv.h:708
NTSTATUS send_subvol(device_extension *Vcb, void *data, ULONG datalen, PFILE_OBJECT FileObject, PIRP Irp)
Definition: send.c:3592
#define _Lock_level_order_(a, b)
Definition: btrfs_drv.h:193
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
void uninit(_In_ device_extension *Vcb)
Definition: btrfs.c:1970
bool ignore
Definition: btrfs_drv.h:402
uint32_t size
Definition: btrfs_drv.h:424
extent * ext
Definition: btrfs_drv.h:1207
Definition: btrfs.h:126
ULONG get_reparse_tag_fcb(fcb *fcb)
Definition: dirctrl.c:82
uint32_t sectors
Definition: btrfs_drv.h:617
uint64_t size
Definition: btrfs_drv.h:506
PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine
Definition: btrfs_drv.h:1820
PDEVICE_OBJECT attached_device
Definition: btrfs_drv.h:817
bool stats_changed
Definition: btrfs_drv.h:525
bool find_prev_item(_Requires_lock_held_(_Curr_->tree_lock) device_extension *Vcb, const traverse_ptr *tp, traverse_ptr *prev_tp, PIRP Irp)
Definition: treefuncs.c:698
uint64_t total_chunks
Definition: btrfs_drv.h:718
chunk * get_chunk_from_address(device_extension *Vcb, uint64_t address)
Definition: write.c:89
NTSTATUS skip_to_difference(device_extension *Vcb, traverse_ptr *tp, traverse_ptr *tp2, bool *ended1, bool *ended2)
Definition: treefuncs.c:368
bool created
Definition: btrfs_drv.h:566
NTSTATUS zlib_decompress(uint8_t *inbuf, uint32_t inlen, uint8_t *outbuf, uint32_t outlen)
Definition: compress.c:336
uint32_t gid
Definition: btrfs_drv.h:876
static __inline uint64_t unix_time_to_win(BTRFS_TIME *t)
Definition: btrfs_drv.h:949
uint32_t * csum
Definition: btrfs_drv.h:223
UINT64 uint64_t
Definition: types.h:77
NTSTATUS vol_device_control(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:797
uint8_t level
Definition: btrfs_drv.h:701
const WCHAR * action
Definition: action.c:7783
_Ret_z_ WCHAR * file_desc(_In_ PFILE_OBJECT FileObject)
Definition: btrfs.c:1529
NTSTATUS load_stored_free_space_cache(device_extension *Vcb, chunk *c, bool load_only, PIRP Irp)
Definition: free-space.c:465
LIST_ENTRY list_entry_hash
Definition: btrfs_drv.h:252
ULONG atts
Definition: btrfs_drv.h:286
NTSTATUS query_scrub(device_extension *Vcb, KPROCESSOR_MODE processor_mode, void *data, ULONG length)
Definition: scrub.c:3304
ERESOURCE resource
Definition: btrfs_drv.h:210
struct _fcb_nonpaged * nonpaged
Definition: btrfs_drv.h:273
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
LIST_ENTRY roots
Definition: btrfs_drv.h:762
drv_calc_threads calcthreads
Definition: btrfs_drv.h:791
void * context
Definition: btrfs_drv.h:359
unsigned short USHORT
Definition: pedump.c:61
ERESOURCE stats_lock
Definition: btrfs_drv.h:709
bool deleted
Definition: btrfs_drv.h:284
void space_list_subtract2(LIST_ENTRY *list, LIST_ENTRY *list_size, uint64_t address, uint64_t length, chunk *c, LIST_ENTRY *rollback)
Definition: free-space.c:1967
#define _In_z_
Definition: no_sal2.h:239
GLuint start
Definition: gl.h:1545
uint32_t inherit_mode(fcb *parfcb, bool is_dir)
Definition: create.c:1832
uint8_t type
Definition: btrfs_drv.h:243
static const char lxgid[]
Definition: btrfs_drv.h:1231
LIST_ENTRY InMemoryOrderLinks
Definition: btrfs_drv.h:1782
ULONG disposition
Definition: btrfs_drv.h:368
uint32_t find_extent_shared_data_refcount(device_extension *Vcb, uint64_t address, uint64_t parent, PIRP Irp)
Definition: extent-tree.c:2219
PPEB_LDR_DATA Ldr
Definition: btrfs_drv.h:1816
bool compress_force
Definition: btrfs_drv.h:642
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void * data
Definition: btrfs_drv.h:1301
_In_ uint64_t _In_ uint64_t _In_ uint64_t generation
Definition: btrfs.c:2882
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)
Definition: btrfs.c:2841
bool log_to_phys_loaded
Definition: btrfs_drv.h:772
void remove_dir_child_from_hash_lists(fcb *fcb, dir_child *dc)
Definition: fileinfo.c:738
static __inline uint64_t fcb_alloc_size(fcb *fcb)
Definition: btrfs_drv.h:1732
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool prealloc
Definition: btrfs_drv.h:1301
static const char lxmod[]
Definition: btrfs_drv.h:1232
NTSTATUS vol_lock_control(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volume.c:347
void insert_dir_child_into_hash_lists(fcb *fcb, dir_child *dc)
Definition: fileinfo.c:1413
bool is_tree_unique(device_extension *Vcb, tree *t, PIRP Irp)
Definition: flushthread.c:3204
UNICODE_STRING FullDllName
Definition: btrfs_drv.h:1786
NTSTATUS clear_free_space_cache(device_extension *Vcb, LIST_ENTRY *batchlist, PIRP Irp)
Definition: free-space.c:58
PVOID Reserved3[2]
Definition: btrfs_drv.h:1785
VOID(* tFsRtlUpdateDiskCounters)(ULONG64 BytesRead, ULONG64 BytesWritten)
Definition: btrfs_drv.h:1763
LIST_ENTRY refs
Definition: btrfs_drv.h:591
LIST_ENTRY listentry
Definition: btrfs_drv.h:868
NPAGED_LOOKASIDE_LIST range_lock_lookaside
Definition: btrfs_drv.h:804
bool dirty
Definition: btrfs_drv.h:267
bool disallow_dismount
Definition: btrfs_drv.h:743
PVOID Reserved1[2]
Definition: btrfs_drv.h:1781
unsigned int * PULONG
Definition: retypes.h:1
struct _root * subvol
Definition: btrfs_drv.h:277
Definition: list.h:27
NTSTATUS insert_tree_item_batch(LIST_ENTRY *batchlist, device_extension *Vcb, root *r, uint64_t objid, uint8_t objtype, uint64_t offset, _In_opt_ _When_(return >=0, __drv_aliasesMem) void *data, uint16_t datalen, enum batch_operation operation)
Definition: flushthread.c:4401
uint32_t uid
Definition: btrfs_drv.h:870
DEV_ITEM devitem
Definition: btrfs_drv.h:514
ULONG adsmaxlen
Definition: btrfs_drv.h:321
ANSI_STRING adsdata
Definition: btrfs_drv.h:323
LIST_ENTRY * fcbs_ptrs[256]
Definition: btrfs_drv.h:459
NTSTATUS stream_set_end_of_file_information(device_extension *Vcb, uint16_t end, fcb *fcb, file_ref *fileref, bool advance_only)
Definition: fileinfo.c:2111
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)
Definition: btrfs.c:2672
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY * rollback
Definition: btrfs_drv.h:1301
NTSTATUS delete_reparse_point(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: reparse.c:442
uint64_t address
Definition: btrfs_drv.h:394
LARGE_INTEGER TargetFileOffset
Definition: shellext.h:177
__u8 sectors[2]
Definition: mkdosfs.c:366
#define _When_(expr, annos)
Definition: no_sal2.h:639
ERESOURCE lock
Definition: btrfs_drv.h:564
static __inline uint32_t get_extent_data_refcount(uint8_t type, void *data)
Definition: btrfs_drv.h:1029
LIST_ENTRY list_entry
Definition: btrfs_drv.h:264
bool is_metadata
Definition: btrfs_drv.h:687
#define _Post_satisfies_(a)
Definition: btrfs_drv.h:189
UINT32 uint32_t
Definition: types.h:75
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
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) uint32_t *csum, _In_ LIST_ENTRY *rollback)
Definition: write.c:2720
drv_calc_thread * threads
Definition: btrfs_drv.h:635
USHORT size
Definition: btrfs_drv.h:610
uint64_t address
Definition: btrfs_drv.h:584
CHUNK_ITEM * chunk_item
Definition: btrfs_drv.h:549
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
UNICODE_STRING pnp_name
Definition: btrfs.c:4164
uint8_t * data
Definition: btrfs_drv.h:615
void add_trim_entry_avoid_sb(device_extension *Vcb, device *dev, uint64_t address, uint64_t size)
Definition: flushthread.c:5354
#define IRP_MJ_READ
Definition: rdpdr.c:46
Definition: fs.h:216
LONG pos
Definition: btrfs_drv.h:618
uint64_t get_extent_refcount(device_extension *Vcb, uint64_t address, uint64_t size, PIRP Irp)
Definition: extent-tree.c:1650
bool find_data_address_in_chunk(device_extension *Vcb, chunk *c, uint64_t length, uint64_t *address)
bool case_sensitive_set
Definition: btrfs_drv.h:301
LIST_ENTRY list_entry_size
Definition: btrfs_drv.h:508
bool stopping
Definition: btrfs_drv.h:673
EXTENT_DATA extent_data
Definition: btrfs_drv.h:227
#define msg(x)
Definition: auth_time.c:54