Lines Matching refs:vol
50 int ntfs_cluster_free_from_rl_nolock(ntfs_volume *vol, in ntfs_cluster_free_from_rl_nolock() argument
53 struct inode *lcnbmp_vi = vol->lcnbmp_ino; in ntfs_cluster_free_from_rl_nolock()
146 runlist_element *ntfs_cluster_alloc(ntfs_volume *vol, const VCN start_vcn, in ntfs_cluster_alloc() argument
168 BUG_ON(!vol); in ntfs_cluster_alloc()
169 lcnbmp_vi = vol->lcnbmp_ino; in ntfs_cluster_alloc()
181 down_write(&vol->lcnbmp_lock); in ntfs_cluster_alloc()
203 zone_start = vol->data1_zone_pos; in ntfs_cluster_alloc()
205 zone_start = vol->mft_zone_pos; in ntfs_cluster_alloc()
213 } else if (zone == DATA_ZONE && zone_start >= vol->mft_zone_start && in ntfs_cluster_alloc()
214 zone_start < vol->mft_zone_end) { in ntfs_cluster_alloc()
215 zone_start = vol->mft_zone_end; in ntfs_cluster_alloc()
221 } else if (zone == MFT_ZONE && (zone_start < vol->mft_zone_start || in ntfs_cluster_alloc()
222 zone_start >= vol->mft_zone_end)) { in ntfs_cluster_alloc()
223 zone_start = vol->mft_lcn; in ntfs_cluster_alloc()
224 if (!vol->mft_zone_end) in ntfs_cluster_alloc()
233 zone_end = vol->mft_zone_end; in ntfs_cluster_alloc()
238 if (zone_start >= vol->mft_zone_end) { in ntfs_cluster_alloc()
239 zone_end = vol->nr_clusters; in ntfs_cluster_alloc()
242 zone_end = vol->mft_zone_start; in ntfs_cluster_alloc()
289 ntfs_error(vol->sb, "Failed to map page."); in ntfs_cluster_alloc()
346 ntfs_error(vol->sb, "Failed to " in ntfs_cluster_alloc()
433 vol->mft_zone_pos); in ntfs_cluster_alloc()
434 if (tc >= vol->mft_zone_end) { in ntfs_cluster_alloc()
435 vol->mft_zone_pos = in ntfs_cluster_alloc()
436 vol->mft_lcn; in ntfs_cluster_alloc()
437 if (!vol->mft_zone_end) in ntfs_cluster_alloc()
438 vol->mft_zone_pos = 0; in ntfs_cluster_alloc()
440 vol->mft_zone_pos || in ntfs_cluster_alloc()
441 tc > vol->mft_zone_pos) in ntfs_cluster_alloc()
442 && tc >= vol->mft_lcn) in ntfs_cluster_alloc()
443 vol->mft_zone_pos = tc; in ntfs_cluster_alloc()
448 vol->mft_zone_pos); in ntfs_cluster_alloc()
455 vol->data1_zone_pos); in ntfs_cluster_alloc()
456 if (tc >= vol->nr_clusters) in ntfs_cluster_alloc()
457 vol->data1_zone_pos = in ntfs_cluster_alloc()
458 vol->mft_zone_end; in ntfs_cluster_alloc()
460 vol->data1_zone_pos || in ntfs_cluster_alloc()
461 tc > vol->data1_zone_pos) in ntfs_cluster_alloc()
462 && tc >= vol->mft_zone_end) in ntfs_cluster_alloc()
463 vol->data1_zone_pos = tc; in ntfs_cluster_alloc()
468 vol->data1_zone_pos); in ntfs_cluster_alloc()
475 vol->data2_zone_pos); in ntfs_cluster_alloc()
476 if (tc >= vol->mft_zone_start) in ntfs_cluster_alloc()
477 vol->data2_zone_pos = 0; in ntfs_cluster_alloc()
479 vol->data2_zone_pos || in ntfs_cluster_alloc()
480 tc > vol->data2_zone_pos) in ntfs_cluster_alloc()
481 vol->data2_zone_pos = tc; in ntfs_cluster_alloc()
486 vol->data2_zone_pos); in ntfs_cluster_alloc()
519 zone_start = vol->mft_zone_start; in ntfs_cluster_alloc()
522 zone_start = vol->mft_zone_end; in ntfs_cluster_alloc()
564 vol->mft_zone_pos); in ntfs_cluster_alloc()
567 if (tc >= vol->mft_zone_end) { in ntfs_cluster_alloc()
568 vol->mft_zone_pos = in ntfs_cluster_alloc()
569 vol->mft_lcn; in ntfs_cluster_alloc()
570 if (!vol->mft_zone_end) in ntfs_cluster_alloc()
571 vol->mft_zone_pos = 0; in ntfs_cluster_alloc()
573 vol->mft_zone_pos || in ntfs_cluster_alloc()
574 tc > vol->mft_zone_pos) in ntfs_cluster_alloc()
575 && tc >= vol->mft_lcn) in ntfs_cluster_alloc()
576 vol->mft_zone_pos = tc; in ntfs_cluster_alloc()
581 vol->mft_zone_pos); in ntfs_cluster_alloc()
586 vol->data1_zone_pos; in ntfs_cluster_alloc()
587 zone_end = vol->nr_clusters; in ntfs_cluster_alloc()
588 if (zone_start == vol->mft_zone_end) in ntfs_cluster_alloc()
591 vol->data1_zone_pos = zone_start = in ntfs_cluster_alloc()
592 vol->mft_zone_end; in ntfs_cluster_alloc()
607 vol->data1_zone_pos); in ntfs_cluster_alloc()
610 if (tc >= vol->nr_clusters) in ntfs_cluster_alloc()
611 vol->data1_zone_pos = in ntfs_cluster_alloc()
612 vol->mft_zone_end; in ntfs_cluster_alloc()
614 vol->data1_zone_pos || in ntfs_cluster_alloc()
615 tc > vol->data1_zone_pos) in ntfs_cluster_alloc()
616 && tc >= vol->mft_zone_end) in ntfs_cluster_alloc()
617 vol->data1_zone_pos = tc; in ntfs_cluster_alloc()
622 vol->data1_zone_pos); in ntfs_cluster_alloc()
627 vol->data2_zone_pos; in ntfs_cluster_alloc()
628 zone_end = vol->mft_zone_start; in ntfs_cluster_alloc()
632 vol->data2_zone_pos = zone_start = in ntfs_cluster_alloc()
648 vol->data2_zone_pos); in ntfs_cluster_alloc()
651 if (tc >= vol->mft_zone_start) in ntfs_cluster_alloc()
652 vol->data2_zone_pos = 0; in ntfs_cluster_alloc()
654 vol->data2_zone_pos || in ntfs_cluster_alloc()
655 tc > vol->data2_zone_pos) in ntfs_cluster_alloc()
656 vol->data2_zone_pos = tc; in ntfs_cluster_alloc()
661 vol->data2_zone_pos); in ntfs_cluster_alloc()
690 mft_zone_size = vol->mft_zone_end - vol->mft_zone_start; in ntfs_cluster_alloc()
693 (unsigned long long)vol->mft_zone_start, in ntfs_cluster_alloc()
694 (unsigned long long)vol->mft_zone_end, in ntfs_cluster_alloc()
703 zone_end = vol->mft_zone_end; in ntfs_cluster_alloc()
706 vol->mft_zone_end = vol->mft_zone_start + mft_zone_size; in ntfs_cluster_alloc()
708 vol->data2_zone_pos = vol->mft_zone_start = in ntfs_cluster_alloc()
709 vol->mft_zone_end = 0; in ntfs_cluster_alloc()
710 if (vol->mft_zone_pos >= vol->mft_zone_end) { in ntfs_cluster_alloc()
711 vol->mft_zone_pos = vol->mft_lcn; in ntfs_cluster_alloc()
712 if (!vol->mft_zone_end) in ntfs_cluster_alloc()
713 vol->mft_zone_pos = 0; in ntfs_cluster_alloc()
716 vol->data1_zone_pos = vol->mft_zone_end; in ntfs_cluster_alloc()
728 (unsigned long long)vol->mft_zone_start, in ntfs_cluster_alloc()
729 (unsigned long long)vol->mft_zone_end, in ntfs_cluster_alloc()
730 (unsigned long long)vol->mft_zone_pos, in ntfs_cluster_alloc()
733 (unsigned long long)vol->data1_zone_pos); in ntfs_cluster_alloc()
754 up_write(&vol->lcnbmp_lock); in ntfs_cluster_alloc()
758 ntfs_error(vol->sb, "Failed to allocate clusters, aborting " in ntfs_cluster_alloc()
772 err2 = ntfs_cluster_free_from_rl_nolock(vol, rl); in ntfs_cluster_alloc()
774 ntfs_error(vol->sb, "Failed to rollback (error %i). " in ntfs_cluster_alloc()
777 NVolSetErrors(vol); in ntfs_cluster_alloc()
784 (long long)vol->data1_zone_pos); in ntfs_cluster_alloc()
785 up_write(&vol->lcnbmp_lock); in ntfs_cluster_alloc()
853 ntfs_volume *vol; in __ntfs_cluster_free() local
863 vol = ni->vol; in __ntfs_cluster_free()
864 lcnbmp_vi = vol->lcnbmp_ino; in __ntfs_cluster_free()
876 down_write(&vol->lcnbmp_lock); in __ntfs_cluster_free()
883 ntfs_error(vol->sb, "Failed to find first runlist " in __ntfs_cluster_free()
891 ntfs_error(vol->sb, "First runlist element has " in __ntfs_cluster_free()
910 ntfs_error(vol->sb, "Failed to clear first run " in __ntfs_cluster_free()
938 ntfs_error(vol->sb, "Failed to map " in __ntfs_cluster_free()
947 ntfs_error(vol->sb, "Runlist element " in __ntfs_cluster_free()
967 ntfs_error(vol->sb, "Failed to clear " in __ntfs_cluster_free()
982 up_write(&vol->lcnbmp_lock); in __ntfs_cluster_free()
994 up_write(&vol->lcnbmp_lock); in __ntfs_cluster_free()
1004 ntfs_error(vol->sb, "Failed to rollback (error %i). Leaving " in __ntfs_cluster_free()
1007 NVolSetErrors(vol); in __ntfs_cluster_free()
1009 up_write(&vol->lcnbmp_lock); in __ntfs_cluster_free()
1010 ntfs_error(vol->sb, "Aborting (error %i).", err); in __ntfs_cluster_free()