Lines Matching refs:ordered
2640 struct btrfs_ordered_extent *ordered; in extract_ordered_extent() local
2649 ordered = btrfs_lookup_ordered_extent(inode, file_offset); in extract_ordered_extent()
2650 if (WARN_ON_ONCE(!ordered)) in extract_ordered_extent()
2654 if (ordered->disk_num_bytes == len) in extract_ordered_extent()
2658 if (WARN_ON_ONCE(ordered->bytes_left != ordered->disk_num_bytes)) { in extract_ordered_extent()
2664 if (WARN_ON_ONCE(ordered->disk_num_bytes != ordered->num_bytes)) { in extract_ordered_extent()
2669 ordered_end = ordered->disk_bytenr + ordered->disk_num_bytes; in extract_ordered_extent()
2671 if (WARN_ON_ONCE(start < ordered->disk_bytenr || end > ordered_end)) { in extract_ordered_extent()
2677 if (WARN_ON_ONCE(!list_empty(&ordered->list))) { in extract_ordered_extent()
2682 file_len = ordered->num_bytes; in extract_ordered_extent()
2683 pre = start - ordered->disk_bytenr; in extract_ordered_extent()
2686 ret = btrfs_split_ordered_extent(ordered, pre, post); in extract_ordered_extent()
2692 btrfs_put_ordered_extent(ordered); in extract_ordered_extent()
2869 struct btrfs_ordered_extent *ordered; in btrfs_writepage_fixup_worker() local
2940 ordered = btrfs_lookup_ordered_range(inode, page_start, PAGE_SIZE); in btrfs_writepage_fixup_worker()
2941 if (ordered) { in btrfs_writepage_fixup_worker()
2945 btrfs_start_ordered_extent(ordered, 1); in btrfs_writepage_fixup_worker()
2946 btrfs_put_ordered_extent(ordered); in btrfs_writepage_fixup_worker()
4866 struct btrfs_ordered_extent *ordered; in btrfs_truncate_block() local
4934 ordered = btrfs_lookup_ordered_extent(inode, block_start); in btrfs_truncate_block()
4935 if (ordered) { in btrfs_truncate_block()
4939 btrfs_start_ordered_extent(ordered, 1); in btrfs_truncate_block()
4940 btrfs_put_ordered_extent(ordered); in btrfs_truncate_block()
7253 struct btrfs_ordered_extent *ordered; in lock_extent_direct() local
7268 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, in lock_extent_direct()
7278 if (!ordered && in lock_extent_direct()
7285 if (ordered) { in lock_extent_direct()
7287 btrfs_put_ordered_extent(ordered); in lock_extent_direct()
7307 test_bit(BTRFS_ORDERED_DIRECT, &ordered->flags)) in lock_extent_direct()
7308 btrfs_start_ordered_extent(ordered, 1); in lock_extent_direct()
7311 btrfs_put_ordered_extent(ordered); in lock_extent_direct()
8262 struct btrfs_ordered_extent *ordered; in btrfs_invalidate_folio() local
8267 ordered = btrfs_lookup_first_ordered_range(inode, cur, in btrfs_invalidate_folio()
8269 if (!ordered) { in btrfs_invalidate_folio()
8278 if (ordered->file_offset > cur) { in btrfs_invalidate_folio()
8285 range_end = ordered->file_offset - 1; in btrfs_invalidate_folio()
8290 range_end = min(ordered->file_offset + ordered->num_bytes - 1, in btrfs_invalidate_folio()
8320 set_bit(BTRFS_ORDERED_TRUNCATED, &ordered->flags); in btrfs_invalidate_folio()
8321 ordered->truncated_len = min(ordered->truncated_len, in btrfs_invalidate_folio()
8322 cur - ordered->file_offset); in btrfs_invalidate_folio()
8331 if (btrfs_dec_test_ordered_pending(inode, &ordered, in btrfs_invalidate_folio()
8333 btrfs_finish_ordered_io(ordered); in btrfs_invalidate_folio()
8341 if (ordered) in btrfs_invalidate_folio()
8342 btrfs_put_ordered_extent(ordered); in btrfs_invalidate_folio()
8400 struct btrfs_ordered_extent *ordered; in btrfs_page_mkwrite() local
8466 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_page_mkwrite()
8468 if (ordered) { in btrfs_page_mkwrite()
8472 btrfs_start_ordered_extent(ordered, 1); in btrfs_page_mkwrite()
8473 btrfs_put_ordered_extent(ordered); in btrfs_page_mkwrite()
8817 struct btrfs_ordered_extent *ordered; in btrfs_destroy_inode() local
8849 ordered = btrfs_lookup_first_ordered_extent(inode, (u64)-1); in btrfs_destroy_inode()
8850 if (!ordered) in btrfs_destroy_inode()
8855 ordered->file_offset, ordered->num_bytes); in btrfs_destroy_inode()
8860 btrfs_remove_ordered_extent(inode, ordered); in btrfs_destroy_inode()
8861 btrfs_put_ordered_extent(ordered); in btrfs_destroy_inode()
8862 btrfs_put_ordered_extent(ordered); in btrfs_destroy_inode()
10474 struct btrfs_ordered_extent *ordered; in btrfs_encoded_read() local
10481 ordered = btrfs_lookup_ordered_range(inode, start, in btrfs_encoded_read()
10483 if (!ordered) in btrfs_encoded_read()
10485 btrfs_put_ordered_extent(ordered); in btrfs_encoded_read()
10709 struct btrfs_ordered_extent *ordered; in btrfs_do_encoded_write() local
10720 ordered = btrfs_lookup_ordered_range(inode, start, num_bytes); in btrfs_do_encoded_write()
10721 if (!ordered && in btrfs_do_encoded_write()
10724 if (ordered) in btrfs_do_encoded_write()
10725 btrfs_put_ordered_extent(ordered); in btrfs_do_encoded_write()
11267 struct btrfs_ordered_extent *ordered; in btrfs_assert_inode_range_clean() local
11272 ordered = btrfs_lookup_first_ordered_range(inode, start, end + 1 - start); in btrfs_assert_inode_range_clean()
11273 if (ordered) { in btrfs_assert_inode_range_clean()
11277 ordered->file_offset, in btrfs_assert_inode_range_clean()
11278 ordered->file_offset + ordered->num_bytes - 1); in btrfs_assert_inode_range_clean()
11279 btrfs_put_ordered_extent(ordered); in btrfs_assert_inode_range_clean()
11282 ASSERT(ordered == NULL); in btrfs_assert_inode_range_clean()