Lines Matching refs:superblock

474 static inline void lfs_superblock_fromle32(lfs_superblock_t *superblock) {
475 superblock->version = lfs_fromle32(superblock->version);
476 superblock->block_size = lfs_fromle32(superblock->block_size);
477 superblock->block_count = lfs_fromle32(superblock->block_count);
478 superblock->name_max = lfs_fromle32(superblock->name_max);
479 superblock->file_max = lfs_fromle32(superblock->file_max);
480 superblock->attr_max = lfs_fromle32(superblock->attr_max);
484 static inline void lfs_superblock_tole32(lfs_superblock_t *superblock) {
485 superblock->version = lfs_tole32(superblock->version);
486 superblock->block_size = lfs_tole32(superblock->block_size);
487 superblock->block_count = lfs_tole32(superblock->block_count);
488 superblock->name_max = lfs_tole32(superblock->name_max);
489 superblock->file_max = lfs_tole32(superblock->file_max);
490 superblock->attr_max = lfs_tole32(superblock->attr_max);
1913 // v1 superblock if we relocate root, and invalidating directory
2052 // can't relocate superblock, filesystem is now frozen
2147 // oh no! we're writing too much to the superblock,
2157 LFS_DEBUG("Expanding superblock at rev %"PRIu32, dir->rev);
2167 LFS_WARN("Unable to expand superblock");
2770 // skip superblock entry
4282 // write one superblock
4283 lfs_superblock_t superblock = {
4292 lfs_superblock_tole32(&superblock);
4296 {LFS_MKTAG(LFS_TYPE_INLINESTRUCT, 0, sizeof(superblock)),
4297 &superblock}));
4330 // scan directory blocks for superblock and any global updates
4362 // has superblock?
4368 // grab superblock
4369 lfs_superblock_t superblock;
4371 LFS_MKTAG(LFS_TYPE_INLINESTRUCT, 0, sizeof(superblock)),
4372 &superblock);
4377 lfs_superblock_fromle32(&superblock);
4380 uint16_t major_version = (0xffff & (superblock.version >> 16));
4381 uint16_t minor_version = (0xffff & (superblock.version >> 0));
4395 // gstate so we know we need to rewrite the superblock before
4409 // check superblock configuration
4410 if (superblock.name_max) {
4411 if (superblock.name_max > lfs->name_max) {
4413 superblock.name_max, lfs->name_max);
4418 lfs->name_max = superblock.name_max;
4421 if (superblock.file_max) {
4422 if (superblock.file_max > lfs->file_max) {
4424 superblock.file_max, lfs->file_max);
4429 lfs->file_max = superblock.file_max;
4432 if (superblock.attr_max) {
4433 if (superblock.attr_max > lfs->attr_max) {
4435 superblock.attr_max, lfs->attr_max);
4440 lfs->attr_max = superblock.attr_max;
4445 && superblock.block_count != lfs->cfg->block_count) {
4447 superblock.block_count, lfs->cfg->block_count);
4452 lfs->block_count = superblock.block_count;
4454 if (superblock.block_size != lfs->cfg->block_size) {
4456 superblock.block_size, lfs->cfg->block_size);
4498 // if the superblock is up-to-date, we must be on the most recent
4505 // fetch the superblock
4512 lfs_superblock_t superblock;
4514 LFS_MKTAG(LFS_TYPE_INLINESTRUCT, 0, sizeof(superblock)),
4515 &superblock);
4519 lfs_superblock_fromle32(&superblock);
4522 fsinfo->disk_version = superblock.version;
4780 LFS_DEBUG("Rewriting superblock {0x%"PRIx32", 0x%"PRIx32"}",
4790 // write a new superblock
4791 lfs_superblock_t superblock = {
4800 lfs_superblock_tole32(&superblock);
4802 {LFS_MKTAG(LFS_TYPE_INLINESTRUCT, 0, sizeof(superblock)),
4803 &superblock}));
5063 // update the superblock
5064 lfs_superblock_t superblock;
5066 LFS_MKTAG(LFS_TYPE_INLINESTRUCT, 0, sizeof(superblock)),
5067 &superblock);
5071 lfs_superblock_fromle32(&superblock);
5073 superblock.block_count = lfs->block_count;
5075 lfs_superblock_tole32(&superblock);
5077 {tag, &superblock}));
5404 // skip superblock
5459 // load superblock
5461 lfs1_superblock_t superblock;
5469 &superblock.d, sizeof(superblock.d));
5470 lfs1_superblock_fromle32(&superblock.d);
5475 lfs->lfs1->root[0] = superblock.d.root[0];
5476 lfs->lfs1->root[1] = superblock.d.root[1];
5479 if (err || memcmp(superblock.d.magic, "littlefs", 8) != 0) {
5480 LFS_ERROR("Invalid superblock at {0x%"PRIx32", 0x%"PRIx32"}",
5486 uint16_t major_version = (0xffff & (superblock.d.version >> 16));
5487 uint16_t minor_version = (0xffff & (superblock.d.version >> 0));
5680 // Create new superblock. This marks a successful migration!
5697 lfs_superblock_t superblock = {
5706 lfs_superblock_tole32(&superblock);
5710 {LFS_MKTAG(LFS_TYPE_INLINESTRUCT, 0, sizeof(superblock)),
5711 &superblock}));