Lines Matching refs:run
88 struct runs_tree *run, const CLST *vcn) in attr_load_runs() argument
96 if (svcn >= evcn + 1 || run_is_mapped_full(run, svcn, evcn)) in attr_load_runs()
108 err = run_unpack_ex(run, ni->mi.sbi, ni->mi.rno, svcn, evcn, in attr_load_runs()
120 static int run_deallocate_ex(struct ntfs_sb_info *sbi, struct runs_tree *run, in run_deallocate_ex() argument
130 if (!run_lookup_entry(run, vcn, &lcn, &clen, &idx)) { in run_deallocate_ex()
132 run_truncate(run, vcn0); in run_deallocate_ex()
156 if (!run_get_entry(run, ++idx, &vcn, &lcn, &clen) || in run_deallocate_ex()
173 int attr_allocate_clusters(struct ntfs_sb_info *sbi, struct runs_tree *run, in attr_allocate_clusters() argument
181 size_t cnt = run->count; in attr_allocate_clusters()
201 if (!run_add_entry(run, vcn, lcn, flen, opt == ALLOCATE_MFT)) { in attr_allocate_clusters()
213 (fr && run->count - cnt >= fr)) { in attr_allocate_clusters()
224 run_deallocate_ex(sbi, run, vcn0, vcn - vcn0, NULL, false); in attr_allocate_clusters()
225 run_truncate(run, vcn0); in attr_allocate_clusters()
239 u64 new_size, struct runs_tree *run, in attr_make_nonresident() argument
271 run_init(run); in attr_make_nonresident()
286 err = attr_allocate_clusters(sbi, run, 0, 0, len, NULL, in attr_make_nonresident()
294 err = ntfs_sb_write_run(sbi, run, 0, data, rsize, 0); in attr_make_nonresident()
326 attr_s->name_len, run, 0, alen, in attr_make_nonresident()
351 run_deallocate(sbi, run, false); in attr_make_nonresident()
352 run_close(run); in attr_make_nonresident()
364 u64 new_size, struct runs_tree *run, in attr_set_size_res() argument
382 run, ins_attr, NULL); in attr_set_size_res()
411 const __le16 *name, u8 name_len, struct runs_tree *run, in attr_set_size() argument
440 err = attr_set_size_res(ni, attr_b, le_b, mi_b, new_size, run, in attr_set_size()
500 err = attr_load_runs(attr, ni, run, NULL); in attr_set_size()
534 !run_lookup_entry(run, vcn, &lcn, NULL, NULL)) { in attr_set_size()
556 if (!run_add_entry(run, vcn, SPARSE_LCN, to_allocate, in attr_set_size()
565 sbi, run, vcn, lcn, to_allocate, &pre_alloc, in attr_set_size()
585 err = mi_pack_runs(mi, attr, run, vcn - svcn); in attr_set_size()
642 err = ni_insert_nonresident(ni, type, name, name_len, run, in attr_set_size()
649 run_truncate_head(run, evcn + 1); in attr_set_size()
679 err = run_deallocate_ex(sbi, run, vcn, evcn - vcn + 1, &alen, in attr_set_size()
684 run_truncate(run, vcn); in attr_set_size()
687 err = mi_pack_runs(mi, attr, run, vcn - svcn); in attr_set_size()
814 struct runs_tree *run = &ni->file.run; in attr_data_get_block() local
829 ok = run_lookup_entry(run, vcn, lcn, len, NULL); in attr_data_get_block()
892 err = attr_load_runs(attr, ni, run, NULL); in attr_data_get_block()
897 ok = run_lookup_entry(run, vcn, lcn, len, NULL); in attr_data_get_block()
926 if (!run_add_entry(run, evcn1, SPARSE_LCN, vcn - evcn1, in attr_data_get_block()
931 } else if (vcn && !run_lookup_entry(run, vcn - 1, &hint, NULL, NULL)) { in attr_data_get_block()
936 sbi, run, vcn, hint + 1, to_alloc, NULL, 0, len, in attr_data_get_block()
949 err = mi_pack_runs(mi, attr, run, max(end, evcn1) - svcn); in attr_data_get_block()
1034 err = attr_load_runs(attr, ni, run, &end); in attr_data_get_block()
1040 err = mi_pack_runs(mi, attr, run, evcn1 - next_svcn); in attr_data_get_block()
1052 err = ni_insert_nonresident(ni, ATTR_DATA, NULL, 0, run, in attr_data_get_block()
1059 run_truncate_around(run, vcn); in attr_data_get_block()
1141 const __le16 *name, u8 name_len, struct runs_tree *run, in attr_load_runs_vcn() argument
1173 err = run_unpack_ex(run, ni->mi.sbi, ni->mi.rno, svcn, evcn, svcn, in attr_load_runs_vcn()
1184 const __le16 *name, u8 name_len, struct runs_tree *run, in attr_load_runs_range() argument
1195 if (!run_lookup_entry(run, vcn, &lcn, &clen, NULL)) { in attr_load_runs_range()
1196 err = attr_load_runs_vcn(ni, type, name, name_len, run, in attr_load_runs_range()
1214 struct runs_tree *run, u64 frame, u64 frames, in attr_wof_frame_info() argument
1299 ARRAY_SIZE(WOF_NAME), run, in attr_wof_frame_info()
1304 err = ntfs_bio_pages(sbi, run, &page, 1, from, in attr_wof_frame_info()
1365 struct runs_tree *run; in attr_is_frame_compressed() local
1377 run = &ni->file.run; in attr_is_frame_compressed()
1379 if (!run_lookup_entry(run, vcn, &lcn, &clen, &idx)) { in attr_is_frame_compressed()
1381 attr->name_len, run, vcn); in attr_is_frame_compressed()
1385 if (!run_lookup_entry(run, vcn, &lcn, &clen, &idx)) in attr_is_frame_compressed()
1414 if (!run_get_entry(run, ++idx, &vcn, &lcn, &clen) || in attr_is_frame_compressed()
1418 attr->name_len, run, vcn_next); in attr_is_frame_compressed()
1423 if (!run_lookup_entry(run, vcn, &lcn, &clen, &idx)) in attr_is_frame_compressed()
1466 struct runs_tree *run = &ni->file.run; in attr_allocate_frame() local
1509 err = attr_load_runs(attr, ni, run, NULL); in attr_allocate_frame()
1525 err = run_deallocate_ex(sbi, run, vcn + len, clst_data - len, in attr_allocate_frame()
1530 if (!run_add_entry(run, vcn + len, SPARSE_LCN, clst_data - len, in attr_allocate_frame()
1541 !run_lookup_entry(run, vcn + clst_data - 1, &hint, NULL, in attr_allocate_frame()
1546 err = attr_allocate_clusters(sbi, run, vcn + clst_data, in attr_allocate_frame()
1559 err = mi_pack_runs(mi, attr, run, max(end, evcn1) - svcn); in attr_allocate_frame()
1643 err = attr_load_runs(attr, ni, run, &end); in attr_allocate_frame()
1649 err = mi_pack_runs(mi, attr, run, evcn1 - next_svcn); in attr_allocate_frame()
1661 err = ni_insert_nonresident(ni, ATTR_DATA, NULL, 0, run, in attr_allocate_frame()
1668 run_truncate_around(run, vcn); in attr_allocate_frame()
1690 struct runs_tree *run = &ni->file.run; in attr_collapse_range() local
1741 err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run, vbo, in attr_collapse_range()
1796 err = attr_load_runs(attr, ni, run, &svcn); in attr_collapse_range()
1802 err = run_deallocate_ex(sbi, run, vcn1, eat, &dealloc, in attr_collapse_range()
1807 if (!run_collapse_range(run, vcn1, eat)) { in attr_collapse_range()
1821 err = mi_pack_runs(mi, attr, run, evcn1 - svcn - eat); in attr_collapse_range()
1828 ni, ATTR_DATA, NULL, 0, run, next_svcn, in attr_collapse_range()
1845 run_truncate(run, 0); in attr_collapse_range()
1954 struct runs_tree *run = &ni->file.run; in attr_punch_hole() local
2048 err = attr_load_runs(attr, ni, run, &svcn); in attr_punch_hole()
2055 err = run_deallocate_ex(sbi, run, vcn1, zero, &dealloc, true); in attr_punch_hole()
2062 if (!run_add_entry(run, vcn1, SPARSE_LCN, zero, in attr_punch_hole()
2068 err = mi_pack_runs(mi, attr, run, evcn1 - svcn); in attr_punch_hole()
2073 run_truncate(run, 0); in attr_punch_hole()