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:
parent
2e3a6acaa2
commit
5a29652d2a
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue