Lines Matching refs:vol

36 int ntfs_cluster_free_from_rl_nolock(ntfs_volume *vol,  in ntfs_cluster_free_from_rl_nolock()  argument
39 struct inode *lcnbmp_vi = vol->lcnbmp_ino; in ntfs_cluster_free_from_rl_nolock()
132 runlist_element *ntfs_cluster_alloc(ntfs_volume *vol, const VCN start_vcn, in ntfs_cluster_alloc() argument
154 BUG_ON(!vol); in ntfs_cluster_alloc()
155 lcnbmp_vi = vol->lcnbmp_ino; in ntfs_cluster_alloc()
167 down_write(&vol->lcnbmp_lock); in ntfs_cluster_alloc()
189 zone_start = vol->data1_zone_pos; in ntfs_cluster_alloc()
191 zone_start = vol->mft_zone_pos; in ntfs_cluster_alloc()
199 } else if (zone == DATA_ZONE && zone_start >= vol->mft_zone_start && in ntfs_cluster_alloc()
200 zone_start < vol->mft_zone_end) { in ntfs_cluster_alloc()
201 zone_start = vol->mft_zone_end; in ntfs_cluster_alloc()
207 } else if (zone == MFT_ZONE && (zone_start < vol->mft_zone_start || in ntfs_cluster_alloc()
208 zone_start >= vol->mft_zone_end)) { in ntfs_cluster_alloc()
209 zone_start = vol->mft_lcn; in ntfs_cluster_alloc()
210 if (!vol->mft_zone_end) in ntfs_cluster_alloc()
219 zone_end = vol->mft_zone_end; in ntfs_cluster_alloc()
224 if (zone_start >= vol->mft_zone_end) { in ntfs_cluster_alloc()
225 zone_end = vol->nr_clusters; in ntfs_cluster_alloc()
228 zone_end = vol->mft_zone_start; in ntfs_cluster_alloc()
275 ntfs_error(vol->sb, "Failed to map page."); in ntfs_cluster_alloc()
332 ntfs_error(vol->sb, "Failed to " in ntfs_cluster_alloc()
419 vol->mft_zone_pos); in ntfs_cluster_alloc()
420 if (tc >= vol->mft_zone_end) { in ntfs_cluster_alloc()
421 vol->mft_zone_pos = in ntfs_cluster_alloc()
422 vol->mft_lcn; in ntfs_cluster_alloc()
423 if (!vol->mft_zone_end) in ntfs_cluster_alloc()
424 vol->mft_zone_pos = 0; in ntfs_cluster_alloc()
426 vol->mft_zone_pos || in ntfs_cluster_alloc()
427 tc > vol->mft_zone_pos) in ntfs_cluster_alloc()
428 && tc >= vol->mft_lcn) in ntfs_cluster_alloc()
429 vol->mft_zone_pos = tc; in ntfs_cluster_alloc()
434 vol->mft_zone_pos); in ntfs_cluster_alloc()
441 vol->data1_zone_pos); in ntfs_cluster_alloc()
442 if (tc >= vol->nr_clusters) in ntfs_cluster_alloc()
443 vol->data1_zone_pos = in ntfs_cluster_alloc()
444 vol->mft_zone_end; in ntfs_cluster_alloc()
446 vol->data1_zone_pos || in ntfs_cluster_alloc()
447 tc > vol->data1_zone_pos) in ntfs_cluster_alloc()
448 && tc >= vol->mft_zone_end) in ntfs_cluster_alloc()
449 vol->data1_zone_pos = tc; in ntfs_cluster_alloc()
454 vol->data1_zone_pos); in ntfs_cluster_alloc()
461 vol->data2_zone_pos); in ntfs_cluster_alloc()
462 if (tc >= vol->mft_zone_start) in ntfs_cluster_alloc()
463 vol->data2_zone_pos = 0; in ntfs_cluster_alloc()
465 vol->data2_zone_pos || in ntfs_cluster_alloc()
466 tc > vol->data2_zone_pos) in ntfs_cluster_alloc()
467 vol->data2_zone_pos = tc; in ntfs_cluster_alloc()
472 vol->data2_zone_pos); in ntfs_cluster_alloc()
505 zone_start = vol->mft_zone_start; in ntfs_cluster_alloc()
508 zone_start = vol->mft_zone_end; in ntfs_cluster_alloc()
550 vol->mft_zone_pos); in ntfs_cluster_alloc()
553 if (tc >= vol->mft_zone_end) { in ntfs_cluster_alloc()
554 vol->mft_zone_pos = in ntfs_cluster_alloc()
555 vol->mft_lcn; in ntfs_cluster_alloc()
556 if (!vol->mft_zone_end) in ntfs_cluster_alloc()
557 vol->mft_zone_pos = 0; in ntfs_cluster_alloc()
559 vol->mft_zone_pos || in ntfs_cluster_alloc()
560 tc > vol->mft_zone_pos) in ntfs_cluster_alloc()
561 && tc >= vol->mft_lcn) in ntfs_cluster_alloc()
562 vol->mft_zone_pos = tc; in ntfs_cluster_alloc()
567 vol->mft_zone_pos); in ntfs_cluster_alloc()
572 vol->data1_zone_pos; in ntfs_cluster_alloc()
573 zone_end = vol->nr_clusters; in ntfs_cluster_alloc()
574 if (zone_start == vol->mft_zone_end) in ntfs_cluster_alloc()
577 vol->data1_zone_pos = zone_start = in ntfs_cluster_alloc()
578 vol->mft_zone_end; in ntfs_cluster_alloc()
593 vol->data1_zone_pos); in ntfs_cluster_alloc()
596 if (tc >= vol->nr_clusters) in ntfs_cluster_alloc()
597 vol->data1_zone_pos = in ntfs_cluster_alloc()
598 vol->mft_zone_end; in ntfs_cluster_alloc()
600 vol->data1_zone_pos || in ntfs_cluster_alloc()
601 tc > vol->data1_zone_pos) in ntfs_cluster_alloc()
602 && tc >= vol->mft_zone_end) in ntfs_cluster_alloc()
603 vol->data1_zone_pos = tc; in ntfs_cluster_alloc()
608 vol->data1_zone_pos); in ntfs_cluster_alloc()
613 vol->data2_zone_pos; in ntfs_cluster_alloc()
614 zone_end = vol->mft_zone_start; in ntfs_cluster_alloc()
618 vol->data2_zone_pos = zone_start = in ntfs_cluster_alloc()
634 vol->data2_zone_pos); in ntfs_cluster_alloc()
637 if (tc >= vol->mft_zone_start) in ntfs_cluster_alloc()
638 vol->data2_zone_pos = 0; in ntfs_cluster_alloc()
640 vol->data2_zone_pos || in ntfs_cluster_alloc()
641 tc > vol->data2_zone_pos) in ntfs_cluster_alloc()
642 vol->data2_zone_pos = tc; in ntfs_cluster_alloc()
647 vol->data2_zone_pos); in ntfs_cluster_alloc()
676 mft_zone_size = vol->mft_zone_end - vol->mft_zone_start; in ntfs_cluster_alloc()
679 (unsigned long long)vol->mft_zone_start, in ntfs_cluster_alloc()
680 (unsigned long long)vol->mft_zone_end, in ntfs_cluster_alloc()
689 zone_end = vol->mft_zone_end; in ntfs_cluster_alloc()
692 vol->mft_zone_end = vol->mft_zone_start + mft_zone_size; in ntfs_cluster_alloc()
694 vol->data2_zone_pos = vol->mft_zone_start = in ntfs_cluster_alloc()
695 vol->mft_zone_end = 0; in ntfs_cluster_alloc()
696 if (vol->mft_zone_pos >= vol->mft_zone_end) { in ntfs_cluster_alloc()
697 vol->mft_zone_pos = vol->mft_lcn; in ntfs_cluster_alloc()
698 if (!vol->mft_zone_end) in ntfs_cluster_alloc()
699 vol->mft_zone_pos = 0; in ntfs_cluster_alloc()
702 vol->data1_zone_pos = vol->mft_zone_end; in ntfs_cluster_alloc()
714 (unsigned long long)vol->mft_zone_start, in ntfs_cluster_alloc()
715 (unsigned long long)vol->mft_zone_end, in ntfs_cluster_alloc()
716 (unsigned long long)vol->mft_zone_pos, in ntfs_cluster_alloc()
719 (unsigned long long)vol->data1_zone_pos); in ntfs_cluster_alloc()
740 up_write(&vol->lcnbmp_lock); in ntfs_cluster_alloc()
744 ntfs_error(vol->sb, "Failed to allocate clusters, aborting " in ntfs_cluster_alloc()
758 err2 = ntfs_cluster_free_from_rl_nolock(vol, rl); in ntfs_cluster_alloc()
760 ntfs_error(vol->sb, "Failed to rollback (error %i). " in ntfs_cluster_alloc()
763 NVolSetErrors(vol); in ntfs_cluster_alloc()
770 (long long)vol->data1_zone_pos); in ntfs_cluster_alloc()
771 up_write(&vol->lcnbmp_lock); in ntfs_cluster_alloc()
839 ntfs_volume *vol; in __ntfs_cluster_free() local
849 vol = ni->vol; in __ntfs_cluster_free()
850 lcnbmp_vi = vol->lcnbmp_ino; in __ntfs_cluster_free()
862 down_write(&vol->lcnbmp_lock); in __ntfs_cluster_free()
869 ntfs_error(vol->sb, "Failed to find first runlist " in __ntfs_cluster_free()
877 ntfs_error(vol->sb, "First runlist element has " in __ntfs_cluster_free()
896 ntfs_error(vol->sb, "Failed to clear first run " in __ntfs_cluster_free()
924 ntfs_error(vol->sb, "Failed to map " in __ntfs_cluster_free()
933 ntfs_error(vol->sb, "Runlist element " in __ntfs_cluster_free()
953 ntfs_error(vol->sb, "Failed to clear " in __ntfs_cluster_free()
968 up_write(&vol->lcnbmp_lock); in __ntfs_cluster_free()
980 up_write(&vol->lcnbmp_lock); in __ntfs_cluster_free()
990 ntfs_error(vol->sb, "Failed to rollback (error %i). Leaving " in __ntfs_cluster_free()
993 NVolSetErrors(vol); in __ntfs_cluster_free()
995 up_write(&vol->lcnbmp_lock); in __ntfs_cluster_free()
996 ntfs_error(vol->sb, "Aborting (error %i).", err); in __ntfs_cluster_free()