• Home
  • Raw
  • Download

Lines Matching refs:rstr

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