ReactOS  0.4.15-dev-4927-gfe8f806
treefuncs.c File Reference
#include "btrfs_drv.h"
#include "crc32c.h"
Include dependency graph for treefuncs.c:

Go to the source code of this file.

Functions

 __attribute__ ((nonnull(1, 3, 4, 5)))
 
 __attribute__ ((nonnull(1, 2, 3, 4)))
 
 __attribute__ ((nonnull(1, 2, 3)))
 
 __attribute__ ((nonnull(1)))
 
 __attribute__ ((nonnull(1, 2)))
 
 __attribute__ ((nonnull(1, 2, 3, 4, 5)))
 
 __attribute__ ((nonnull(1, 3)))
 
 __attribute__ ((nonnull(1, 2, 3, 4, 6, 7)))
 

Function Documentation

◆ __attribute__() [1/8]

__attribute__ ( (nonnull(1, 3, 4, 5))  )

Definition at line 21 of file treefuncs.c.

22  {
23  tree_header* th;
24  tree* t;
25  tree_data* td;
26  uint8_t h;
27  bool inserted;
28  LIST_ENTRY* le;
29 
30  th = (tree_header*)buf;
31 
33  if (!t) {
34  ERR("out of memory\n");
36  }
37 
38  if (th->level > 0) {
40  if (!t->nonpaged) {
41  ERR("out of memory\n");
42  ExFreePool(t);
44  }
45 
46  ExInitializeFastMutex(&t->nonpaged->mutex);
47  } else
48  t->nonpaged = NULL;
49 
50  RtlCopyMemory(&t->header, th, sizeof(tree_header));
51  t->hash = calc_crc32c(0xffffffff, (uint8_t*)&addr, sizeof(uint64_t));
52  t->has_address = true;
53  t->Vcb = Vcb;
54  t->parent = NULL;
55  t->root = r;
56  t->paritem = NULL;
57  t->size = 0;
58  t->new_address = 0;
59  t->has_new_address = false;
60  t->updated_extents = false;
61  t->write = false;
62  t->uniqueness_determined = false;
63 
64  InitializeListHead(&t->itemlist);
65 
66  if (t->header.level == 0) { // leaf node
67  leaf_node* ln = (leaf_node*)(buf + sizeof(tree_header));
68  unsigned int i;
69 
70  if ((t->header.num_items * sizeof(leaf_node)) + sizeof(tree_header) > Vcb->superblock.node_size) {
71  ERR("tree at %I64x has more items than expected (%x)\n", addr, t->header.num_items);
72  ExFreePool(t);
74  }
75 
76  for (i = 0; i < t->header.num_items; i++) {
77  td = ExAllocateFromPagedLookasideList(&Vcb->tree_data_lookaside);
78  if (!td) {
79  ERR("out of memory\n");
80  ExFreePool(t);
82  }
83 
84  td->key = ln[i].key;
85 
86  if (ln[i].size > 0)
87  td->data = buf + sizeof(tree_header) + ln[i].offset;
88  else
89  td->data = NULL;
90 
91  if (ln[i].size + sizeof(tree_header) + sizeof(leaf_node) > Vcb->superblock.node_size) {
92  ERR("overlarge item in tree %I64x: %u > %Iu\n", addr, ln[i].size, Vcb->superblock.node_size - sizeof(tree_header) - sizeof(leaf_node));
93  ExFreeToPagedLookasideList(&t->Vcb->tree_data_lookaside, td);
94  ExFreePool(t);
95  return STATUS_INTERNAL_ERROR;
96  }
97 
98  td->size = (uint16_t)ln[i].size;
99  td->ignore = false;
100  td->inserted = false;
101 
102  InsertTailList(&t->itemlist, &td->list_entry);
103 
104  t->size += ln[i].size;
105  }
106 
107  t->size += t->header.num_items * sizeof(leaf_node);
108  t->buf = buf;
109  } else {
110  internal_node* in = (internal_node*)(buf + sizeof(tree_header));
111  unsigned int i;
112 
113  if ((t->header.num_items * sizeof(internal_node)) + sizeof(tree_header) > Vcb->superblock.node_size) {
114  ERR("tree at %I64x has more items than expected (%x)\n", addr, t->header.num_items);
115  ExFreePool(t);
117  }
118 
119  for (i = 0; i < t->header.num_items; i++) {
120  td = ExAllocateFromPagedLookasideList(&Vcb->tree_data_lookaside);
121  if (!td) {
122  ERR("out of memory\n");
123  ExFreePool(t);
125  }
126 
127  td->key = in[i].key;
128 
129  td->treeholder.address = in[i].address;
130  td->treeholder.generation = in[i].generation;
131  td->treeholder.tree = NULL;
132  td->ignore = false;
133  td->inserted = false;
134 
135  InsertTailList(&t->itemlist, &td->list_entry);
136  }
137 
138  t->size = t->header.num_items * sizeof(internal_node);
139  t->buf = NULL;
140  }
141 
142  ExAcquireFastMutex(&Vcb->trees_list_mutex);
143 
144  InsertTailList(&Vcb->trees, &t->list_entry);
145 
146  h = t->hash >> 24;
147 
148  if (!Vcb->trees_ptrs[h]) {
149  uint8_t h2 = h;
150 
151  le = Vcb->trees_hash.Flink;
152 
153  if (h2 > 0) {
154  h2--;
155  do {
156  if (Vcb->trees_ptrs[h2]) {
157  le = Vcb->trees_ptrs[h2];
158  break;
159  }
160 
161  h2--;
162  } while (h2 > 0);
163  }
164  } else
165  le = Vcb->trees_ptrs[h];
166 
167  inserted = false;
168  while (le != &Vcb->trees_hash) {
169  tree* t2 = CONTAINING_RECORD(le, tree, list_entry_hash);
170 
171  if (t2->hash >= t->hash) {
172  InsertHeadList(le->Blink, &t->list_entry_hash);
173  inserted = true;
174  break;
175  }
176 
177  le = le->Flink;
178  }
179 
180  if (!inserted)
181  InsertTailList(&Vcb->trees_hash, &t->list_entry_hash);
182 
183  if (!Vcb->trees_ptrs[h] || t->list_entry_hash.Flink == Vcb->trees_ptrs[h])
184  Vcb->trees_ptrs[h] = &t->list_entry_hash;
185 
186  ExReleaseFastMutex(&Vcb->trees_list_mutex);
187 
188  TRACE("returning %p\n", t);
189 
190  *pt = t;
191 
192  return STATUS_SUCCESS;
193 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define pt(x, y)
Definition: drawing.c:79
bool inserted
Definition: btrfs_drv.h:408
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
tree_holder treeholder
Definition: btrfs_drv.h:411
uint16_t size
Definition: btrfs_drv.h:414
GLdouble GLdouble t
Definition: gl.h:2047
#define uint16_t
Definition: nsiface.idl:60
#define InsertTailList(ListHead, Entry)
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
uint8_t * data
Definition: btrfs_drv.h:415
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define STATUS_INTERNAL_ERROR
Definition: ntstatus.h:465
#define ALLOC_TAG
Definition: btrfs_drv.h:87
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LIST_ENTRY list_entry
Definition: btrfs_drv.h:406
struct _tree * tree
Definition: btrfs_drv.h:401
uint32_t size
Definition: btrfs.h:168
uint32_t hash
Definition: btrfs_drv.h:427
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
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
#define Vcb
Definition: cdprocs.h:1415
uint8_t level
Definition: btrfs.h:162
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
GLenum const GLvoid * addr
Definition: glext.h:9621
crc_func calc_crc32c
Definition: crc32c.c:23
Definition: typedefs.h:119
BYTE uint8_t
Definition: msvideo1.c:66
#define ERR(fmt,...)
Definition: debug.h:110
bool ignore
Definition: btrfs_drv.h:407
UINT64 uint64_t
Definition: types.h:77
GLuint in
Definition: glext.h:9616
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 i
Definition: glfuncs.h:248
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
KEY key
Definition: btrfs.h:166
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define NULL
Definition: types.h:112
uint64_t address
Definition: btrfs_drv.h:399
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
uint64_t generation
Definition: btrfs_drv.h:400

◆ __attribute__() [2/8]

__attribute__ ( (nonnull(1, 2, 3, 4))  )

Definition at line 195 of file treefuncs.c.

196  {
197  if (!th->tree) {
199  tree* nt;
200 
201  Status = load_tree(Vcb, th->address, buf, r, &nt);
202  if (!NT_SUCCESS(Status)) {
203  ERR("load_tree returned %08lx\n", Status);
204  return Status;
205  }
206 
207  nt->parent = t;
208 
209 #ifdef DEBUG_PARANOID
210  if (t && t->header.level <= nt->header.level) int3;
211 #endif
212 
213  nt->paritem = td;
214 
215  th->tree = nt;
216  }
217 
218  return STATUS_SUCCESS;
219 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LONG NTSTATUS
Definition: precomp.h:26
#define int3
Definition: btrfs_drv.h:1735
GLdouble GLdouble t
Definition: gl.h:2047
IMAGE_NT_HEADERS nt
Definition: module.c:50
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define Vcb
Definition: cdprocs.h:1415
#define ERR(fmt,...)
Definition: debug.h:110
NTSTATUS load_tree(device_extension *Vcb, uint64_t addr, uint8_t *buf, root *r, tree **pt) __attribute__((nonnull(1
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ __attribute__() [3/8]

__attribute__ ( (nonnull(1, 2, 3))  )

Definition at line 221 of file treefuncs.c.

222  {
224  uint8_t* buf;
225  chunk* c;
226 
227  buf = ExAllocatePoolWithTag(PagedPool, Vcb->superblock.node_size, ALLOC_TAG);
228  if (!buf) {
229  ERR("out of memory\n");
231  }
232 
233  Status = read_data(Vcb, th->address, Vcb->superblock.node_size, NULL, true, buf, NULL,
234  &c, Irp, th->generation, false, NormalPagePriority);
235  if (!NT_SUCCESS(Status)) {
236  ERR("read_data returned 0x%08lx\n", Status);
237  ExFreePool(buf);
238  return Status;
239  }
240 
241  if (t)
242  ExAcquireFastMutex(&t->nonpaged->mutex);
243  else
244  ExAcquireResourceExclusiveLite(&r->nonpaged->load_tree_lock, true);
245 
246  Status = do_load_tree2(Vcb, th, buf, r, t, td);
247 
248  if (t)
249  ExReleaseFastMutex(&t->nonpaged->mutex);
250  else
251  ExReleaseResourceLite(&r->nonpaged->load_tree_lock);
252 
253  if (!th->tree || th->tree->buf != buf)
254  ExFreePool(buf);
255 
256  if (!NT_SUCCESS(Status)) {
257  ERR("do_load_tree2 returned %08lx\n", Status);
258  return Status;
259  }
260 
261  return Status;
262 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LONG NTSTATUS
Definition: precomp.h:26
GLdouble GLdouble t
Definition: gl.h:2047
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
#define ALLOC_TAG
Definition: btrfs_drv.h:87
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
_In_ PIRP Irp
Definition: csq.h:116
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define Vcb
Definition: cdprocs.h:1415
const GLubyte * c
Definition: glext.h:8905
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
BYTE uint8_t
Definition: msvideo1.c:66
#define ERR(fmt,...)
Definition: debug.h:110
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
#define NULL
Definition: types.h:112
static BOOL read_data(struct request *request, void *buffer, DWORD size, DWORD *read, BOOL async)
Definition: request.c:2018
#define c
Definition: ke_i.h:80
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

◆ __attribute__() [4/8]

__attribute__ ( (nonnull(1))  )

Definition at line 264 of file treefuncs.c.

265  {
266  tree* par;
267  root* r = t->root;
268 
269  // No need to acquire lock, as this is only ever called while Vcb->tree_lock held exclusively
270 
271  par = t->parent;
272 
273  if (r && r->treeholder.tree != t)
274  r = NULL;
275 
276  if (par) {
277  if (t->paritem)
278  t->paritem->treeholder.tree = NULL;
279  }
280 
281  while (!IsListEmpty(&t->itemlist)) {
283 
284  if (t->header.level == 0 && td->data && td->inserted)
285  ExFreePool(td->data);
286 
287  ExFreeToPagedLookasideList(&t->Vcb->tree_data_lookaside, td);
288  }
289 
290  RemoveEntryList(&t->list_entry);
291 
292  if (r)
293  r->treeholder.tree = NULL;
294 
295  if (t->list_entry_hash.Flink) {
296  uint8_t h = t->hash >> 24;
297  if (t->Vcb->trees_ptrs[h] == &t->list_entry_hash) {
298  if (t->list_entry_hash.Flink != &t->Vcb->trees_hash) {
299  tree* t2 = CONTAINING_RECORD(t->list_entry_hash.Flink, tree, list_entry_hash);
300 
301  if ((t2->hash >> 24) == h)
302  t->Vcb->trees_ptrs[h] = &t2->list_entry_hash;
303  else
304  t->Vcb->trees_ptrs[h] = NULL;
305  } else
306  t->Vcb->trees_ptrs[h] = NULL;
307  }
308 
309  RemoveEntryList(&t->list_entry_hash);
310  }
311 
312  if (t->buf)
313  ExFreePool(t->buf);
314 
315  if (t->nonpaged)
316  ExFreePool(t->nonpaged);
317 
318  ExFreePool(t);
319 }
bool inserted
Definition: btrfs_drv.h:408
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LIST_ENTRY list_entry_hash
Definition: btrfs_drv.h:436
GLdouble GLdouble t
Definition: gl.h:2047
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
uint8_t * data
Definition: btrfs_drv.h:415
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
struct _tree * parent
Definition: btrfs_drv.h:431
uint32_t hash
Definition: btrfs_drv.h:427
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
BYTE uint8_t
Definition: msvideo1.c:66
Definition: list.h:27
#define NULL
Definition: types.h:112
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

◆ __attribute__() [5/8]

__attribute__ ( (nonnull(1, 2))  )

Definition at line 331 of file treefuncs.c.

332  {
333  LIST_ENTRY* le = td->list_entry.Blink;
334 
335  if (le == &t->itemlist)
336  return NULL;
337 
339 }
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
GLdouble GLdouble t
Definition: gl.h:2047
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
Definition: typedefs.h:119
Definition: list.h:27
#define NULL
Definition: types.h:112

◆ __attribute__() [6/8]

__attribute__ ( (nonnull(1, 2, 3, 4, 5))  )

Definition at line 377 of file treefuncs.c.

378  {
380  tree *t1, *t2;
381  tree_data *td1, *td2;
382 
383  t1 = tp->tree;
384  t2 = tp2->tree;
385 
386  do {
387  td1 = t1->paritem;
388  td2 = t2->paritem;
389  t1 = t1->parent;
390  t2 = t2->parent;
391  } while (t1 && t2 && t1->header.address == t2->header.address);
392 
393  while (true) {
394  traverse_ptr tp3, tp4;
395 
396  Status = next_item2(Vcb, t1, td1, &tp3);
397  if (Status == STATUS_NOT_FOUND)
398  *ended1 = true;
399  else if (!NT_SUCCESS(Status)) {
400  ERR("next_item2 returned %08lx\n", Status);
401  return Status;
402  }
403 
404  Status = next_item2(Vcb, t2, td2, &tp4);
405  if (Status == STATUS_NOT_FOUND)
406  *ended2 = true;
407  else if (!NT_SUCCESS(Status)) {
408  ERR("next_item2 returned %08lx\n", Status);
409  return Status;
410  }
411 
412  if (*ended1 || *ended2) {
413  if (!*ended1) {
414  Status = find_item(Vcb, t1->root, tp, &tp3.item->key, false, NULL);
415  if (!NT_SUCCESS(Status)) {
416  ERR("find_item returned %08lx\n", Status);
417  return Status;
418  }
419  } else if (!*ended2) {
420  Status = find_item(Vcb, t2->root, tp2, &tp4.item->key, false, NULL);
421  if (!NT_SUCCESS(Status)) {
422  ERR("find_item returned %08lx\n", Status);
423  return Status;
424  }
425  }
426 
427  return STATUS_SUCCESS;
428  }
429 
430  if (tp3.tree->header.address != tp4.tree->header.address) {
431  Status = find_item(Vcb, t1->root, tp, &tp3.item->key, false, NULL);
432  if (!NT_SUCCESS(Status)) {
433  ERR("find_item returned %08lx\n", Status);
434  return Status;
435  }
436 
437  Status = find_item(Vcb, t2->root, tp2, &tp4.item->key, false, NULL);
438  if (!NT_SUCCESS(Status)) {
439  ERR("find_item returned %08lx\n", Status);
440  return Status;
441  }
442 
443  return STATUS_SUCCESS;
444  }
445 
446  t1 = tp3.tree;
447  td1 = tp3.item;
448  t2 = tp4.tree;
449  td2 = tp4.item;
450  }
451 }
struct _root * root
Definition: btrfs_drv.h:433
LONG NTSTATUS
Definition: precomp.h:26
uint64_t address
Definition: btrfs.h:156
tree * tree
Definition: btrfs_drv.h:501
tree_data * paritem
Definition: btrfs_drv.h:432
struct _tree * parent
Definition: btrfs_drv.h:431
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2965
Status
Definition: gdiplustypes.h:24
#define STATUS_NOT_FOUND
Definition: shellext.h:72
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
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define Vcb
Definition: cdprocs.h:1415
tree_data * item
Definition: btrfs_drv.h:502
tree_header header
Definition: btrfs_drv.h:426
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ __attribute__() [7/8]

__attribute__ ( (nonnull(1, 3))  )

Definition at line 860 of file treefuncs.c.

861  {
862  rollback_item* ri;
863 
865  if (!ri) {
866  ERR("out of memory\n");
867  return;
868  }
869 
870  ri->type = type;
871  ri->ptr = ptr;
873 }
enum rollback_type type
Definition: btrfs_drv.h:1266
#define InsertTailList(ListHead, Entry)
#define ALLOC_TAG
Definition: btrfs_drv.h:87
static PVOID ptr
Definition: dispmode.c:27
LIST_ENTRY list_entry
Definition: btrfs_drv.h:1268
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ERR(fmt,...)
Definition: debug.h:110
_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:1355
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ __attribute__() [8/8]

__attribute__ ( (nonnull(1, 2, 3, 4, 6, 7))  )

Definition at line 1317 of file treefuncs.c.

1318  {
1319  if (bi->operation == Batch_Delete || bi->operation == Batch_SetXattr || bi->operation == Batch_DirItem || bi->operation == Batch_InodeRef ||
1320  bi->operation == Batch_InodeExtRef || bi->operation == Batch_DeleteDirItem || bi->operation == Batch_DeleteInodeRef ||
1321  bi->operation == Batch_DeleteInodeExtRef || bi->operation == Batch_DeleteXattr) {
1322  uint16_t maxlen = (uint16_t)(Vcb->superblock.node_size - sizeof(tree_header) - sizeof(leaf_node));
1323 
1324  switch (bi->operation) {
1325  case Batch_SetXattr: {
1326  if (td->size < sizeof(DIR_ITEM)) {
1327  ERR("(%I64x,%x,%I64x) was %u bytes, expected at least %Iu\n", bi->key.obj_id, bi->key.obj_type, bi->key.offset, td->size, sizeof(DIR_ITEM));
1328  } else {
1329  uint8_t* newdata;
1330  ULONG size = td->size;
1331  DIR_ITEM* newxa = (DIR_ITEM*)bi->data;
1332  DIR_ITEM* xa = (DIR_ITEM*)td->data;
1333 
1334  while (true) {
1335  ULONG oldxasize;
1336 
1337  if (size < sizeof(DIR_ITEM) || size < sizeof(DIR_ITEM) - 1 + xa->m + xa->n) {
1338  ERR("(%I64x,%x,%I64x) was truncated\n", bi->key.obj_id, bi->key.obj_type, bi->key.offset);
1339  break;
1340  }
1341 
1342  oldxasize = sizeof(DIR_ITEM) - 1 + xa->m + xa->n;
1343 
1344  if (xa->n == newxa->n && RtlCompareMemory(newxa->name, xa->name, xa->n) == xa->n) {
1345  uint64_t pos;
1346 
1347  // replace
1348 
1349  if (td->size + bi->datalen - oldxasize > maxlen)
1350  ERR("DIR_ITEM would be over maximum size, truncating (%u + %u - %lu > %u)\n", td->size, bi->datalen, oldxasize, maxlen);
1351 
1352  newdata = ExAllocatePoolWithTag(PagedPool, td->size + bi->datalen - oldxasize, ALLOC_TAG);
1353  if (!newdata) {
1354  ERR("out of memory\n");
1356  }
1357 
1358  pos = (uint8_t*)xa - td->data;
1359  if (pos + oldxasize < td->size) // copy after changed xattr
1360  RtlCopyMemory(newdata + pos + bi->datalen, td->data + pos + oldxasize, (ULONG)(td->size - pos - oldxasize));
1361 
1362  if (pos > 0) { // copy before changed xattr
1363  RtlCopyMemory(newdata, td->data, (ULONG)pos);
1364  xa = (DIR_ITEM*)(newdata + pos);
1365  } else
1366  xa = (DIR_ITEM*)newdata;
1367 
1368  RtlCopyMemory(xa, bi->data, bi->datalen);
1369 
1370  bi->datalen = (uint16_t)min(td->size + bi->datalen - oldxasize, maxlen);
1371 
1372  ExFreePool(bi->data);
1373  bi->data = newdata;
1374 
1375  break;
1376  }
1377 
1378  if ((uint8_t*)xa - (uint8_t*)td->data + oldxasize >= size) {
1379  // not found, add to end of data
1380 
1381  if (td->size + bi->datalen > maxlen)
1382  ERR("DIR_ITEM would be over maximum size, truncating (%u + %u > %u)\n", td->size, bi->datalen, maxlen);
1383 
1384  newdata = ExAllocatePoolWithTag(PagedPool, td->size + bi->datalen, ALLOC_TAG);
1385  if (!newdata) {
1386  ERR("out of memory\n");
1388  }
1389 
1390  RtlCopyMemory(newdata, td->data, td->size);
1391 
1392  xa = (DIR_ITEM*)((uint8_t*)newdata + td->size);
1393  RtlCopyMemory(xa, bi->data, bi->datalen);
1394 
1395  bi->datalen = min(bi->datalen + td->size, maxlen);
1396 
1397  ExFreePool(bi->data);
1398  bi->data = newdata;
1399 
1400  break;
1401  } else {
1402  xa = (DIR_ITEM*)&xa->name[xa->m + xa->n];
1403  size -= oldxasize;
1404  }
1405  }
1406  }
1407  break;
1408  }
1409 
1410  case Batch_DirItem: {
1411  uint8_t* newdata;
1412 
1413  if (td->size + bi->datalen > maxlen) {
1414  ERR("DIR_ITEM would be over maximum size (%u + %u > %u)\n", td->size, bi->datalen, maxlen);
1415  return STATUS_INTERNAL_ERROR;
1416  }
1417 
1418  newdata = ExAllocatePoolWithTag(PagedPool, td->size + bi->datalen, ALLOC_TAG);
1419  if (!newdata) {
1420  ERR("out of memory\n");
1422  }
1423 
1424  RtlCopyMemory(newdata, td->data, td->size);
1425 
1426  RtlCopyMemory(newdata + td->size, bi->data, bi->datalen);
1427 
1428  bi->datalen += td->size;
1429 
1430  ExFreePool(bi->data);
1431  bi->data = newdata;
1432 
1433  break;
1434  }
1435 
1436  case Batch_InodeRef: {
1437  uint8_t* newdata;
1438 
1439  if (td->size + bi->datalen > maxlen) {
1440  if (Vcb->superblock.incompat_flags & BTRFS_INCOMPAT_FLAGS_EXTENDED_IREF) {
1441  INODE_REF* ir = (INODE_REF*)bi->data;
1442  INODE_EXTREF* ier;
1443  uint16_t ierlen;
1444  batch_item* bi2;
1445  LIST_ENTRY* le;
1446  bool inserted = false;
1447 
1448  TRACE("INODE_REF would be too long, adding INODE_EXTREF instead\n");
1449 
1450  ierlen = (uint16_t)(offsetof(INODE_EXTREF, name[0]) + ir->n);
1451 
1452  ier = ExAllocatePoolWithTag(PagedPool, ierlen, ALLOC_TAG);
1453  if (!ier) {
1454  ERR("out of memory\n");
1456  }
1457 
1458  ier->dir = bi->key.offset;
1459  ier->index = ir->index;
1460  ier->n = ir->n;
1461  RtlCopyMemory(ier->name, ir->name, ier->n);
1462 
1463  bi2 = ExAllocateFromPagedLookasideList(&Vcb->batch_item_lookaside);
1464  if (!bi2) {
1465  ERR("out of memory\n");
1466  ExFreePool(ier);
1468  }
1469 
1470  bi2->key.obj_id = bi->key.obj_id;
1471  bi2->key.obj_type = TYPE_INODE_EXTREF;
1472  bi2->key.offset = calc_crc32c((uint32_t)ier->dir, (uint8_t*)ier->name, ier->n);
1473  bi2->data = ier;
1474  bi2->datalen = ierlen;
1475  bi2->operation = Batch_InodeExtRef;
1476 
1477  le = bi->list_entry.Flink;
1478  while (le != listhead) {
1480 
1481  if (keycmp(bi3->key, bi2->key) != -1) {
1482  InsertHeadList(le->Blink, &bi2->list_entry);
1483  inserted = true;
1484  }
1485 
1486  le = le->Flink;
1487  }
1488 
1489  if (!inserted)
1490  InsertTailList(listhead, &bi2->list_entry);
1491 
1492  *ignore = true;
1493  return STATUS_SUCCESS;
1494  } else {
1495  ERR("INODE_REF would be over maximum size (%u + %u > %u)\n", td->size, bi->datalen, maxlen);
1496  return STATUS_INTERNAL_ERROR;
1497  }
1498  }
1499 
1500  newdata = ExAllocatePoolWithTag(PagedPool, td->size + bi->datalen, ALLOC_TAG);
1501  if (!newdata) {
1502  ERR("out of memory\n");
1504  }
1505 
1506  RtlCopyMemory(newdata, td->data, td->size);
1507 
1508  RtlCopyMemory(newdata + td->size, bi->data, bi->datalen);
1509 
1510  bi->datalen += td->size;
1511 
1512  ExFreePool(bi->data);
1513  bi->data = newdata;
1514 
1515  break;
1516  }
1517 
1518  case Batch_InodeExtRef: {
1519  uint8_t* newdata;
1520 
1521  if (td->size + bi->datalen > maxlen) {
1522  ERR("INODE_EXTREF would be over maximum size (%u + %u > %u)\n", td->size, bi->datalen, maxlen);
1523  return STATUS_INTERNAL_ERROR;
1524  }
1525 
1526  newdata = ExAllocatePoolWithTag(PagedPool, td->size + bi->datalen, ALLOC_TAG);
1527  if (!newdata) {
1528  ERR("out of memory\n");
1530  }
1531 
1532  RtlCopyMemory(newdata, td->data, td->size);
1533 
1534  RtlCopyMemory(newdata + td->size, bi->data, bi->datalen);
1535 
1536  bi->datalen += td->size;
1537 
1538  ExFreePool(bi->data);
1539  bi->data = newdata;
1540 
1541  break;
1542  }
1543 
1544  case Batch_DeleteDirItem: {
1545  if (td->size < sizeof(DIR_ITEM)) {
1546  ERR("DIR_ITEM was %u bytes, expected at least %Iu\n", td->size, sizeof(DIR_ITEM));
1547  return STATUS_INTERNAL_ERROR;
1548  } else {
1549  DIR_ITEM *di, *deldi;
1550  LONG len;
1551 
1552  deldi = (DIR_ITEM*)bi->data;
1553  di = (DIR_ITEM*)td->data;
1554  len = td->size;
1555 
1556  do {
1557  if (di->m == deldi->m && di->n == deldi->n && RtlCompareMemory(di->name, deldi->name, di->n + di->m) == di->n + di->m) {
1558  uint16_t newlen = td->size - (sizeof(DIR_ITEM) - sizeof(char) + di->n + di->m);
1559 
1560  if (newlen == 0) {
1561  TRACE("deleting DIR_ITEM\n");
1562  } else {
1563  uint8_t *newdi = ExAllocatePoolWithTag(PagedPool, newlen, ALLOC_TAG), *dioff;
1564  tree_data* td2;
1565 
1566  if (!newdi) {
1567  ERR("out of memory\n");
1569  }
1570 
1571  TRACE("modifying DIR_ITEM\n");
1572 
1573  if ((uint8_t*)di > td->data) {
1574  RtlCopyMemory(newdi, td->data, (uint8_t*)di - td->data);
1575  dioff = newdi + ((uint8_t*)di - td->data);
1576  } else {
1577  dioff = newdi;
1578  }
1579 
1580  if ((uint8_t*)&di->name[di->n + di->m] < td->data + td->size)
1581  RtlCopyMemory(dioff, &di->name[di->n + di->m], td->size - ((uint8_t*)&di->name[di->n + di->m] - td->data));
1582 
1583  td2 = ExAllocateFromPagedLookasideList(&Vcb->tree_data_lookaside);
1584  if (!td2) {
1585  ERR("out of memory\n");
1586  ExFreePool(newdi);
1588  }
1589 
1590  td2->key = bi->key;
1591  td2->size = newlen;
1592  td2->data = newdi;
1593  td2->ignore = false;
1594  td2->inserted = true;
1595 
1596  InsertHeadList(td->list_entry.Blink, &td2->list_entry);
1597 
1598  t->header.num_items++;
1599  t->size += newlen + sizeof(leaf_node);
1600  t->write = true;
1601  }
1602 
1603  break;
1604  }
1605 
1606  len -= sizeof(DIR_ITEM) - sizeof(char) + di->n + di->m;
1607  di = (DIR_ITEM*)&di->name[di->n + di->m];
1608 
1609  if (len == 0) {
1610  TRACE("could not find DIR_ITEM to delete\n");
1611  *ignore = true;
1612  return STATUS_SUCCESS;
1613  }
1614  } while (len > 0);
1615  }
1616  break;
1617  }
1618 
1619  case Batch_DeleteInodeRef: {
1620  if (td->size < sizeof(INODE_REF)) {
1621  ERR("INODE_REF was %u bytes, expected at least %Iu\n", td->size, sizeof(INODE_REF));
1622  return STATUS_INTERNAL_ERROR;
1623  } else {
1624  INODE_REF *ir, *delir;
1625  ULONG len;
1626  bool changed = false;
1627 
1628  delir = (INODE_REF*)bi->data;
1629  ir = (INODE_REF*)td->data;
1630  len = td->size;
1631 
1632  do {
1633  uint16_t itemlen;
1634 
1635  if (len < sizeof(INODE_REF) || len < offsetof(INODE_REF, name[0]) + ir->n) {
1636  ERR("INODE_REF was truncated\n");
1637  break;
1638  }
1639 
1640  itemlen = (uint16_t)offsetof(INODE_REF, name[0]) + ir->n;
1641 
1642  if (ir->n == delir->n && RtlCompareMemory(ir->name, delir->name, ir->n) == ir->n) {
1643  uint16_t newlen = td->size - itemlen;
1644 
1645  changed = true;
1646 
1647  if (newlen == 0)
1648  TRACE("deleting INODE_REF\n");
1649  else {
1650  uint8_t *newir = ExAllocatePoolWithTag(PagedPool, newlen, ALLOC_TAG), *iroff;
1651  tree_data* td2;
1652 
1653  if (!newir) {
1654  ERR("out of memory\n");
1656  }
1657 
1658  TRACE("modifying INODE_REF\n");
1659 
1660  if ((uint8_t*)ir > td->data) {
1661  RtlCopyMemory(newir, td->data, (uint8_t*)ir - td->data);
1662  iroff = newir + ((uint8_t*)ir - td->data);
1663  } else {
1664  iroff = newir;
1665  }
1666 
1667  if ((uint8_t*)&ir->name[ir->n] < td->data + td->size)
1668  RtlCopyMemory(iroff, &ir->name[ir->n], td->size - ((uint8_t*)&ir->name[ir->n] - td->data));
1669 
1670  td2 = ExAllocateFromPagedLookasideList(&Vcb->tree_data_lookaside);
1671  if (!td2) {
1672  ERR("out of memory\n");
1673  ExFreePool(newir);
1675  }
1676 
1677  td2->key = bi->key;
1678  td2->size = newlen;
1679  td2->data = newir;
1680  td2->ignore = false;
1681  td2->inserted = true;
1682 
1683  InsertHeadList(td->list_entry.Blink, &td2->list_entry);
1684 
1685  t->header.num_items++;
1686  t->size += newlen + sizeof(leaf_node);
1687  t->write = true;
1688  }
1689 
1690  break;
1691  }
1692 
1693  if (len > itemlen) {
1694  len -= itemlen;
1695  ir = (INODE_REF*)&ir->name[ir->n];
1696  } else
1697  break;
1698  } while (len > 0);
1699 
1700  if (!changed) {
1701  if (Vcb->superblock.incompat_flags & BTRFS_INCOMPAT_FLAGS_EXTENDED_IREF) {
1702  TRACE("entry in INODE_REF not found, adding Batch_DeleteInodeExtRef entry\n");
1703 
1704  add_delete_inode_extref(Vcb, bi, listhead);
1705 
1706  *ignore = true;
1707  return STATUS_SUCCESS;
1708  } else
1709  WARN("entry not found in INODE_REF\n");
1710  }
1711  }
1712 
1713  break;
1714  }
1715 
1716  case Batch_DeleteInodeExtRef: {
1717  if (td->size < sizeof(INODE_EXTREF)) {
1718  ERR("INODE_EXTREF was %u bytes, expected at least %Iu\n", td->size, sizeof(INODE_EXTREF));
1719  return STATUS_INTERNAL_ERROR;
1720  } else {
1721  INODE_EXTREF *ier, *delier;
1722  ULONG len;
1723 
1724  delier = (INODE_EXTREF*)bi->data;
1725  ier = (INODE_EXTREF*)td->data;
1726  len = td->size;
1727 
1728  do {
1729  uint16_t itemlen;
1730 
1731  if (len < sizeof(INODE_EXTREF) || len < offsetof(INODE_EXTREF, name[0]) + ier->n) {
1732  ERR("INODE_REF was truncated\n");
1733  break;
1734  }
1735 
1736  itemlen = (uint16_t)offsetof(INODE_EXTREF, name[0]) + ier->n;
1737 
1738  if (ier->dir == delier->dir && ier->n == delier->n && RtlCompareMemory(ier->name, delier->name, ier->n) == ier->n) {
1739  uint16_t newlen = td->size - itemlen;
1740 
1741  if (newlen == 0)
1742  TRACE("deleting INODE_EXTREF\n");
1743  else {
1744  uint8_t *newier = ExAllocatePoolWithTag(PagedPool, newlen, ALLOC_TAG), *ieroff;
1745  tree_data* td2;
1746 
1747  if (!newier) {
1748  ERR("out of memory\n");
1750  }
1751 
1752  TRACE("modifying INODE_EXTREF\n");
1753 
1754  if ((uint8_t*)ier > td->data) {
1755  RtlCopyMemory(newier, td->data, (uint8_t*)ier - td->data);
1756  ieroff = newier + ((uint8_t*)ier - td->data);
1757  } else {
1758  ieroff = newier;
1759  }
1760 
1761  if ((uint8_t*)&ier->name[ier->n] < td->data + td->size)
1762  RtlCopyMemory(ieroff, &ier->name[ier->n], td->size - ((uint8_t*)&ier->name[ier->n] - td->data));
1763 
1764  td2 = ExAllocateFromPagedLookasideList(&Vcb->tree_data_lookaside);
1765  if (!td2) {
1766  ERR("out of memory\n");
1767  ExFreePool(newier);
1769  }
1770 
1771  td2->key = bi->key;
1772  td2->size = newlen;
1773  td2->data = newier;
1774  td2->ignore = false;
1775  td2->inserted = true;
1776 
1777  InsertHeadList(td->list_entry.Blink, &td2->list_entry);
1778 
1779  t->header.num_items++;
1780  t->size += newlen + sizeof(leaf_node);
1781  t->write = true;
1782  }
1783 
1784  break;
1785  }
1786 
1787  if (len > itemlen) {
1788  len -= itemlen;
1789  ier = (INODE_EXTREF*)&ier->name[ier->n];
1790  } else
1791  break;
1792  } while (len > 0);
1793  }
1794  break;
1795  }
1796 
1797  case Batch_DeleteXattr: {
1798  if (td->size < sizeof(DIR_ITEM)) {
1799  ERR("XATTR_ITEM was %u bytes, expected at least %Iu\n", td->size, sizeof(DIR_ITEM));
1800  return STATUS_INTERNAL_ERROR;
1801  } else {
1802  DIR_ITEM *di, *deldi;
1803  LONG len;
1804 
1805  deldi = (DIR_ITEM*)bi->data;
1806  di = (DIR_ITEM*)td->data;
1807  len = td->size;
1808 
1809  do {
1810  if (di->n == deldi->n && RtlCompareMemory(di->name, deldi->name, di->n) == di->n) {
1811  uint16_t newlen = td->size - ((uint16_t)offsetof(DIR_ITEM, name[0]) + di->n + di->m);
1812 
1813  if (newlen == 0)
1814  TRACE("deleting XATTR_ITEM\n");
1815  else {
1816  uint8_t *newdi = ExAllocatePoolWithTag(PagedPool, newlen, ALLOC_TAG), *dioff;
1817  tree_data* td2;
1818 
1819  if (!newdi) {
1820  ERR("out of memory\n");
1822  }
1823 
1824  TRACE("modifying XATTR_ITEM\n");
1825 
1826  if ((uint8_t*)di > td->data) {
1827  RtlCopyMemory(newdi, td->data, (uint8_t*)di - td->data);
1828  dioff = newdi + ((uint8_t*)di - td->data);
1829  } else
1830  dioff = newdi;
1831 
1832  if ((uint8_t*)&di->name[di->n + di->m] < td->data + td->size)
1833  RtlCopyMemory(dioff, &di->name[di->n + di->m], td->size - ((uint8_t*)&di->name[di->n + di->m] - td->data));
1834 
1835  td2 = ExAllocateFromPagedLookasideList(&Vcb->tree_data_lookaside);
1836  if (!td2) {
1837  ERR("out of memory\n");
1838  ExFreePool(newdi);
1840  }
1841 
1842  td2->key = bi->key;
1843  td2->size = newlen;
1844  td2->data = newdi;
1845  td2->ignore = false;
1846  td2->inserted = true;
1847 
1848  InsertHeadList(td->list_entry.Blink, &td2->list_entry);
1849 
1850  t->header.num_items++;
1851  t->size += newlen + sizeof(leaf_node);
1852  t->write = true;
1853  }
1854 
1855  break;
1856  }
1857 
1858  len -= sizeof(DIR_ITEM) - sizeof(char) + di->n + di->m;
1859  di = (DIR_ITEM*)&di->name[di->n + di->m];
1860 
1861  if (len == 0) {
1862  TRACE("could not find DIR_ITEM to delete\n");
1863  *ignore = true;
1864  return STATUS_SUCCESS;
1865  }
1866  } while (len > 0);
1867  }
1868  break;
1869  }
1870 
1871  case Batch_Delete:
1872  break;
1873 
1874  default:
1875  ERR("unexpected batch operation type\n");
1876  return STATUS_INTERNAL_ERROR;
1877  }
1878 
1879  // delete old item
1880  if (!td->ignore) {
1881  td->ignore = true;
1882 
1883  t->header.num_items--;
1884  t->size -= sizeof(leaf_node) + td->size;
1885  t->write = true;
1886  }
1887 
1888  if (newtd) {
1889  newtd->data = bi->data;
1890  newtd->size = bi->datalen;
1891  InsertHeadList(td->list_entry.Blink, &newtd->list_entry);
1892  }
1893  } else {
1894  ERR("(%I64x,%x,%I64x) already exists\n", bi->key.obj_id, bi->key.obj_type, bi->key.offset);
1895  return STATUS_INTERNAL_ERROR;
1896  }
1897 
1898  *ignore = false;
1899  return STATUS_SUCCESS;
1900 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
uint16_t n
Definition: btrfs.h:383
bool inserted
Definition: btrfs_drv.h:408
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
#define BTRFS_INCOMPAT_FLAGS_EXTENDED_IREF
Definition: btrfs.h:121
#define keycmp(key1, key2)
Definition: btrfs_drv.h:1008
#define WARN(fmt,...)
Definition: debug.h:112
uint16_t size
Definition: btrfs_drv.h:414
GLdouble GLdouble t
Definition: gl.h:2047
unsigned short int uint16_t
Definition: acefiex.h:54
#define uint16_t
Definition: nsiface.idl:60
#define InsertTailList(ListHead, Entry)
if(dx==0 &&dy==0)
Definition: linetemp.h:174
uint8_t * data
Definition: btrfs_drv.h:415
#define STATUS_INTERNAL_ERROR
Definition: ntstatus.h:465
#define ALLOC_TAG
Definition: btrfs_drv.h:87
LIST_ENTRY list_entry
Definition: btrfs_drv.h:406
uint16_t m
Definition: btrfs.h:275
long LONG
Definition: pedump.c:60
char name[1]
Definition: btrfs.h:377
char name[1]
Definition: btrfs.h:278
#define offsetof(TYPE, MEMBER)
uint16_t n
Definition: btrfs.h:376
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
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define Vcb
Definition: cdprocs.h:1415
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TYPE_INODE_EXTREF
Definition: btrfs.h:25
GLenum GLsizei len
Definition: glext.h:6722
crc_func calc_crc32c
Definition: crc32c.c:23
Definition: typedefs.h:119
BYTE uint8_t
Definition: msvideo1.c:66
uint64_t dir
Definition: btrfs.h:381
char name[1]
Definition: btrfs.h:384
#define ERR(fmt,...)
Definition: debug.h:110
bool ignore
Definition: btrfs_drv.h:407
UINT64 uint64_t
Definition: types.h:77
uint64_t index
Definition: btrfs.h:375
#define min(a, b)
Definition: monoChain.cc:55
Definition: list.h:27
UINT32 uint32_t
Definition: types.h:75
Definition: name.c:38
unsigned int ULONG
Definition: retypes.h:1
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65
uint16_t n
Definition: btrfs.h:276
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465