mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
fs/inode: using read-lock to protect inode_find
inode_find don't need to modify inode tree Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -55,7 +55,7 @@ int inode_find(FAR struct inode_search_s *desc)
|
||||
* references on the node.
|
||||
*/
|
||||
|
||||
inode_lock();
|
||||
inode_rlock();
|
||||
ret = inode_search(desc);
|
||||
if (ret >= 0)
|
||||
{
|
||||
@@ -69,6 +69,6 @@ int inode_find(FAR struct inode_search_s *desc)
|
||||
atomic_fetch_add(&inode->i_crefs, 1);
|
||||
}
|
||||
|
||||
inode_unlock();
|
||||
inode_runlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user