Lines Matching refs:rl
37 const struct runlist_element *rl) in ntfs_cluster_free_from_rl_nolock() argument
44 if (!rl) in ntfs_cluster_free_from_rl_nolock()
50 for (; rl->length; rl++) { in ntfs_cluster_free_from_rl_nolock()
53 if (rl->lcn < 0) in ntfs_cluster_free_from_rl_nolock()
55 err = ntfs_bitmap_clear_run(lcnbmp_vi, rl->lcn, rl->length); in ntfs_cluster_free_from_rl_nolock()
57 nr_freed += rl->length; in ntfs_cluster_free_from_rl_nolock()
195 struct runlist_element *rl = NULL; in ntfs_cluster_alloc() local
383 if ((rlpos + 2) * sizeof(*rl) > rlsize) { in ntfs_cluster_alloc()
387 if (!rl) in ntfs_cluster_alloc()
396 memcpy(rl2, rl, rlsize); in ntfs_cluster_alloc()
397 kvfree(rl); in ntfs_cluster_alloc()
398 rl = rl2; in ntfs_cluster_alloc()
421 rl[rlpos - 1].lcn, in ntfs_cluster_alloc()
422 rl[rlpos - 1].length); in ntfs_cluster_alloc()
423 rl[rlpos - 1].length = ++prev_run_len; in ntfs_cluster_alloc()
425 rl[rlpos - 1].lcn, in ntfs_cluster_alloc()
426 rl[rlpos - 1].length, in ntfs_cluster_alloc()
431 rl[rlpos - 1].lcn, rl[rlpos - 1].length); in ntfs_cluster_alloc()
432 rl[rlpos].vcn = rl[rlpos - 1].vcn + in ntfs_cluster_alloc()
436 rl[rlpos].vcn = start_vcn; in ntfs_cluster_alloc()
438 rl[rlpos].lcn = prev_lcn = lcn + bmp_pos; in ntfs_cluster_alloc()
439 rl[rlpos].length = prev_run_len = 1; in ntfs_cluster_alloc()
581 tc = rl[rlpos - 1].lcn + in ntfs_cluster_alloc()
582 rl[rlpos - 1].length; in ntfs_cluster_alloc()
617 tc = rl[rlpos - 1].lcn + in ntfs_cluster_alloc()
618 rl[rlpos - 1].length; in ntfs_cluster_alloc()
651 tc = rl[rlpos - 1].lcn + in ntfs_cluster_alloc()
652 rl[rlpos - 1].length; in ntfs_cluster_alloc()
724 if (likely(rl)) { in ntfs_cluster_alloc()
725 rl[rlpos].vcn = rl[rlpos - 1].vcn + rl[rlpos - 1].length; in ntfs_cluster_alloc()
726 rl[rlpos].lcn = is_extension ? LCN_ENOENT : LCN_RL_NOT_MAPPED; in ntfs_cluster_alloc()
727 rl[rlpos].length = 0; in ntfs_cluster_alloc()
740 if (!rl) { in ntfs_cluster_alloc()
745 ntfs_release_dirty_clusters(vol, rl->length); in ntfs_cluster_alloc()
753 if (rl) { in ntfs_cluster_alloc()
758 rl[0].lcn, count - clusters); in ntfs_cluster_alloc()
761 err2 = ntfs_cluster_free_from_rl_nolock(vol, rl); in ntfs_cluster_alloc()
769 kvfree(rl); in ntfs_cluster_alloc()
779 return err < 0 ? ERR_PTR(err) : rl; in ntfs_cluster_alloc()
848 struct runlist_element *rl; in __ntfs_cluster_free() local
877 rl = ntfs_attr_find_vcn_nolock(ni, start_vcn, ctx); in __ntfs_cluster_free()
878 if (IS_ERR(rl)) { in __ntfs_cluster_free()
879 err = PTR_ERR(rl); in __ntfs_cluster_free()
894 if (unlikely(rl->lcn < LCN_HOLE)) { in __ntfs_cluster_free()
901 delta = start_vcn - rl->vcn; in __ntfs_cluster_free()
904 to_free = rl->length - delta; in __ntfs_cluster_free()
908 if (likely(rl->lcn >= 0)) { in __ntfs_cluster_free()
910 err = ntfs_bitmap_set_bits_in_run(lcnbmp_vi, rl->lcn + delta, in __ntfs_cluster_free()
923 ++rl; in __ntfs_cluster_free()
933 for (; rl->length && count != 0; ++rl) { in __ntfs_cluster_free()
934 if (unlikely(rl->lcn < LCN_HOLE)) { in __ntfs_cluster_free()
938 vcn = rl->vcn; in __ntfs_cluster_free()
939 rl = ntfs_attr_find_vcn_nolock(ni, vcn, ctx); in __ntfs_cluster_free()
940 if (IS_ERR(rl)) { in __ntfs_cluster_free()
941 err = PTR_ERR(rl); in __ntfs_cluster_free()
947 if (unlikely(rl->lcn < LCN_HOLE)) { in __ntfs_cluster_free()
951 rl->lcn); in __ntfs_cluster_free()
957 to_free = rl->length; in __ntfs_cluster_free()
961 if (likely(rl->lcn >= 0)) { in __ntfs_cluster_free()
963 err = ntfs_bitmap_set_bits_in_run(lcnbmp_vi, rl->lcn, in __ntfs_cluster_free()
992 rl = ntfs_attr_find_vcn_nolock(ni, start_vcn, ctx); in __ntfs_cluster_free()
993 if (IS_ERR(rl)) in __ntfs_cluster_free()
995 rl_off = start_vcn - rl->vcn; in __ntfs_cluster_free()
996 while (rl->length && total_discarded < total_freed) { in __ntfs_cluster_free()
997 s64 to_discard = rl->length - rl_off; in __ntfs_cluster_free()
1001 if (rl->lcn >= 0) { in __ntfs_cluster_free()
1005 start_sector = ALIGN(NTFS_CLU_TO_B(vol, rl->lcn + rl_off), in __ntfs_cluster_free()
1008 rl->lcn + rl_off + to_discard), in __ntfs_cluster_free()
1020 ++rl; in __ntfs_cluster_free()