jingfei195887 commented on code in PR #16642:
URL: https://github.com/apache/nuttx/pull/16642#discussion_r2190225082


##########
drivers/mtd/ftl.c:
##########
@@ -789,7 +883,8 @@ static int ftl_unlink(FAR struct inode *inode)
  *
  ****************************************************************************/
 
-int ftl_initialize_by_path(FAR const char *path, FAR struct mtd_dev_s *mtd)
+int ftl_initialize_by_path(FAR const char *path, FAR struct mtd_dev_s *mtd,
+                           int oflags)

Review Comment:
   However, as you know, the current logic of this patch is that when a node 
uses:
   The method` register_mtddriver(mtd_path, mtd, 0755, NULL); `for 
registration, we can pass oflags when opening the mtd_path. This requires us to 
modify ftl_initialize_by_path() to accept oflags as a parameter. The logic is 
shown in the figure(The MTD device undergoes two conversions: blockproxy and 
mtdproxy.):
   
![image](https://github.com/user-attachments/assets/2d0fa858-5c00-4551-a275-3011271ef5ad)
   
   Of course, if you directly use `ftl_initialize_by_path() `to register the 
MTD as a block device, the registration determines the FTL's oflags. The block 
device's opening process only goes through one conversion, and at this time, it 
is impossible to pass oflags during the open process. 



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