Lines Matching refs:fs
96 int ext2_format(struct ext2_data *fs, struct ext2_cfg *cfg) in ext2_format() argument
105 uint32_t fs_memory = cfg->fs_size ? MIN(cfg->fs_size, fs->device_size) : fs->device_size; in ext2_format()
113 LOG_INF("[Memory] available:%lld requested:%d", fs->device_size, fs_memory); in ext2_format()
115 if (fs_memory > fs->device_size) { in ext2_format()
121 fs_memory -= CONFIG_EXT2_DISK_STARTING_SECTOR * fs->write_size; in ext2_format()
195 struct ext2_block *sb_block = ext2_get_block(fs, first_data_block); in ext2_format()
196 struct ext2_block *bg_block = ext2_get_block(fs, bg_block_num); in ext2_format()
197 struct ext2_block *bbitmap_block = ext2_get_block(fs, bbitmap_block_num); in ext2_format()
198 struct ext2_block *ibitmap_block = ext2_get_block(fs, ibitmap_block_num); in ext2_format()
254 if (ext2_write_block(fs, sb_block) < 0) { in ext2_format()
271 if (ext2_write_block(fs, bg_block) < 0) { in ext2_format()
282 if (ext2_write_block(fs, bbitmap_block) < 0) { in ext2_format()
292 if (ext2_write_block(fs, ibitmap_block) < 0) { in ext2_format()
300 struct ext2_block *blk = ext2_get_block(fs, itable_block_num + i); in ext2_format()
303 rc = ext2_write_block(fs, blk); in ext2_format()
315 itable_block1 = ext2_get_block(fs, itable_block_num); in ext2_format()
322 if (ext2_write_block(fs, itable_block1) < 0) { in ext2_format()
336 itable_block2 = ext2_get_block(fs, block_num); in ext2_format()
344 if (ext2_write_block(fs, itable_block2) < 0) { in ext2_format()
356 root_dir_blk = ext2_get_block(fs, root_dir_blk_num); in ext2_format()
391 if (ext2_write_block(fs, root_dir_blk) < 0) { in ext2_format()
398 lost_found_dir_blk = ext2_get_block(fs, lost_found_dir_blk_num); in ext2_format()
424 if (ext2_write_block(fs, lost_found_dir_blk) < 0) { in ext2_format()
437 if ((ret >= 0) && (fs->backend_ops->sync(fs)) < 0) { in ext2_format()