Lines Matching refs:boot

854 static u32 true_sectors_per_clst(const struct NTFS_BOOT *boot)
856 if (boot->sectors_per_clusters <= 0x80)
857 return boot->sectors_per_clusters;
858 if (boot->sectors_per_clusters >= 0xf4) /* limit shift to 2MB max */
859 return 1U << (-(s8)boot->sectors_per_clusters);
864 * ntfs_init_from_boot - Init internal info from on-disk boot sector.
866 * NTFS mount begins from boot - special formatted 512 bytes.
868 * The content of boot is not changed during ntfs life.
870 * NOTE: ntfs.sys checks only first (primary) boot.
880 struct NTFS_BOOT *boot;
887 const char *hint = "Primary boot";
889 /* Save original dev_size. Used with alternative boot. */
902 if (bh->b_size - sizeof(*boot) < boot_off)
905 boot = (struct NTFS_BOOT *)Add2Ptr(bh->b_data, boot_off);
907 if (memcmp(boot->system_id, "NTFS ", sizeof("NTFS ") - 1)) {
913 /*if (0x55 != boot->boot_magic[0] || 0xAA != boot->boot_magic[1])
917 boot_sector_size = ((u32)boot->bytes_per_sector[1] << 8) |
918 boot->bytes_per_sector[0];
927 sct_per_clst = true_sectors_per_clst(boot);
939 mlcn = le64_to_cpu(boot->mft_clst);
940 mlcn2 = le64_to_cpu(boot->mft2_clst);
941 sectors = le64_to_cpu(boot->sectors_per_volume);
951 if (boot->record_size >= 0) {
952 record_size = (u32)boot->record_size << cluster_bits;
953 } else if (-boot->record_size <= MAXIMUM_SHIFT_BYTES_PER_MFT) {
954 record_size = 1u << (-boot->record_size);
957 boot->record_size);
968 record_size, boot->record_size);
978 if (boot->index_size >= 0) {
979 sbi->index_size = (u32)boot->index_size << cluster_bits;
980 } else if (-boot->index_size <= MAXIMUM_SHIFT_BYTES_PER_INDEX) {
981 sbi->index_size = 1u << (-boot->index_size);
984 boot->index_size);
991 sbi->index_size, boot->index_size);
1021 /* Compare boot's cluster and sector. */
1028 /* Compare boot's cluster and media sector. */
1043 sbi->volume.ser_num = le64_to_cpu(boot->serial_num);
1121 * Alternative boot is ok but primary is not ok.
1122 * Do not update primary boot here 'cause it may be faked boot.
1123 * Let ntfs to be mounted and update boot later.
1125 *boot2 = kmemdup(boot, sizeof(*boot), GFP_NOFS | __GFP_NOWARN);
1133 u64 lbo = dev_size0 - sizeof(*boot);
1137 if (boot_block && block_size >= boot_off + sizeof(*boot)) {
1139 * Try alternative boot (last sector)
1142 hint = "Alternative boot";
1200 /* Parse boot. */
1586 * Alternative boot is ok but primary is not ok.
1587 * Volume is recognized as NTFS. Update primary boot.
1600 ntfs_warn(sb, "primary boot is updated");