Lines Matching refs:out
42 void bch2_version_to_text(struct printbuf *out, enum bcachefs_metadata_version v) in bch2_version_to_text() argument
52 prt_printf(out, "%u.%u: %s", BCH_VERSION_MAJOR(v), BCH_VERSION_MINOR(v), str); in bch2_version_to_text()
84 goto out; in bch2_set_version_incompat()
98 out: in bch2_set_version_incompat()
294 static int validate_sb_layout(struct bch_sb_layout *layout, struct printbuf *out) in validate_sb_layout() argument
303 prt_printf(out, "Not a bcachefs superblock layout"); in validate_sb_layout()
308 prt_printf(out, "Invalid superblock layout type %u", in validate_sb_layout()
314 prt_printf(out, "Invalid superblock layout: no superblocks"); in validate_sb_layout()
319 prt_printf(out, "Invalid superblock layout: too many superblocks"); in validate_sb_layout()
324 prt_printf(out, "Invalid superblock layout: max_size_bits too high"); in validate_sb_layout()
336 prt_printf(out, "Invalid superblock layout: superblocks overlap\n" in validate_sb_layout()
347 static int bch2_sb_compatible(struct bch_sb *sb, struct printbuf *out) in bch2_sb_compatible() argument
353 prt_str(out, "Unsupported superblock version "); in bch2_sb_compatible()
354 bch2_version_to_text(out, version); in bch2_sb_compatible()
355 prt_str(out, " (min "); in bch2_sb_compatible()
356 bch2_version_to_text(out, bcachefs_metadata_version_min); in bch2_sb_compatible()
357 prt_str(out, ", max "); in bch2_sb_compatible()
358 bch2_version_to_text(out, bcachefs_metadata_version_current); in bch2_sb_compatible()
359 prt_str(out, ")"); in bch2_sb_compatible()
364 prt_str(out, "Unsupported superblock version_min "); in bch2_sb_compatible()
365 bch2_version_to_text(out, version_min); in bch2_sb_compatible()
366 prt_str(out, " (min "); in bch2_sb_compatible()
367 bch2_version_to_text(out, bcachefs_metadata_version_min); in bch2_sb_compatible()
368 prt_str(out, ", max "); in bch2_sb_compatible()
369 bch2_version_to_text(out, bcachefs_metadata_version_current); in bch2_sb_compatible()
370 prt_str(out, ")"); in bch2_sb_compatible()
375 prt_str(out, "Bad minimum version "); in bch2_sb_compatible()
376 bch2_version_to_text(out, version_min); in bch2_sb_compatible()
377 prt_str(out, ", greater than version field "); in bch2_sb_compatible()
378 bch2_version_to_text(out, version); in bch2_sb_compatible()
386 enum bch_validate_flags flags, struct printbuf *out) in bch2_sb_validate() argument
391 ret = bch2_sb_compatible(sb, out); in bch2_sb_validate()
403 prt_printf(out, "Filesystem has incompatible feature bit %u, highest supported %s (%u)", in bch2_sb_validate()
412 prt_str(out, "Filesystem has incompatible version "); in bch2_sb_validate()
413 bch2_version_to_text(out, le16_to_cpu(sb->version)); in bch2_sb_validate()
414 prt_str(out, ", current version "); in bch2_sb_validate()
415 bch2_version_to_text(out, bcachefs_metadata_version_current); in bch2_sb_validate()
420 prt_printf(out, "Bad user UUID (got zeroes)"); in bch2_sb_validate()
425 prt_printf(out, "Bad internal UUID (got zeroes)"); in bch2_sb_validate()
431 prt_printf(out, "Bad sb offset (got %llu, read from %llu)", in bch2_sb_validate()
438 prt_printf(out, "Bad number of member devices %u (max %u)", in bch2_sb_validate()
444 prt_printf(out, "Bad dev_idx (got %u, nr_devices %u)", in bch2_sb_validate()
451 prt_printf(out, "Invalid time precision: %u (min 1, max %lu)", in bch2_sb_validate()
461 prt_printf(out, "Invalid version_incompat "); in bch2_sb_validate()
462 bch2_version_to_text(out, BCH_SB_VERSION_INCOMPAT(sb)); in bch2_sb_validate()
463 prt_str(out, " > incompat_allowed "); in bch2_sb_validate()
464 bch2_version_to_text(out, BCH_SB_VERSION_INCOMPAT_ALLOWED(sb)); in bch2_sb_validate()
514 prt_printf(out, "Invalid option "); in bch2_sb_validate()
515 ret = bch2_opt_validate(opt, v, out); in bch2_sb_validate()
519 printbuf_reset(out); in bch2_sb_validate()
524 ret = validate_sb_layout(&sb->layout, out); in bch2_sb_validate()
530 prt_printf(out, "Invalid superblock: optional field with size 0 (type %u)", in bch2_sb_validate()
536 prt_printf(out, "Invalid superblock: optional field extends past end of superblock (type %u)", in bch2_sb_validate()
548 prt_printf(out, "Invalid superblock: member info area missing"); in bch2_sb_validate()
552 ret = bch2_sb_field_validate(sb, mi, flags, out); in bch2_sb_validate()
560 ret = bch2_sb_field_validate(sb, f, flags, out); in bch2_sb_validate()
567 prt_printf(out, "Invalid superblock: member seq %llu != sb seq %llu", in bch2_sb_validate()
931 out: in __bch2_read_super()
939 goto out; in __bch2_read_super()
1054 goto out; in bch2_write_super()
1092 goto out; in bch2_write_super()
1097 goto out; in bch2_write_super()
1104 goto out; in bch2_write_super()
1116 goto out; in bch2_write_super()
1169 goto out; in bch2_write_super()
1219 out: in bch2_write_super()
1319 static void bch2_sb_ext_to_text(struct printbuf *out, struct bch_sb *sb, in bch2_sb_ext_to_text() argument
1324 prt_printf(out, "Recovery passes required:\t"); in bch2_sb_ext_to_text()
1325 prt_bitflags(out, bch2_recovery_passes, in bch2_sb_ext_to_text()
1327 prt_newline(out); in bch2_sb_ext_to_text()
1333 prt_printf(out, "Errors to silently fix:\t"); in bch2_sb_ext_to_text()
1334 prt_bitflags_vector(out, bch2_sb_error_strs, errors_silent, in bch2_sb_ext_to_text()
1336 prt_newline(out); in bch2_sb_ext_to_text()
1341 prt_printf(out, "Btrees with missing data:\t"); in bch2_sb_ext_to_text()
1342 prt_bitflags(out, __bch2_btree_ids, le64_to_cpu(e->btrees_lost_data)); in bch2_sb_ext_to_text()
1343 prt_newline(out); in bch2_sb_ext_to_text()
1387 void __bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb, in __bch2_sb_field_to_text() argument
1393 if (!out->nr_tabstops) in __bch2_sb_field_to_text()
1394 printbuf_tabstop_push(out, 32); in __bch2_sb_field_to_text()
1397 ops->to_text(out, sb, f); in __bch2_sb_field_to_text()
1400 void bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb, in bch2_sb_field_to_text() argument
1406 prt_printf(out, "%s", bch2_sb_fields[type]); in bch2_sb_field_to_text()
1408 prt_printf(out, "(unknown field %u)", type); in bch2_sb_field_to_text()
1410 prt_printf(out, " (size %zu):", vstruct_bytes(f)); in bch2_sb_field_to_text()
1411 prt_newline(out); in bch2_sb_field_to_text()
1413 __bch2_sb_field_to_text(out, sb, f); in bch2_sb_field_to_text()
1416 void bch2_sb_layout_to_text(struct printbuf *out, struct bch_sb_layout *l) in bch2_sb_layout_to_text() argument
1420 prt_printf(out, "Type: %u", l->layout_type); in bch2_sb_layout_to_text()
1421 prt_newline(out); in bch2_sb_layout_to_text()
1423 prt_str(out, "Superblock max size: "); in bch2_sb_layout_to_text()
1424 prt_units_u64(out, 512 << l->sb_max_size_bits); in bch2_sb_layout_to_text()
1425 prt_newline(out); in bch2_sb_layout_to_text()
1427 prt_printf(out, "Nr superblocks: %u", l->nr_superblocks); in bch2_sb_layout_to_text()
1428 prt_newline(out); in bch2_sb_layout_to_text()
1430 prt_str(out, "Offsets: "); in bch2_sb_layout_to_text()
1433 prt_str(out, ", "); in bch2_sb_layout_to_text()
1434 prt_printf(out, "%llu", le64_to_cpu(l->sb_offset[i])); in bch2_sb_layout_to_text()
1436 prt_newline(out); in bch2_sb_layout_to_text()
1439 void bch2_sb_to_text(struct printbuf *out, struct bch_sb *sb, in bch2_sb_to_text() argument
1442 if (!out->nr_tabstops) in bch2_sb_to_text()
1443 printbuf_tabstop_push(out, 44); in bch2_sb_to_text()
1445 prt_printf(out, "External UUID:\t"); in bch2_sb_to_text()
1446 pr_uuid(out, sb->user_uuid.b); in bch2_sb_to_text()
1447 prt_newline(out); in bch2_sb_to_text()
1449 prt_printf(out, "Internal UUID:\t"); in bch2_sb_to_text()
1450 pr_uuid(out, sb->uuid.b); in bch2_sb_to_text()
1451 prt_newline(out); in bch2_sb_to_text()
1453 prt_printf(out, "Magic number:\t"); in bch2_sb_to_text()
1454 pr_uuid(out, sb->magic.b); in bch2_sb_to_text()
1455 prt_newline(out); in bch2_sb_to_text()
1457 prt_printf(out, "Device index:\t%u\n", sb->dev_idx); in bch2_sb_to_text()
1459 prt_printf(out, "Label:\t"); in bch2_sb_to_text()
1461 prt_printf(out, "(none)"); in bch2_sb_to_text()
1463 prt_printf(out, "%.*s", (int) sizeof(sb->label), sb->label); in bch2_sb_to_text()
1464 prt_newline(out); in bch2_sb_to_text()
1466 prt_printf(out, "Version:\t"); in bch2_sb_to_text()
1467 bch2_version_to_text(out, le16_to_cpu(sb->version)); in bch2_sb_to_text()
1468 prt_newline(out); in bch2_sb_to_text()
1470 prt_printf(out, "Incompatible features allowed:\t"); in bch2_sb_to_text()
1471 bch2_version_to_text(out, BCH_SB_VERSION_INCOMPAT_ALLOWED(sb)); in bch2_sb_to_text()
1472 prt_newline(out); in bch2_sb_to_text()
1474 prt_printf(out, "Incompatible features in use:\t"); in bch2_sb_to_text()
1475 bch2_version_to_text(out, BCH_SB_VERSION_INCOMPAT(sb)); in bch2_sb_to_text()
1476 prt_newline(out); in bch2_sb_to_text()
1478 prt_printf(out, "Version upgrade complete:\t"); in bch2_sb_to_text()
1479 bch2_version_to_text(out, BCH_SB_VERSION_UPGRADE_COMPLETE(sb)); in bch2_sb_to_text()
1480 prt_newline(out); in bch2_sb_to_text()
1482 prt_printf(out, "Oldest version on disk:\t"); in bch2_sb_to_text()
1483 bch2_version_to_text(out, le16_to_cpu(sb->version_min)); in bch2_sb_to_text()
1484 prt_newline(out); in bch2_sb_to_text()
1486 prt_printf(out, "Created:\t"); in bch2_sb_to_text()
1488 bch2_prt_datetime(out, div_u64(le64_to_cpu(sb->time_base_lo), NSEC_PER_SEC)); in bch2_sb_to_text()
1490 prt_printf(out, "(not set)"); in bch2_sb_to_text()
1491 prt_newline(out); in bch2_sb_to_text()
1493 prt_printf(out, "Sequence number:\t"); in bch2_sb_to_text()
1494 prt_printf(out, "%llu", le64_to_cpu(sb->seq)); in bch2_sb_to_text()
1495 prt_newline(out); in bch2_sb_to_text()
1497 prt_printf(out, "Time of last write:\t"); in bch2_sb_to_text()
1498 bch2_prt_datetime(out, le64_to_cpu(sb->write_time)); in bch2_sb_to_text()
1499 prt_newline(out); in bch2_sb_to_text()
1501 prt_printf(out, "Superblock size:\t"); in bch2_sb_to_text()
1502 prt_units_u64(out, vstruct_bytes(sb)); in bch2_sb_to_text()
1503 prt_str(out, "/"); in bch2_sb_to_text()
1504 prt_units_u64(out, 512ULL << sb->layout.sb_max_size_bits); in bch2_sb_to_text()
1505 prt_newline(out); in bch2_sb_to_text()
1507 prt_printf(out, "Clean:\t%llu\n", BCH_SB_CLEAN(sb)); in bch2_sb_to_text()
1508 prt_printf(out, "Devices:\t%u\n", bch2_sb_nr_devices(sb)); in bch2_sb_to_text()
1510 prt_printf(out, "Sections:\t"); in bch2_sb_to_text()
1514 prt_bitflags(out, bch2_sb_fields, fields_have); in bch2_sb_to_text()
1515 prt_newline(out); in bch2_sb_to_text()
1517 prt_printf(out, "Features:\t"); in bch2_sb_to_text()
1518 prt_bitflags(out, bch2_sb_features, le64_to_cpu(sb->features[0])); in bch2_sb_to_text()
1519 prt_newline(out); in bch2_sb_to_text()
1521 prt_printf(out, "Compat features:\t"); in bch2_sb_to_text()
1522 prt_bitflags(out, bch2_sb_compat, le64_to_cpu(sb->compat[0])); in bch2_sb_to_text()
1523 prt_newline(out); in bch2_sb_to_text()
1525 prt_newline(out); in bch2_sb_to_text()
1526 prt_printf(out, "Options:"); in bch2_sb_to_text()
1527 prt_newline(out); in bch2_sb_to_text()
1528 printbuf_indent_add(out, 2); in bch2_sb_to_text()
1538 prt_printf(out, "%s:\t", opt->attr.name); in bch2_sb_to_text()
1539 bch2_opt_to_text(out, NULL, sb, opt, v, in bch2_sb_to_text()
1541 prt_newline(out); in bch2_sb_to_text()
1546 printbuf_indent_sub(out, 2); in bch2_sb_to_text()
1549 prt_newline(out); in bch2_sb_to_text()
1550 prt_printf(out, "layout:"); in bch2_sb_to_text()
1551 prt_newline(out); in bch2_sb_to_text()
1552 printbuf_indent_add(out, 2); in bch2_sb_to_text()
1553 bch2_sb_layout_to_text(out, &sb->layout); in bch2_sb_to_text()
1554 printbuf_indent_sub(out, 2); in bch2_sb_to_text()
1559 prt_newline(out); in bch2_sb_to_text()
1560 bch2_sb_field_to_text(out, sb, f); in bch2_sb_to_text()