Lines Matching refs:ordered

613 	struct btrfs_ordered_extent *ordered;  in btrfs_run_ordered_extent_work()  local
615 ordered = container_of(work, struct btrfs_ordered_extent, flush_work); in btrfs_run_ordered_extent_work()
616 btrfs_start_ordered_extent(ordered, 1); in btrfs_run_ordered_extent_work()
617 complete(&ordered->completion); in btrfs_run_ordered_extent_work()
631 struct btrfs_ordered_extent *ordered, *next; in btrfs_wait_ordered_extents() local
639 ordered = list_first_entry(&splice, struct btrfs_ordered_extent, in btrfs_wait_ordered_extents()
642 if (range_end <= ordered->disk_bytenr || in btrfs_wait_ordered_extents()
643 ordered->disk_bytenr + ordered->disk_num_bytes <= range_start) { in btrfs_wait_ordered_extents()
644 list_move_tail(&ordered->root_extent_list, &skipped); in btrfs_wait_ordered_extents()
649 list_move_tail(&ordered->root_extent_list, in btrfs_wait_ordered_extents()
651 refcount_inc(&ordered->refs); in btrfs_wait_ordered_extents()
654 btrfs_init_work(&ordered->flush_work, in btrfs_wait_ordered_extents()
656 list_add_tail(&ordered->work_list, &works); in btrfs_wait_ordered_extents()
657 btrfs_queue_work(fs_info->flush_workers, &ordered->flush_work); in btrfs_wait_ordered_extents()
669 list_for_each_entry_safe(ordered, next, &works, work_list) { in btrfs_wait_ordered_extents()
670 list_del_init(&ordered->work_list); in btrfs_wait_ordered_extents()
671 wait_for_completion(&ordered->completion); in btrfs_wait_ordered_extents()
672 btrfs_put_ordered_extent(ordered); in btrfs_wait_ordered_extents()
761 struct btrfs_ordered_extent *ordered; in btrfs_wait_ordered_range() local
789 ordered = btrfs_lookup_first_ordered_extent(BTRFS_I(inode), end); in btrfs_wait_ordered_range()
790 if (!ordered) in btrfs_wait_ordered_range()
792 if (ordered->file_offset > orig_end) { in btrfs_wait_ordered_range()
793 btrfs_put_ordered_extent(ordered); in btrfs_wait_ordered_range()
796 if (ordered->file_offset + ordered->num_bytes <= start) { in btrfs_wait_ordered_range()
797 btrfs_put_ordered_extent(ordered); in btrfs_wait_ordered_range()
800 btrfs_start_ordered_extent(ordered, 1); in btrfs_wait_ordered_range()
801 end = ordered->file_offset; in btrfs_wait_ordered_range()
807 if (test_bit(BTRFS_ORDERED_IOERR, &ordered->flags)) in btrfs_wait_ordered_range()
809 btrfs_put_ordered_extent(ordered); in btrfs_wait_ordered_range()
903 struct btrfs_ordered_extent *ordered; in btrfs_get_ordered_extents_for_logging() local
905 ordered = rb_entry(n, struct btrfs_ordered_extent, rb_node); in btrfs_get_ordered_extents_for_logging()
907 if (test_bit(BTRFS_ORDERED_LOGGED, &ordered->flags)) in btrfs_get_ordered_extents_for_logging()
910 ASSERT(list_empty(&ordered->log_list)); in btrfs_get_ordered_extents_for_logging()
911 list_add_tail(&ordered->log_list, list); in btrfs_get_ordered_extents_for_logging()
912 refcount_inc(&ordered->refs); in btrfs_get_ordered_extents_for_logging()
913 trace_btrfs_ordered_extent_lookup_for_logging(inode, ordered); in btrfs_get_ordered_extents_for_logging()
1038 struct btrfs_ordered_extent *ordered; in btrfs_lock_and_flush_ordered_range() local
1047 ordered = btrfs_lookup_ordered_range(inode, start, in btrfs_lock_and_flush_ordered_range()
1049 if (!ordered) { in btrfs_lock_and_flush_ordered_range()
1060 btrfs_start_ordered_extent(ordered, 1); in btrfs_lock_and_flush_ordered_range()
1061 btrfs_put_ordered_extent(ordered); in btrfs_lock_and_flush_ordered_range()
1074 struct btrfs_ordered_extent *ordered; in btrfs_try_lock_ordered_range() local
1079 ordered = btrfs_lookup_ordered_range(inode, start, end - start + 1); in btrfs_try_lock_ordered_range()
1080 if (!ordered) in btrfs_try_lock_ordered_range()
1083 btrfs_put_ordered_extent(ordered); in btrfs_try_lock_ordered_range()
1090 static int clone_ordered_extent(struct btrfs_ordered_extent *ordered, u64 pos, in clone_ordered_extent() argument
1093 struct inode *inode = ordered->inode; in clone_ordered_extent()
1095 u64 file_offset = ordered->file_offset + pos; in clone_ordered_extent()
1096 u64 disk_bytenr = ordered->disk_bytenr + pos; in clone_ordered_extent()
1097 unsigned long flags = ordered->flags & BTRFS_ORDERED_TYPE_FLAGS; in clone_ordered_extent()
1108 ordered->compress_type); in clone_ordered_extent()
1111 int btrfs_split_ordered_extent(struct btrfs_ordered_extent *ordered, u64 pre, in btrfs_split_ordered_extent() argument
1114 struct inode *inode = ordered->inode; in btrfs_split_ordered_extent()
1120 trace_btrfs_ordered_extent_split(BTRFS_I(inode), ordered); in btrfs_split_ordered_extent()
1124 node = &ordered->rb_node; in btrfs_split_ordered_extent()
1130 ordered->file_offset += pre; in btrfs_split_ordered_extent()
1131 ordered->disk_bytenr += pre; in btrfs_split_ordered_extent()
1132 ordered->num_bytes -= (pre + post); in btrfs_split_ordered_extent()
1133 ordered->disk_num_bytes -= (pre + post); in btrfs_split_ordered_extent()
1134 ordered->bytes_left -= (pre + post); in btrfs_split_ordered_extent()
1137 node = tree_insert(&tree->tree, ordered->file_offset, &ordered->rb_node); in btrfs_split_ordered_extent()
1141 ordered->file_offset); in btrfs_split_ordered_extent()
1146 ret = clone_ordered_extent(ordered, 0, pre); in btrfs_split_ordered_extent()
1148 ret = clone_ordered_extent(ordered, pre + ordered->disk_num_bytes, in btrfs_split_ordered_extent()