| 448 | } |
| 449 | |
| 450 | void Inode::dump(Formatter *f) const |
| 451 | { |
| 452 | f->dump_stream("ino") << ino; |
| 453 | f->dump_stream("snapid") << snapid; |
| 454 | if (rdev) |
| 455 | f->dump_unsigned("rdev", rdev); |
| 456 | f->dump_stream("ctime") << ctime; |
| 457 | f->dump_stream("btime") << btime; |
| 458 | f->dump_stream("mode") << '0' << std::oct << mode << std::dec; |
| 459 | f->dump_unsigned("uid", uid); |
| 460 | f->dump_unsigned("gid", gid); |
| 461 | f->dump_int("nlink", nlink); |
| 462 | |
| 463 | f->dump_unsigned("size", size); |
| 464 | f->dump_unsigned("max_size", max_size); |
| 465 | f->dump_unsigned("truncate_seq", truncate_seq); |
| 466 | f->dump_unsigned("truncate_size", truncate_size); |
| 467 | f->dump_stream("mtime") << mtime; |
| 468 | f->dump_stream("atime") << atime; |
| 469 | f->dump_unsigned("time_warp_seq", time_warp_seq); |
| 470 | f->dump_unsigned("change_attr", change_attr); |
| 471 | |
| 472 | f->dump_object("layout", layout); |
| 473 | if (is_dir()) { |
| 474 | f->open_object_section("dir_layout"); |
| 475 | ::dump(dir_layout, f); |
| 476 | f->close_section(); |
| 477 | |
| 478 | f->dump_bool("complete", flags & I_COMPLETE); |
| 479 | f->dump_bool("ordered", flags & I_DIR_ORDERED); |
| 480 | |
| 481 | /* FIXME when wip-mds-encoding is merged *** |
| 482 | f->open_object_section("dir_stat"); |
| 483 | dirstat.dump(f); |
| 484 | f->close_section(); |
| 485 | |
| 486 | f->open_object_section("rstat"); |
| 487 | rstat.dump(f); |
| 488 | f->close_section(); |
| 489 | */ |
| 490 | } |
| 491 | |
| 492 | f->dump_unsigned("version", version); |
| 493 | f->dump_unsigned("xattr_version", xattr_version); |
| 494 | f->dump_unsigned("flags", flags); |
| 495 | |
| 496 | if (is_dir()) { |
| 497 | f->dump_int("dir_hashed", (int)dir_hashed); |
| 498 | f->dump_int("dir_replicated", (int)dir_replicated); |
| 499 | if (dir_replicated) { |
| 500 | f->open_array_section("dirfrags"); |
| 501 | for (const auto &frag : frag_repmap) { |
| 502 | f->open_object_section("frags"); |
| 503 | CachedStackStringStream css; |
| 504 | *css << std::hex << frag.first.value() << "/" << std::dec << frag.first.bits(); |
| 505 | f->dump_string("frag", css->strv()); |
| 506 | |
| 507 | f->open_array_section("repmap"); |
nothing calls this directly
no test coverage detected