Lines Matching defs:boot
970 static u32 true_sectors_per_clst(const struct NTFS_BOOT *boot)
972 if (boot->sectors_per_clusters <= 0x80)
973 return boot->sectors_per_clusters;
974 if (boot->sectors_per_clusters >= 0xf4) /* limit shift to 2MB max */
975 return 1U << (-(s8)boot->sectors_per_clusters);
980 * ntfs_init_from_boot - Init internal info from on-disk boot sector.
982 * NTFS mount begins from boot - special formatted 512 bytes.
984 * The content of boot is not changed during ntfs life.
986 * NOTE: ntfs.sys checks only first (primary) boot.
996 struct NTFS_BOOT *boot;
1003 const char *hint = "Primary boot";
1005 /* Save original dev_size. Used with alternative boot. */
1023 if (bh->b_size - sizeof(*boot) < boot_off)
1026 boot = (struct NTFS_BOOT *)Add2Ptr(bh->b_data, boot_off);
1028 if (memcmp(boot->system_id, "NTFS ", sizeof("NTFS ") - 1)) {
1034 /*if (0x55 != boot->boot_magic[0] || 0xAA != boot->boot_magic[1])
1038 boot_sector_size = ((u32)boot->bytes_per_sector[1] << 8) |
1039 boot->bytes_per_sector[0];
1048 sct_per_clst = true_sectors_per_clst(boot);
1060 mlcn = le64_to_cpu(boot->mft_clst);
1061 mlcn2 = le64_to_cpu(boot->mft2_clst);
1062 sectors = le64_to_cpu(boot->sectors_per_volume);
1066 * 'sectors'. All three are u64 values that come from the boot
1080 if (boot->record_size >= 0) {
1081 record_size = (u32)boot->record_size << cluster_bits;
1082 } else if (-boot->record_size <= MAXIMUM_SHIFT_BYTES_PER_MFT) {
1083 record_size = 1u << (-boot->record_size);
1086 boot->record_size);
1097 record_size, boot->record_size);
1107 if (boot->index_size >= 0) {
1108 sbi->index_size = (u32)boot->index_size << cluster_bits;
1109 } else if (-boot->index_size <= MAXIMUM_SHIFT_BYTES_PER_INDEX) {
1110 sbi->index_size = 1u << (-boot->index_size);
1113 boot->index_size);
1120 sbi->index_size, boot->index_size);
1151 /* Compare boot's cluster and sector. */
1158 /* Compare boot's cluster and media sector. */
1173 sbi->volume.ser_num = le64_to_cpu(boot->serial_num);
1254 * Alternative boot is ok but primary is not ok.
1255 * Do not update primary boot here 'cause it may be faked boot.
1256 * Let ntfs to be mounted and update boot later.
1258 *boot2 = kmemdup(boot, sizeof(*boot), GFP_NOFS | __GFP_NOWARN);
1266 u64 lbo = dev_size0 - sizeof(*boot);
1270 if (boot_block && block_size >= boot_off + sizeof(*boot)) {
1272 * Try alternative boot (last sector)
1276 hint = "Alternative boot";
1350 /* Parse boot. */
1760 * Alternative boot is ok but primary is not ok.
1761 * Volume is recognized as NTFS. Update primary boot.
1772 ntfs_warn(sb, "primary boot is updated");