Lines Matching refs:ordered

83 	struct btrfs_ordered_extent *ordered;  member
1102 struct btrfs_ordered_extent *ordered; in submit_one_async_extent() local
1162 ordered = btrfs_alloc_ordered_extent(inode, start, /* file_offset */ in submit_one_async_extent()
1170 if (IS_ERR(ordered)) { in submit_one_async_extent()
1172 ret = PTR_ERR(ordered); in submit_one_async_extent()
1181 btrfs_submit_compressed_write(ordered, in submit_one_async_extent()
1374 struct btrfs_ordered_extent *ordered; in cow_file_range() local
1425 ordered = btrfs_alloc_ordered_extent(inode, start, ram_size, in cow_file_range()
1429 if (IS_ERR(ordered)) { in cow_file_range()
1430 ret = PTR_ERR(ordered); in cow_file_range()
1435 ret = btrfs_reloc_clone_csums(ordered); in cow_file_range()
1453 btrfs_put_ordered_extent(ordered); in cow_file_range()
1994 struct btrfs_ordered_extent *ordered; in run_delalloc_nocow() local
2155 ordered = btrfs_alloc_ordered_extent(inode, cur_offset, in run_delalloc_nocow()
2163 if (IS_ERR(ordered)) { in run_delalloc_nocow()
2168 ret = PTR_ERR(ordered); in run_delalloc_nocow()
2178 ret = btrfs_reloc_clone_csums(ordered); in run_delalloc_nocow()
2179 btrfs_put_ordered_extent(ordered); in run_delalloc_nocow()
2548 struct btrfs_ordered_extent *ordered) in btrfs_extract_ordered_extent() argument
2556 if (WARN_ON_ONCE(start != ordered->disk_bytenr)) in btrfs_extract_ordered_extent()
2560 if (ordered->disk_num_bytes == len) { in btrfs_extract_ordered_extent()
2561 refcount_inc(&ordered->refs); in btrfs_extract_ordered_extent()
2562 bbio->ordered = ordered; in btrfs_extract_ordered_extent()
2570 if (!test_bit(BTRFS_ORDERED_NOCOW, &ordered->flags)) { in btrfs_extract_ordered_extent()
2572 ordered->num_bytes, len, in btrfs_extract_ordered_extent()
2573 ordered->disk_bytenr); in btrfs_extract_ordered_extent()
2578 new = btrfs_split_ordered_extent(ordered, len); in btrfs_extract_ordered_extent()
2581 bbio->ordered = new; in btrfs_extract_ordered_extent()
2686 struct btrfs_ordered_extent *ordered; in btrfs_writepage_fixup_worker() local
2752 ordered = btrfs_lookup_ordered_range(inode, page_start, PAGE_SIZE); in btrfs_writepage_fixup_worker()
2753 if (ordered) { in btrfs_writepage_fixup_worker()
2757 btrfs_start_ordered_extent(ordered); in btrfs_writepage_fixup_worker()
2758 btrfs_put_ordered_extent(ordered); in btrfs_writepage_fixup_worker()
3239 int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered) in btrfs_finish_ordered_io() argument
3241 if (btrfs_is_zoned(btrfs_sb(ordered->inode->i_sb)) && in btrfs_finish_ordered_io()
3242 !test_bit(BTRFS_ORDERED_IOERR, &ordered->flags)) in btrfs_finish_ordered_io()
3243 btrfs_finish_ordered_zoned(ordered); in btrfs_finish_ordered_io()
3244 return btrfs_finish_one_ordered(ordered); in btrfs_finish_ordered_io()
4679 struct btrfs_ordered_extent *ordered; in btrfs_truncate_block() local
4755 ordered = btrfs_lookup_ordered_extent(inode, block_start); in btrfs_truncate_block()
4756 if (ordered) { in btrfs_truncate_block()
4760 btrfs_start_ordered_extent(ordered); in btrfs_truncate_block()
4761 btrfs_put_ordered_extent(ordered); in btrfs_truncate_block()
6953 struct btrfs_ordered_extent *ordered; in btrfs_create_dio_extent() local
6963 ordered = btrfs_alloc_ordered_extent(inode, start, len, len, in btrfs_create_dio_extent()
6968 if (IS_ERR(ordered)) { in btrfs_create_dio_extent()
6974 em = ERR_CAST(ordered); in btrfs_create_dio_extent()
6976 ASSERT(!dio_data->ordered); in btrfs_create_dio_extent()
6977 dio_data->ordered = ordered; in btrfs_create_dio_extent()
7159 struct btrfs_ordered_extent *ordered; in lock_extent_direct() local
7175 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, in lock_extent_direct()
7185 if (!ordered && in lock_extent_direct()
7192 if (ordered) { in lock_extent_direct()
7194 btrfs_put_ordered_extent(ordered); in lock_extent_direct()
7214 test_bit(BTRFS_ORDERED_DIRECT, &ordered->flags)) in lock_extent_direct()
7215 btrfs_start_ordered_extent(ordered); in lock_extent_direct()
7218 btrfs_put_ordered_extent(ordered); in lock_extent_direct()
7700 btrfs_finish_ordered_extent(dio_data->ordered, NULL, in btrfs_dio_iomap_end()
7708 btrfs_put_ordered_extent(dio_data->ordered); in btrfs_dio_iomap_end()
7709 dio_data->ordered = NULL; in btrfs_dio_iomap_end()
7732 btrfs_finish_ordered_extent(bbio->ordered, NULL, in btrfs_dio_end_io()
7772 ret = btrfs_extract_ordered_extent(bbio, dio_data->ordered); in btrfs_dio_submit_io()
7774 btrfs_finish_ordered_extent(dio_data->ordered, NULL, in btrfs_dio_submit_io()
7977 struct btrfs_ordered_extent *ordered; in btrfs_invalidate_folio() local
7982 ordered = btrfs_lookup_first_ordered_range(inode, cur, in btrfs_invalidate_folio()
7984 if (!ordered) { in btrfs_invalidate_folio()
7993 if (ordered->file_offset > cur) { in btrfs_invalidate_folio()
8000 range_end = ordered->file_offset - 1; in btrfs_invalidate_folio()
8005 range_end = min(ordered->file_offset + ordered->num_bytes - 1, in btrfs_invalidate_folio()
8035 set_bit(BTRFS_ORDERED_TRUNCATED, &ordered->flags); in btrfs_invalidate_folio()
8036 ordered->truncated_len = min(ordered->truncated_len, in btrfs_invalidate_folio()
8037 cur - ordered->file_offset); in btrfs_invalidate_folio()
8046 if (btrfs_dec_test_ordered_pending(inode, &ordered, in btrfs_invalidate_folio()
8048 btrfs_finish_ordered_io(ordered); in btrfs_invalidate_folio()
8056 if (ordered) in btrfs_invalidate_folio()
8057 btrfs_put_ordered_extent(ordered); in btrfs_invalidate_folio()
8115 struct btrfs_ordered_extent *ordered; in btrfs_page_mkwrite() local
8181 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_page_mkwrite()
8183 if (ordered) { in btrfs_page_mkwrite()
8187 btrfs_start_ordered_extent(ordered); in btrfs_page_mkwrite()
8188 btrfs_put_ordered_extent(ordered); in btrfs_page_mkwrite()
8544 struct btrfs_ordered_extent *ordered; in btrfs_destroy_inode() local
8576 ordered = btrfs_lookup_first_ordered_extent(inode, (u64)-1); in btrfs_destroy_inode()
8577 if (!ordered) in btrfs_destroy_inode()
8582 ordered->file_offset, ordered->num_bytes); in btrfs_destroy_inode()
8587 btrfs_remove_ordered_extent(inode, ordered); in btrfs_destroy_inode()
8588 btrfs_put_ordered_extent(ordered); in btrfs_destroy_inode()
8589 btrfs_put_ordered_extent(ordered); in btrfs_destroy_inode()
10081 struct btrfs_ordered_extent *ordered; in btrfs_encoded_read() local
10088 ordered = btrfs_lookup_ordered_range(inode, start, in btrfs_encoded_read()
10090 if (!ordered) in btrfs_encoded_read()
10092 btrfs_put_ordered_extent(ordered); in btrfs_encoded_read()
10204 struct btrfs_ordered_extent *ordered; in btrfs_do_encoded_write() local
10324 struct btrfs_ordered_extent *ordered; in btrfs_do_encoded_write() local
10335 ordered = btrfs_lookup_ordered_range(inode, start, num_bytes); in btrfs_do_encoded_write()
10336 if (!ordered && in btrfs_do_encoded_write()
10339 if (ordered) in btrfs_do_encoded_write()
10340 btrfs_put_ordered_extent(ordered); in btrfs_do_encoded_write()
10388 ordered = btrfs_alloc_ordered_extent(inode, start, num_bytes, ram_bytes, in btrfs_do_encoded_write()
10394 if (IS_ERR(ordered)) { in btrfs_do_encoded_write()
10396 ret = PTR_ERR(ordered); in btrfs_do_encoded_write()
10408 btrfs_submit_compressed_write(ordered, pages, nr_pages, 0, false); in btrfs_do_encoded_write()
10876 struct btrfs_ordered_extent *ordered; in btrfs_assert_inode_range_clean() local
10881 ordered = btrfs_lookup_first_ordered_range(inode, start, end + 1 - start); in btrfs_assert_inode_range_clean()
10882 if (ordered) { in btrfs_assert_inode_range_clean()
10886 ordered->file_offset, in btrfs_assert_inode_range_clean()
10887 ordered->file_offset + ordered->num_bytes - 1); in btrfs_assert_inode_range_clean()
10888 btrfs_put_ordered_extent(ordered); in btrfs_assert_inode_range_clean()
10891 ASSERT(ordered == NULL); in btrfs_assert_inode_range_clean()