diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-05-09 00:04:03 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-05-09 00:04:03 +0000 |
commit | 039a51bde4bc3f21fe68c3f4cff966fde2532faa (patch) | |
tree | ec9942ae9a79d9a6b7315fd02f8b14d27ce95a27 /nuttx/fs/fs_inode.c | |
parent | 0350e28418647956e6fecc5f6a096fb435cf47f4 (diff) | |
download | px4-nuttx-039a51bde4bc3f21fe68c3f4cff966fde2532faa.tar.gz px4-nuttx-039a51bde4bc3f21fe68c3f4cff966fde2532faa.tar.bz2 px4-nuttx-039a51bde4bc3f21fe68c3f4cff966fde2532faa.zip |
Add support for block drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@206 42af7a65-404d-4744-a932-0658087f49c3
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 |