• Home
  • Raw
  • Download

Lines Matching refs:pfn_sb

217 		struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb;  in resource_show()  local
218 u64 offset = __le64_to_cpu(pfn_sb->dataoff); in resource_show()
220 u32 start_pad = __le32_to_cpu(pfn_sb->start_pad); in resource_show()
243 struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; in size_show() local
244 u64 offset = __le64_to_cpu(pfn_sb->dataoff); in size_show()
246 u32 start_pad = __le32_to_cpu(pfn_sb->start_pad); in size_show()
247 u32 end_trunc = __le32_to_cpu(pfn_sb->end_trunc); in size_show()
358 struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; in nd_pfn_validate() local
362 if (!pfn_sb || !ndns) in nd_pfn_validate()
368 if (nvdimm_read_bytes(ndns, SZ_4K, pfn_sb, sizeof(*pfn_sb))) in nd_pfn_validate()
371 if (memcmp(pfn_sb->signature, sig, PFN_SIG_LEN) != 0) in nd_pfn_validate()
374 checksum = le64_to_cpu(pfn_sb->checksum); in nd_pfn_validate()
375 pfn_sb->checksum = 0; in nd_pfn_validate()
376 if (checksum != nd_sb_checksum((struct nd_gen_sb *) pfn_sb)) in nd_pfn_validate()
378 pfn_sb->checksum = cpu_to_le64(checksum); in nd_pfn_validate()
380 if (memcmp(pfn_sb->parent_uuid, parent_uuid, 16) != 0) in nd_pfn_validate()
383 if (__le16_to_cpu(pfn_sb->version_minor) < 1) { in nd_pfn_validate()
384 pfn_sb->start_pad = 0; in nd_pfn_validate()
385 pfn_sb->end_trunc = 0; in nd_pfn_validate()
388 if (__le16_to_cpu(pfn_sb->version_minor) < 2) in nd_pfn_validate()
389 pfn_sb->align = 0; in nd_pfn_validate()
391 switch (le32_to_cpu(pfn_sb->mode)) { in nd_pfn_validate()
399 align = le32_to_cpu(pfn_sb->align); in nd_pfn_validate()
400 offset = le64_to_cpu(pfn_sb->dataoff); in nd_pfn_validate()
401 start_pad = le32_to_cpu(pfn_sb->start_pad); in nd_pfn_validate()
404 mode = le32_to_cpu(pfn_sb->mode); in nd_pfn_validate()
412 nd_pfn->uuid = kmemdup(pfn_sb->uuid, 16, GFP_KERNEL); in nd_pfn_validate()
422 if (memcmp(nd_pfn->uuid, pfn_sb->uuid, 16) != 0) in nd_pfn_validate()
477 struct nd_pfn_sb *pfn_sb; in nd_pfn_probe() local
489 pfn_sb = devm_kzalloc(dev, sizeof(*pfn_sb), GFP_KERNEL); in nd_pfn_probe()
491 nd_pfn->pfn_sb = pfn_sb; in nd_pfn_probe()
528 struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; in __nvdimm_setup_pfn() local
529 u64 offset = le64_to_cpu(pfn_sb->dataoff); in __nvdimm_setup_pfn()
530 u32 start_pad = __le32_to_cpu(pfn_sb->start_pad); in __nvdimm_setup_pfn()
531 u32 end_trunc = __le32_to_cpu(pfn_sb->end_trunc); in __nvdimm_setup_pfn()
547 nd_pfn->npfns = le64_to_cpu(pfn_sb->npfns); in __nvdimm_setup_pfn()
552 if (le64_to_cpu(nd_pfn->pfn_sb->npfns) > nd_pfn->npfns) in __nvdimm_setup_pfn()
555 le64_to_cpu(nd_pfn->pfn_sb->npfns), in __nvdimm_setup_pfn()
580 struct nd_pfn_sb *pfn_sb; in nd_pfn_init() local
587 pfn_sb = devm_kzalloc(&nd_pfn->dev, sizeof(*pfn_sb), GFP_KERNEL); in nd_pfn_init()
588 if (!pfn_sb) in nd_pfn_init()
591 nd_pfn->pfn_sb = pfn_sb; in nd_pfn_init()
609 memset(pfn_sb, 0, sizeof(*pfn_sb)); in nd_pfn_init()
669 pfn_sb->mode = cpu_to_le32(nd_pfn->mode); in nd_pfn_init()
670 pfn_sb->dataoff = cpu_to_le64(offset); in nd_pfn_init()
671 pfn_sb->npfns = cpu_to_le64(npfns); in nd_pfn_init()
672 memcpy(pfn_sb->signature, sig, PFN_SIG_LEN); in nd_pfn_init()
673 memcpy(pfn_sb->uuid, nd_pfn->uuid, 16); in nd_pfn_init()
674 memcpy(pfn_sb->parent_uuid, nd_dev_to_uuid(&ndns->dev), 16); in nd_pfn_init()
675 pfn_sb->version_major = cpu_to_le16(1); in nd_pfn_init()
676 pfn_sb->version_minor = cpu_to_le16(2); in nd_pfn_init()
677 pfn_sb->start_pad = cpu_to_le32(start_pad); in nd_pfn_init()
678 pfn_sb->end_trunc = cpu_to_le32(end_trunc); in nd_pfn_init()
679 pfn_sb->align = cpu_to_le32(nd_pfn->align); in nd_pfn_init()
680 checksum = nd_sb_checksum((struct nd_gen_sb *) pfn_sb); in nd_pfn_init()
681 pfn_sb->checksum = cpu_to_le64(checksum); in nd_pfn_init()
683 return nvdimm_write_bytes(ndns, SZ_4K, pfn_sb, sizeof(*pfn_sb)); in nd_pfn_init()