Lines Matching refs:rstr
285 static void restart_header_sanity(RESTART_PAGE_HEADER *rstr, u8 *buf)
290 if (!ntfs_is_chkd_record(rstr->magic) &&
291 sle64_to_cpu(rstr->chkdsk_lsn))
296 page_size = le32_to_cpu(rstr->log_page_size);
301 if (page_size != le32_to_cpu(rstr->system_page_size)) {
302 page_size = le32_to_cpu(rstr->system_page_size);
309 if (sle16_to_cpu(rstr->major_ver) != 1 ||
310 sle16_to_cpu(rstr->minor_ver) != 1)
313 sle16_to_cpu(rstr->major_ver),
314 sle16_to_cpu(rstr->minor_ver));
316 usa_end_ofs = le16_to_cpu(rstr->usa_ofs) +
317 le16_to_cpu(rstr->usa_count) * sizeof(u16);
318 if (page_size / NTFS_BLOCK_SIZE + 1 != le16_to_cpu(rstr->usa_count))
322 if (le16_to_cpu(rstr->usa_ofs) < offsetof(RESTART_PAGE_HEADER, usn))
332 if (usa_end_ofs > le16_to_cpu(rstr->restart_area_offset))
338 if (le16_to_cpu(rstr->restart_area_offset) & 7)
348 static void dump_restart_areas_header(RESTART_PAGE_HEADER *rstr)
351 ntfs_log_info("magic = %s\n", ntfs_is_rstr_record(rstr->magic) ? "RSTR" :
353 ntfs_log_info("usa_ofs = %u (0x%x)\n", le16_to_cpu(rstr->usa_ofs),
354 le16_to_cpu(rstr->usa_ofs));
355 ntfs_log_info("usa_count = %u (0x%x)\n", le16_to_cpu(rstr->usa_count),
356 le16_to_cpu(rstr->usa_count));
358 (long long)sle64_to_cpu(rstr->chkdsk_lsn),
359 (unsigned long long)sle64_to_cpu(rstr->chkdsk_lsn));
361 (unsigned int)le32_to_cpu(rstr->system_page_size),
362 (unsigned int)le32_to_cpu(rstr->system_page_size));
364 (unsigned int)le32_to_cpu(rstr->log_page_size),
365 (unsigned int)le32_to_cpu(rstr->log_page_size));
367 le16_to_cpu(rstr->restart_area_offset),
368 le16_to_cpu(rstr->restart_area_offset));
374 static void dump_restart_areas_area(RESTART_PAGE_HEADER *rstr)
380 ra = (RESTART_AREA*)((u8*)rstr +
381 le16_to_cpu(rstr->restart_area_offset));
466 static void *dump_restart_areas(RESTART_PAGE_HEADER *rstr, u8 *buf,
472 if (ntfs_is_chkd_record(rstr->magic))
476 "this.\n", (u8*)rstr == buf ? "first" :
478 if (ntfs_mst_post_read_fixup((NTFS_RECORD*)rstr, page_size) ||
479 ntfs_is_baad_record(rstr->magic))
485 sle16_to_cpu(rstr->major_ver),
486 sle16_to_cpu(rstr->minor_ver));
491 * rstr is now the second restart page so we declare rstr1
500 if (!memcmp(rstr1, rstr, le16_to_cpu(rstr1->usa_ofs)) &&
502 rstr1->restart_area_offset), (u8*)rstr +
503 le16_to_cpu(rstr->restart_area_offset),
514 if (rstr1->major_ver != rstr->major_ver ||
515 rstr1->minor_ver != rstr->minor_ver)
521 /* The restart page header is in rstr and it is mst deprotected. */
523 dump_restart_areas_header(rstr);
526 dump_restart_areas_area(rstr);
530 rstr = (RESTART_PAGE_HEADER*)((u8*)rstr + page_size);
535 return rstr;
662 RESTART_PAGE_HEADER *rstr;
726 rstr = (RESTART_PAGE_HEADER*)buf;
729 if (!ntfs_is_rstr_record(rstr->magic) &&
730 !ntfs_is_chkd_record(rstr->magic)) {
748 restart_header_sanity(rstr, buf);
749 page_size = le32_to_cpu(rstr->log_page_size);
767 rcrd = (RECORD_PAGE_HEADER*)dump_restart_areas(rstr, buf, page_size);