anchao commented on code in PR #11140:
URL: https://github.com/apache/nuttx/pull/11140#discussion_r1390416099


##########
fs/inode/fs_files.c:
##########
@@ -756,28 +714,18 @@ int nx_close_from_tcb(FAR struct tcb_s *tcb, int fd)
 
   /* Perform the protected close operation */
 
-  ret = nxmutex_lock(&list->fl_lock);
-  if (ret < 0)
-    {
-      return ret;
-    }
-
   /* If the file was properly opened, there should be an inode assigned */
 
   if (fd < 0 || fd >= list->fl_rows * CONFIG_NFILE_DESCRIPTORS_PER_BLOCK ||
-      !list->fl_files[fd / CONFIG_NFILE_DESCRIPTORS_PER_BLOCK]
-                     [fd % CONFIG_NFILE_DESCRIPTORS_PER_BLOCK].f_inode)
+      files_fget(list, fd)->f_inode == NULL)

Review Comment:
   Done



##########
fs/inode/fs_files.c:
##########
@@ -51,14 +51,47 @@
  * Private Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: files_fget_by_index
+ ****************************************************************************/
+
+static FAR struct file *files_fget_by_index(FAR struct filelist *list,
+                                         int l1, int l2)

Review Comment:
   Done



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