Lines Matching refs:boot
848 static u32 true_sectors_per_clst(const struct NTFS_BOOT *boot)
850 if (boot->sectors_per_clusters <= 0x80)
851 return boot->sectors_per_clusters;
852 if (boot->sectors_per_clusters >= 0xf4) /* limit shift to 2MB max */
853 return 1U << (-(s8)boot->sectors_per_clusters);
858 * ntfs_init_from_boot - Init internal info from on-disk boot sector.
860 * NTFS mount begins from boot - special formatted 512 bytes.
862 * The content of boot is not changed during ntfs life.
864 * NOTE: ntfs.sys checks only first (primary) boot.
874 struct NTFS_BOOT *boot;
881 const char *hint = "Primary boot";
883 /* Save original dev_size. Used with alternative boot. */
896 if (bh->b_size - sizeof(*boot) < boot_off)
899 boot = (struct NTFS_BOOT *)Add2Ptr(bh->b_data, boot_off);
901 if (memcmp(boot->system_id, "NTFS ", sizeof("NTFS ") - 1)) {
907 /*if (0x55 != boot->boot_magic[0] || 0xAA != boot->boot_magic[1])
911 boot_sector_size = ((u32)boot->bytes_per_sector[1] << 8) |
912 boot->bytes_per_sector[0];
921 sct_per_clst = true_sectors_per_clst(boot);
933 mlcn = le64_to_cpu(boot->mft_clst);
934 mlcn2 = le64_to_cpu(boot->mft2_clst);
935 sectors = le64_to_cpu(boot->sectors_per_volume);
945 if (boot->record_size >= 0) {
946 record_size = (u32)boot->record_size << cluster_bits;
947 } else if (-boot->record_size <= MAXIMUM_SHIFT_BYTES_PER_MFT) {
948 record_size = 1u << (-boot->record_size);
951 boot->record_size);
962 record_size, boot->record_size);
972 if (boot->index_size >= 0) {
973 sbi->index_size = (u32)boot->index_size << cluster_bits;
974 } else if (-boot->index_size <= MAXIMUM_SHIFT_BYTES_PER_INDEX) {
975 sbi->index_size = 1u << (-boot->index_size);
978 boot->index_size);
985 sbi->index_size, boot->index_size);
1015 /* Compare boot's cluster and sector. */
1022 /* Compare boot's cluster and media sector. */
1037 sbi->volume.ser_num = le64_to_cpu(boot->serial_num);
1115 * Alternative boot is ok but primary is not ok.
1116 * Do not update primary boot here 'cause it may be faked boot.
1117 * Let ntfs to be mounted and update boot later.
1119 *boot2 = kmemdup(boot, sizeof(*boot), GFP_NOFS | __GFP_NOWARN);
1127 u64 lbo = dev_size0 - sizeof(*boot);
1131 if (boot_block && block_size >= boot_off + sizeof(*boot)) {
1133 * Try alternative boot (last sector)
1136 hint = "Alternative boot";
1194 /* Parse boot. */
1580 * Alternative boot is ok but primary is not ok.
1581 * Volume is recognized as NTFS. Update primary boot.
1594 ntfs_warn(sb, "primary boot is updated");