xiaoxiang781216 commented on pull request #4333:
URL: https://github.com/apache/incubator-nuttx/pull/4333#issuecomment-897848102


   > > @gustavonihei I have several questions about BIOC_PARTINFO and 
MTDIOC_GEOMETRY(block_operations::geometry):
   > > 
   > > 1. Should the real block or mtd device implement BIOC_PARTINFO too?
   > 
   > I also had this question in my mind. If we consider an unpartitioned 
MTD/Block as one big partition, maybe they should implement it.
   > And from the application point of view, it would not be wrong, I think.
   > But maybe this topic requires a bit more thought and investigation from 
other OSes.
   > 
   
   Ok, we are on the same page, the next question is how to implement 
BIOC_PARTINFO for the real block/mtd device? The general and consistent 
approach is forward BIOC_PARTINFO to the ioctl callback, and convert geometry 
to partinfo automaitically if -ENOTTY is return. The problem is where to put 
the fallback code.
   
   > > 2. Should the block/mtd partition driver return the real geometry 
info(the full capacity instead of partition size)?
   > 
   > I think so. For me it is not right for the geometry parameters to vary 
between the parent MTD and its partitions. It should consistently return the 
real geometry of the memory device.
   
   The change is simple, we can just forward it to the underlying driver.
   
   > This will be another breaking change. Those unaware of it will probably 
only notice the side-effects on runtime.
   > But I think this is needed for API correctness.
   
   Yes, many place need change MTDIOC_GEOMETRY(block_operations::geometry) to 
BIOC_PARTINFO.
   


-- 
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]


Reply via email to