• Home
  • Raw
  • Download

Lines Matching refs:entry

29 static u64 entry_end(struct btrfs_ordered_extent *entry)  in entry_end()  argument
31 if (entry->file_offset + entry->len < entry->file_offset) in entry_end()
33 return entry->file_offset + entry->len; in entry_end()
44 struct btrfs_ordered_extent *entry; in tree_insert() local
48 entry = rb_entry(parent, struct btrfs_ordered_extent, rb_node); in tree_insert()
50 if (file_offset < entry->file_offset) in tree_insert()
52 else if (file_offset >= entry_end(entry)) in tree_insert()
73 struct btrfs_ordered_extent *entry; in __tree_search() local
77 entry = rb_entry(n, struct btrfs_ordered_extent, rb_node); in __tree_search()
79 prev_entry = entry; in __tree_search()
81 if (file_offset < entry->file_offset) in __tree_search()
83 else if (file_offset >= entry_end(entry)) in __tree_search()
120 static int offset_in_entry(struct btrfs_ordered_extent *entry, u64 file_offset) in offset_in_entry() argument
122 if (file_offset < entry->file_offset || in offset_in_entry()
123 entry->file_offset + entry->len <= file_offset) in offset_in_entry()
138 struct btrfs_ordered_extent *entry; in tree_search() local
141 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
143 if (offset_in_entry(entry, file_offset)) in tree_search()
172 struct btrfs_ordered_extent *entry; in btrfs_add_ordered_extent() local
175 entry = kzalloc(sizeof(*entry), GFP_NOFS); in btrfs_add_ordered_extent()
176 if (!entry) in btrfs_add_ordered_extent()
180 entry->file_offset = file_offset; in btrfs_add_ordered_extent()
181 entry->start = start; in btrfs_add_ordered_extent()
182 entry->len = len; in btrfs_add_ordered_extent()
183 entry->disk_len = disk_len; in btrfs_add_ordered_extent()
184 entry->inode = inode; in btrfs_add_ordered_extent()
186 set_bit(type, &entry->flags); in btrfs_add_ordered_extent()
189 atomic_set(&entry->refs, 1); in btrfs_add_ordered_extent()
190 init_waitqueue_head(&entry->wait); in btrfs_add_ordered_extent()
191 INIT_LIST_HEAD(&entry->list); in btrfs_add_ordered_extent()
192 INIT_LIST_HEAD(&entry->root_extent_list); in btrfs_add_ordered_extent()
195 &entry->rb_node); in btrfs_add_ordered_extent()
199 entry_end(entry) - 1, GFP_NOFS); in btrfs_add_ordered_extent()
202 list_add_tail(&entry->root_extent_list, in btrfs_add_ordered_extent()
217 struct btrfs_ordered_extent *entry, in btrfs_add_ordered_sum() argument
224 list_add_tail(&sum->list, &entry->list); in btrfs_add_ordered_sum()
243 struct btrfs_ordered_extent *entry; in btrfs_dec_test_ordered_pending() local
257 entry = rb_entry(node, struct btrfs_ordered_extent, rb_node); in btrfs_dec_test_ordered_pending()
258 if (!offset_in_entry(entry, file_offset)) { in btrfs_dec_test_ordered_pending()
263 ret = test_range_bit(io_tree, entry->file_offset, in btrfs_dec_test_ordered_pending()
264 entry->file_offset + entry->len - 1, in btrfs_dec_test_ordered_pending()
267 ret = test_and_set_bit(BTRFS_ORDERED_IO_DONE, &entry->flags); in btrfs_dec_test_ordered_pending()
277 int btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry) in btrfs_put_ordered_extent() argument
282 if (atomic_dec_and_test(&entry->refs)) { in btrfs_put_ordered_extent()
283 while (!list_empty(&entry->list)) { in btrfs_put_ordered_extent()
284 cur = entry->list.next; in btrfs_put_ordered_extent()
289 kfree(entry); in btrfs_put_ordered_extent()
299 struct btrfs_ordered_extent *entry) in btrfs_remove_ordered_extent() argument
306 node = &entry->rb_node; in btrfs_remove_ordered_extent()
309 set_bit(BTRFS_ORDERED_COMPLETE, &entry->flags); in btrfs_remove_ordered_extent()
312 list_del_init(&entry->root_extent_list); in btrfs_remove_ordered_extent()
316 wake_up(&entry->wait); in btrfs_remove_ordered_extent()
380 struct btrfs_ordered_extent *entry, in btrfs_start_ordered_extent() argument
383 u64 start = entry->file_offset; in btrfs_start_ordered_extent()
384 u64 end = start + entry->len - 1; in btrfs_start_ordered_extent()
393 wait_event(entry->wait, test_bit(BTRFS_ORDERED_COMPLETE, in btrfs_start_ordered_extent()
394 &entry->flags)); in btrfs_start_ordered_extent()
469 struct btrfs_ordered_extent *entry = NULL; in btrfs_lookup_ordered_extent() local
477 entry = rb_entry(node, struct btrfs_ordered_extent, rb_node); in btrfs_lookup_ordered_extent()
478 if (!offset_in_entry(entry, file_offset)) in btrfs_lookup_ordered_extent()
479 entry = NULL; in btrfs_lookup_ordered_extent()
480 if (entry) in btrfs_lookup_ordered_extent()
481 atomic_inc(&entry->refs); in btrfs_lookup_ordered_extent()
484 return entry; in btrfs_lookup_ordered_extent()
496 struct btrfs_ordered_extent *entry = NULL; in btrfs_lookup_first_ordered_extent() local
504 entry = rb_entry(node, struct btrfs_ordered_extent, rb_node); in btrfs_lookup_first_ordered_extent()
505 atomic_inc(&entry->refs); in btrfs_lookup_first_ordered_extent()
508 return entry; in btrfs_lookup_first_ordered_extent()