fs/inode: replace some global variables to macro
replace to macro will help to extend the scheduling implementation Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
parent
feb6ede434
commit
0f0c370520
@ -187,7 +187,7 @@ int foreach_inode(foreach_inode_t handler, FAR void *arg)
|
||||
ret = inode_lock();
|
||||
if (ret >= 0)
|
||||
{
|
||||
ret = foreach_inodelevel(g_root_inode->i_child, info);
|
||||
ret = foreach_inodelevel(inode_root()->i_child, info);
|
||||
inode_unlock();
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ int foreach_inode(foreach_inode_t handler, FAR void *arg)
|
||||
ret = inode_lock();
|
||||
if (ret >= 0)
|
||||
{
|
||||
ret = foreach_inodelevel(g_root_inode->i_child, &info);
|
||||
ret = foreach_inodelevel(inode_root()->i_child, &info);
|
||||
inode_unlock();
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ static void inode_insert(FAR struct inode *node,
|
||||
|
||||
void inode_root_reserve(void)
|
||||
{
|
||||
g_root_inode = inode_alloc("", 0777);
|
||||
inode_root() = inode_alloc("", 0777);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -214,7 +214,7 @@ static int _inode_linktarget(FAR struct inode *node,
|
||||
static int _inode_search(FAR struct inode_search_s *desc)
|
||||
{
|
||||
FAR const char *name;
|
||||
FAR struct inode *node = g_root_inode;
|
||||
FAR struct inode *node = inode_root();
|
||||
FAR struct inode *left = NULL;
|
||||
FAR struct inode *above = NULL;
|
||||
FAR const char *relpath = NULL;
|
||||
|
@ -65,6 +65,8 @@
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define inode_root() g_root_inode
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user