Skip to content

Commit

Permalink
fs/inode: using read-lock to protect inode_find
Browse files Browse the repository at this point in the history
inode_find don't need to modify inode tree

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
  • Loading branch information
Donny9 committed Oct 2, 2024
1 parent 397dcc7 commit 1fe436f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/inode/fs_inodefind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -69,6 +69,6 @@ int inode_find(FAR struct inode_search_s *desc)
atomic_fetch_add(&node->i_crefs, 1);
}

inode_unlock();
inode_runlock();
return ret;
}

0 comments on commit 1fe436f

Please sign in to comment.