acassis commented on code in PR #12808:
URL: https://github.com/apache/nuttx/pull/12808#discussion_r1697526403


##########
fs/mnemofs/mnemofs.c:
##########
@@ -1183,7 +1183,11 @@ static int mnemofs_opendir(FAR struct inode *mountpt,
       goto errout_with_pitr;
     }
 
-  mfs_pitr_init(sb, path, depth, pitr, false);
+  ret = mfs_pitr_init(sb, path, depth, pitr, true);
+  if (predict_false(ret < 0))
+    {
+      goto errout_with_fsdirent;

Review Comment:
   Could be a good idea to include a debug error msg here



##########
fs/mnemofs/mnemofs.c:
##########
@@ -1787,7 +1800,12 @@ static int mnemofs_mkdir(FAR struct inode *mountpt, FAR 
const char *relpath,
   finfo("Lock acquired.");
 
   flags = mfs_get_patharr(sb, relpath, &path, &depth);
-  if ((flags & MFS_NEXIST) ==  0)
+  if ((flags & MFS_EXIST) != 0)
+    {
+      ret = -EEXIST;

Review Comment:
   Please include debug error msg here too



##########
fs/mnemofs/mnemofs_blkalloc.c:
##########
@@ -503,29 +503,45 @@ void mfs_ba_pgmarkdel(FAR struct mfs_sb_s * const sb, 
mfs_t pg)
 
 void mfs_ba_blkmarkdel(FAR struct mfs_sb_s * const sb, mfs_t blk)
 {
-  mfs_erase_blk(sb, blk);
-  DEL_ARR_BLK(sb, blk) = 0;
+  DEL_ARR_BLK(sb, blk) = MFS_PGINBLK(sb);
 }
 
-void mfs_ba_delmarked(FAR struct mfs_sb_s * const sb)
+int mfs_ba_delmarked(FAR struct mfs_sb_s * const sb)
 {
-  /* TODO */
+  int   ret = OK;
+  mfs_t i;
+
+  for (i = 1; i < MFS_NBLKS(sb); i++)
+    {
+      if (DEL_ARR_BLK(sb, i) == MFS_PGINBLK(sb))
+        {
+          ret = mfs_erase_blk(sb, i);
+

Review Comment:
   remove extra empty line



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