gustavonihei commented on a change in pull request #4333:
URL: https://github.com/apache/incubator-nuttx/pull/4333#discussion_r687753662
##########
File path: fs/driver/fs_blockpartition.c
##########
@@ -214,40 +215,58 @@ static int part_ioctl(FAR struct inode *inode, int cmd,
unsigned long arg)
FAR struct inode *parent = dev->parent;
int ret = -ENOTTY;
- if (parent->u.i_bops->ioctl)
+ switch (cmd)
{
- if (cmd == MTDIOC_PROTECT || cmd == MTDIOC_UNPROTECT)
+ case BIOC_PARTINFO:
{
- FAR struct mtd_protect_s *prot =
- (FAR struct mtd_protect_s *)ptr_arg;
-
- prot->startblock += dev->firstsector;
- }
-
- ret = parent->u.i_bops->ioctl(parent, cmd, arg);
- if (ret >= 0)
- {
- if (cmd == BIOC_XIPBASE)
+ FAR struct partition_info_s *info =
+ (FAR struct partition_info_s *)ptr_arg;
+ if (info != NULL)
{
- FAR void **base = (FAR void **)ptr_arg;
- struct geometry geo;
-
- ret = parent->u.i_bops->geometry(parent, &geo);
- if (ret >= 0)
- {
- *(FAR uint8_t *)base +=
- dev->firstsector * geo.geo_sectorsize;
- }
- }
- else if (cmd == MTDIOC_GEOMETRY)
- {
- FAR struct mtd_geometry_s *mgeo =
- (FAR struct mtd_geometry_s *)ptr_arg;
- uint32_t blkper = mgeo->erasesize / mgeo->blocksize;
+ info->magic = 0;
+ info->numsectors = dev->nsectors;
+ info->sectorsize = dev->sectorsize;
+ info->startsector = dev->firstsector;
+
+ strncpy(info->parent, dev->parent->name, NAME_MAX);
Review comment:
```suggestion
strncpy(info->parent, dev->parent->i_name, NAME_MAX);
```
CI build is failing for this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]