diff options
Diffstat (limited to 'nuttx/fs/fs_inode.c')
-rw-r--r-- | nuttx/fs/fs_inode.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/nuttx/fs/fs_inode.c b/nuttx/fs/fs_inode.c index 9c7cf3d07..274dcf1a4 100644 --- a/nuttx/fs/fs_inode.c +++ b/nuttx/fs/fs_inode.c @@ -209,7 +209,8 @@ void inode_semgive(void) FAR struct inode *inode_search(const char **path, FAR struct inode **peer, - FAR struct inode **parent) + FAR struct inode **parent, + const char **relpath) { const char *name = *path + 1; /* Skip over leading '/' */ FAR struct inode *node = root_inode; @@ -247,18 +248,25 @@ FAR struct inode *inode_search(const char **path, else { - /* Now there are two more possibilities: + /* Now there are three more possibilities: * (1) This is the node that we are looking for or, - * (2) the node we are looking for is "blow" this one. + * (2) The node we are looking for is "below" this one. + * (3) This node is a mountpoint and will absorb all request + * below this one */ name = inode_nextname(name); - if (!*name) + if (!*name || INODE_IS_MOUNTPT(node)) { - /* We are at the end of the path, so this must be - * the node we are looking for. + /* Either (1) we are at the end of the path, so this must be the + * node we are looking for or else (2) this node is a mountpoint + * and will handle the remaining part of the pathname */ + if (relpath) + { + *relpath = name; + } break; } else |