anchao commented on code in PR #11140:
URL: https://github.com/apache/nuttx/pull/11140#discussion_r1387776392
##########
fs/inode/fs_files.c:
##########
@@ -278,10 +316,28 @@ void files_releaselist(FAR struct filelist *list)
}
kmm_free(list->fl_files);
+}
- /* Destroy the mutex */
+/****************************************************************************
+ * Name: files_get_filecount
+ *
+ * Description:
+ * Given a file descriptor, return the corresponding instance of struct
+ * file.
+ *
+ * Input Parameters:
+ * fd - The file descriptor
+ * filep - The location to return the struct file instance
+ *
+ * Returned Value:
+ * Zero (OK) is returned on success; a negated errno value is returned on
+ * any failure.
+ *
+ ****************************************************************************/
- nxmutex_destroy(&list->fl_lock);
+int files_get_filecount(FAR struct filelist *list)
+{
+ return list->fl_rows * CONFIG_NFILE_DESCRIPTORS_PER_BLOCK;
Review Comment:
`fl_rows` will not shrink dynamically, there will be no side effect if it
continues to increase.
--
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]