fs: Add model field to geometry and mtd_geometry_s

the model is very to track the device info

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-08-11 12:21:39 +08:00
committed by zhouliang3
parent 960ca404b7
commit c906f1d482
3 changed files with 10 additions and 0 deletions
+2
View File
@@ -478,6 +478,8 @@ static int ftl_geometry(FAR struct inode *inode,
geometry->geo_nsectors = dev->geo.neraseblocks * dev->blkper;
geometry->geo_sectorsize = dev->geo.blocksize;
strcpy(geometry->geo_model, dev->geo.model);
finfo("available: true mediachanged: false writeenabled: %s\n",
geometry->geo_writeenabled ? "true" : "false");
finfo("nsectors: %" PRIuOFF " sectorsize: %u\n",
+4
View File
@@ -222,6 +222,10 @@ struct geometry
bool geo_writeenabled; /* true: It is okay to write to this device */
blkcnt_t geo_nsectors; /* Number of sectors on the device */
blksize_t geo_sectorsize; /* Size of one sector */
/* NULL-terminated string representing the device model */
char geo_model[NAME_MAX + 1];
};
struct partition_info_s
+4
View File
@@ -110,6 +110,10 @@ struct mtd_geometry_s
uint32_t erasesize; /* Size of one erase blocks -- must be a multiple
* of blocksize. */
uint32_t neraseblocks; /* Number of erase blocks */
/* NULL-terminated string representing the device model */
char model[NAME_MAX + 1];
};
/* This structure describes a range of sectors to be protected or