mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
FS: Argument is now a structure describing the search.
This commit is contained in:
+17
-9
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/dirent/fs_opendir.c
|
* fs/dirent/fs_opendir.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011, 2013-2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011, 2013-2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -226,7 +226,8 @@ FAR DIR *opendir(FAR const char *path)
|
|||||||
{
|
{
|
||||||
FAR struct inode *inode = NULL;
|
FAR struct inode *inode = NULL;
|
||||||
FAR struct fs_dirent_s *dir;
|
FAR struct fs_dirent_s *dir;
|
||||||
FAR const char *relpath;
|
struct inode_search_s desc;
|
||||||
|
FAR const char *relpath = NULL;
|
||||||
bool isroot = false;
|
bool isroot = false;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -239,7 +240,6 @@ FAR DIR *opendir(FAR const char *path)
|
|||||||
{
|
{
|
||||||
inode = g_root_inode;
|
inode = g_root_inode;
|
||||||
isroot = true;
|
isroot = true;
|
||||||
relpath = NULL;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -253,15 +253,23 @@ FAR DIR *opendir(FAR const char *path)
|
|||||||
|
|
||||||
/* Find the node matching the path. */
|
/* Find the node matching the path. */
|
||||||
|
|
||||||
inode = inode_search(&path, (FAR struct inode**)NULL,
|
memset(&desc, 0, sizeof(struct inode_search_s));
|
||||||
(FAR struct inode**)NULL, &relpath);
|
desc.path = path;
|
||||||
|
|
||||||
|
ret = inode_search(&desc);
|
||||||
|
if (ret >= 0)
|
||||||
|
{
|
||||||
|
inode = desc.node;
|
||||||
|
DEBUGASSERT(inode != NULL);
|
||||||
|
relpath = desc.relpath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Did we get an inode? */
|
/* Did we get an inode? */
|
||||||
|
|
||||||
if (!inode)
|
if (!inode)
|
||||||
{
|
{
|
||||||
/* 'path' is not a does not exist. */
|
/* 'path' does not exist. */
|
||||||
|
|
||||||
ret = ENOTDIR;
|
ret = ENOTDIR;
|
||||||
goto errout_with_semaphore;
|
goto errout_with_semaphore;
|
||||||
@@ -305,9 +313,9 @@ FAR DIR *opendir(FAR const char *path)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_MOUNTPOINT
|
#ifndef CONFIG_DISABLE_MOUNTPOINT
|
||||||
else if (INODE_IS_MOUNTPT(inode))
|
else if (INODE_IS_MOUNTPT(inode))
|
||||||
{
|
{
|
||||||
/* Yes, the node is a file system mountpoint */
|
/* Yes, the node is a file system mountpoint */
|
||||||
|
|
||||||
dir->fd_root = inode; /* Save the inode where we start */
|
dir->fd_root = inode; /* Save the inode where we start */
|
||||||
|
|
||||||
|
|||||||
+47
-8
@@ -39,7 +39,10 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <nuttx/fs/fs.h>
|
#include <nuttx/fs/fs.h>
|
||||||
|
|
||||||
#include "inode/inode.h"
|
#include "inode/inode.h"
|
||||||
@@ -63,7 +66,9 @@
|
|||||||
|
|
||||||
FAR struct inode *inode_find(FAR const char *path, FAR const char **relpath)
|
FAR struct inode *inode_find(FAR const char *path, FAR const char **relpath)
|
||||||
{
|
{
|
||||||
FAR struct inode *node;
|
struct inode_search_s desc;
|
||||||
|
FAR struct inode *node = NULL;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (path == NULL || *path != '/')
|
if (path == NULL || *path != '/')
|
||||||
{
|
{
|
||||||
@@ -74,12 +79,28 @@ FAR struct inode *inode_find(FAR const char *path, FAR const char **relpath)
|
|||||||
* references on the node.
|
* references on the node.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
memset(&desc, 0, sizeof(struct inode_search_s));
|
||||||
|
desc.path = path;
|
||||||
|
|
||||||
inode_semtake();
|
inode_semtake();
|
||||||
node = inode_search(&path, (FAR struct inode**)NULL,
|
ret = inode_search(&desc);
|
||||||
(FAR struct inode**)NULL, relpath);
|
if (ret >= 0)
|
||||||
if (node)
|
|
||||||
{
|
{
|
||||||
|
/* Found it */
|
||||||
|
|
||||||
|
node = desc.node;
|
||||||
|
DEBUGASSERT(node != NULL);
|
||||||
|
|
||||||
|
/* Increment the reference count on the inode */
|
||||||
|
|
||||||
node->i_crefs++;
|
node->i_crefs++;
|
||||||
|
|
||||||
|
/* Return any remaining relative path fragment */
|
||||||
|
|
||||||
|
if (relpath != NULL)
|
||||||
|
{
|
||||||
|
*relpath = desc.relpath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inode_semgive();
|
inode_semgive();
|
||||||
@@ -90,7 +111,9 @@ FAR struct inode *inode_find(FAR const char *path, FAR const char **relpath)
|
|||||||
FAR struct inode *inode_find_nofollow(FAR const char *path,
|
FAR struct inode *inode_find_nofollow(FAR const char *path,
|
||||||
FAR const char **relpath)
|
FAR const char **relpath)
|
||||||
{
|
{
|
||||||
FAR struct inode *node;
|
struct inode_search_s desc;
|
||||||
|
FAR struct inode *node = NULL;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (path == NULL || *path != '/')
|
if (path == NULL || *path != '/')
|
||||||
{
|
{
|
||||||
@@ -101,12 +124,28 @@ FAR struct inode *inode_find_nofollow(FAR const char *path,
|
|||||||
* references on the node.
|
* references on the node.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
memset(&desc, 0, sizeof(struct inode_search_s));
|
||||||
|
desc.path = path;
|
||||||
|
|
||||||
inode_semtake();
|
inode_semtake();
|
||||||
node = inode_search_nofollow(&path, (FAR struct inode**)NULL,
|
ret = inode_search_nofollow(&desc);
|
||||||
(FAR struct inode**)NULL, relpath);
|
if (ret >= 0)
|
||||||
if (node)
|
|
||||||
{
|
{
|
||||||
|
/* Found it */
|
||||||
|
|
||||||
|
node = desc.node;
|
||||||
|
DEBUGASSERT(node != NULL);
|
||||||
|
|
||||||
|
/* Increment the reference count on the inode */
|
||||||
|
|
||||||
node->i_crefs++;
|
node->i_crefs++;
|
||||||
|
|
||||||
|
/* Return any remaining relative path fragment */
|
||||||
|
|
||||||
|
if (relpath != NULL)
|
||||||
|
{
|
||||||
|
*relpath = desc.relpath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inode_semgive();
|
inode_semgive();
|
||||||
|
|||||||
+16
-10
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/inode/fs_inoderemove.c
|
* fs/inode/fs_inoderemove.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <nuttx/kmalloc.h>
|
#include <nuttx/kmalloc.h>
|
||||||
@@ -70,10 +71,9 @@
|
|||||||
|
|
||||||
FAR struct inode *inode_unlink(FAR const char *path)
|
FAR struct inode *inode_unlink(FAR const char *path)
|
||||||
{
|
{
|
||||||
const char *name = path;
|
struct inode_search_s desc;
|
||||||
FAR struct inode *node;
|
FAR struct inode *node;
|
||||||
FAR struct inode *peer;
|
int ret;
|
||||||
FAR struct inode *parent;
|
|
||||||
|
|
||||||
/* Verify parameters. Ignore null paths and relative paths */
|
/* Verify parameters. Ignore null paths and relative paths */
|
||||||
|
|
||||||
@@ -84,25 +84,31 @@ FAR struct inode *inode_unlink(FAR const char *path)
|
|||||||
|
|
||||||
/* Find the node to unlink */
|
/* Find the node to unlink */
|
||||||
|
|
||||||
node = inode_search_nofollow(&name, &peer, &parent, (const char **)NULL);
|
memset(&desc, 0, sizeof(struct inode_search_s));
|
||||||
if (node)
|
desc.path = path;
|
||||||
|
|
||||||
|
ret = inode_search_nofollow(&desc);
|
||||||
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
|
node = desc.node;
|
||||||
|
DEBUGASSERT(node != NULL);
|
||||||
|
|
||||||
/* If peer is non-null, then remove the node from the right of
|
/* If peer is non-null, then remove the node from the right of
|
||||||
* of that peer node.
|
* of that peer node.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (peer)
|
if (desc.peer != NULL)
|
||||||
{
|
{
|
||||||
peer->i_peer = node->i_peer;
|
desc.peer->i_peer = node->i_peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If parent is non-null, then remove the node from head of
|
/* If parent is non-null, then remove the node from head of
|
||||||
* of the list of children.
|
* of the list of children.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else if (parent)
|
else if (desc.parent)
|
||||||
{
|
{
|
||||||
parent->i_child = node->i_peer;
|
desc.parent->i_child = node->i_peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, we must be removing the root inode. */
|
/* Otherwise, we must be removing the root inode. */
|
||||||
|
|||||||
+24
-11
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/inode/fs_registerreserve.c
|
* fs/inode/fs_registerreserve.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011-2012, 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011-2012, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@@ -163,33 +164,45 @@ static void inode_insert(FAR struct inode *node,
|
|||||||
|
|
||||||
int inode_reserve(FAR const char *path, FAR struct inode **inode)
|
int inode_reserve(FAR const char *path, FAR struct inode **inode)
|
||||||
{
|
{
|
||||||
FAR const char *name = path;
|
struct inode_search_s desc;
|
||||||
FAR struct inode *left;
|
FAR struct inode *left;
|
||||||
FAR struct inode *parent;
|
FAR struct inode *parent;
|
||||||
|
FAR const char *name;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Assume failure */
|
/* Assume failure */
|
||||||
|
|
||||||
DEBUGASSERT(path && inode);
|
DEBUGASSERT(path != NULL && inode != NULL);
|
||||||
*inode = NULL;
|
*inode = NULL;
|
||||||
|
|
||||||
/* Handle paths that are interpreted as the root directory */
|
/* Handle paths that are interpreted as the root directory */
|
||||||
|
|
||||||
if (path[0] == '\0' || path[0] != '/' || path[1] == '\0')
|
if (path[0] == '\0' || path[0] != '/')
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the location to insert the new subtree */
|
/* Find the location to insert the new subtree */
|
||||||
|
|
||||||
if (inode_search(&name, &left, &parent, (FAR const char **)NULL) != NULL)
|
memset(&desc, 0, sizeof(struct inode_search_s));
|
||||||
|
desc.path = path;
|
||||||
|
|
||||||
|
ret = inode_search(&desc);
|
||||||
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
/* It is an error if the node already exists in the tree */
|
/* It is an error if the node already exists in the tree (or if it
|
||||||
|
* lies within a mountpoint, we don't distinguish here).
|
||||||
|
*/
|
||||||
|
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now we now where to insert the subtree */
|
/* Now we now where to insert the subtree */
|
||||||
|
|
||||||
|
name = desc.path;
|
||||||
|
left = desc.peer;
|
||||||
|
parent = desc.parent;
|
||||||
|
|
||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
FAR struct inode *node;
|
FAR struct inode *node;
|
||||||
@@ -199,19 +212,19 @@ int inode_reserve(FAR const char *path, FAR struct inode **inode)
|
|||||||
* by looking at the next name.
|
* by looking at the next name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FAR const char *next_name = inode_nextname(name);
|
FAR const char *nextname = inode_nextname(name);
|
||||||
if (*next_name)
|
if (*nextname != '\0')
|
||||||
{
|
{
|
||||||
/* Insert an operationless node */
|
/* Insert an operationless node */
|
||||||
|
|
||||||
node = inode_alloc(name);
|
node = inode_alloc(name);
|
||||||
if (node)
|
if (node != NULL)
|
||||||
{
|
{
|
||||||
inode_insert(node, left, parent);
|
inode_insert(node, left, parent);
|
||||||
|
|
||||||
/* Set up for the next time through the loop */
|
/* Set up for the next time through the loop */
|
||||||
|
|
||||||
name = next_name;
|
name = nextname;
|
||||||
left = NULL;
|
left = NULL;
|
||||||
parent = node;
|
parent = node;
|
||||||
continue;
|
continue;
|
||||||
@@ -220,7 +233,7 @@ int inode_reserve(FAR const char *path, FAR struct inode **inode)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
node = inode_alloc(name);
|
node = inode_alloc(name);
|
||||||
if (node)
|
if (node != NULL)
|
||||||
{
|
{
|
||||||
inode_insert(node, left, parent);
|
inode_insert(node, left, parent);
|
||||||
*inode = node;
|
*inode = node;
|
||||||
|
|||||||
+156
-119
@@ -40,6 +40,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@@ -134,6 +135,66 @@ static int _inode_compare(FAR const char *fname,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: inode_linktarget
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* If the inode is a soft link, then (1) get the name of the full path of
|
||||||
|
* the soft link, (2) recursively look-up the inode referenced by the soft
|
||||||
|
* link, and (3) return the inode referenced by the soft link.
|
||||||
|
*
|
||||||
|
* Assumptions:
|
||||||
|
* The caller holds the g_inode_sem semaphore
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
||||||
|
static int inode_linktarget(FAR struct inode *node,
|
||||||
|
FAR struct inode_search_s *desc)
|
||||||
|
{
|
||||||
|
unsigned int count = 0;
|
||||||
|
int ret = -ENOENT;
|
||||||
|
|
||||||
|
DEBUGASSERT(desc != NULL && node != NULL);
|
||||||
|
|
||||||
|
/* An infinite loop is avoided only by the loop count.
|
||||||
|
*
|
||||||
|
* REVISIT: The ELOOP error should be reported to the application in that
|
||||||
|
* case but there is no simple mechanism to do that.
|
||||||
|
*/
|
||||||
|
|
||||||
|
while (INODE_IS_SOFTLINK(node))
|
||||||
|
{
|
||||||
|
/* Now, look-up the inode associated with the target path */
|
||||||
|
|
||||||
|
memset(desc, 0, sizeof(struct inode_search_s));
|
||||||
|
desc->path = (FAR const char *)node->u.i_link;
|
||||||
|
|
||||||
|
/* Look up the target of the symbolic link */
|
||||||
|
|
||||||
|
ret = inode_search_nofollow(desc);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Limit the number of symbolic links that we pass through */
|
||||||
|
|
||||||
|
if (++count > SYMLOOP_MAX)
|
||||||
|
{
|
||||||
|
ret = -ELOOP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set up for the next time through the loop */
|
||||||
|
|
||||||
|
node = desc->node;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -158,25 +219,32 @@ static int _inode_compare(FAR const char *fname,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
||||||
|
int inode_search_nofollow(FAR struct inode_search_s *desc)
|
||||||
FAR struct inode *inode_search_nofollow(FAR const char **path,
|
|
||||||
FAR struct inode **peer,
|
|
||||||
FAR struct inode **parent,
|
|
||||||
FAR const char **relpath)
|
|
||||||
#else
|
#else
|
||||||
FAR struct inode *inode_search(FAR const char **path,
|
int inode_search(FAR struct inode_search_s *desc)
|
||||||
FAR struct inode **peer,
|
|
||||||
FAR struct inode **parent,
|
|
||||||
FAR const char **relpath)
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
FAR const char *name = *path + 1; /* Skip over leading '/' */
|
FAR const char *name;
|
||||||
FAR struct inode *node = g_root_inode;
|
FAR struct inode *node = g_root_inode;
|
||||||
FAR struct inode *left = NULL;
|
FAR struct inode *left = NULL;
|
||||||
FAR struct inode *above = NULL;
|
FAR struct inode *above = NULL;
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
FAR const char *relpath = NULL;
|
||||||
FAR struct inode *newnode;
|
int ret = -ENOENT;
|
||||||
#endif
|
|
||||||
|
/* Get the search path, skipping over the leading '/'. The leading '/' is
|
||||||
|
* mandatory because only absolte paths are expected in this context.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DEBUGASSERT(desc != NULL && desc->path != NULL);
|
||||||
|
name = desc->path;
|
||||||
|
|
||||||
|
DEBUGASSERT(*name == '/');
|
||||||
|
if (*name != '/')
|
||||||
|
{
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
name++; /* Skip over the leading '/' */
|
||||||
|
|
||||||
/* Traverse the pseudo file system node tree until either (1) all nodes
|
/* Traverse the pseudo file system node tree until either (1) all nodes
|
||||||
* have been examined without finding the matching node, or (2) the
|
* have been examined without finding the matching node, or (2) the
|
||||||
@@ -231,10 +299,7 @@ FAR struct inode *inode_search(FAR const char **path,
|
|||||||
* and will handle the remaining part of the pathname
|
* and will handle the remaining part of the pathname
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (relpath)
|
relpath = name;
|
||||||
{
|
|
||||||
*relpath = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
||||||
/* NOTE that if the terminal inode is a soft link, it is not
|
/* NOTE that if the terminal inode is a soft link, it is not
|
||||||
@@ -243,6 +308,7 @@ FAR struct inode *inode_search(FAR const char **path,
|
|||||||
* In that case a wrapper function will perform that operation.
|
* In that case a wrapper function will perform that operation.
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
ret = OK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -250,49 +316,64 @@ FAR struct inode *inode_search(FAR const char **path,
|
|||||||
/* More nodes to be examined in the path "below" this one. */
|
/* More nodes to be examined in the path "below" this one. */
|
||||||
|
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
||||||
/* If this intermediate inode in the is a soft link, then (1)
|
/* Was the node a soft link? If so, then we need need to
|
||||||
* get the name of the full path of the soft link, (2) recursively
|
* continue below the target of the link, not the link itself.
|
||||||
* look-up the inode referenced by the sof link, and (3)
|
|
||||||
* continue searching with that inode instead.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
newnode = inode_linktarget(node, NULL, NULL, relpath);
|
if (INODE_IS_SOFTLINK(node))
|
||||||
if (newnode == NULL)
|
|
||||||
{
|
{
|
||||||
/* Probably means that the node is a symbolic link, but
|
int status;
|
||||||
* that the target of the symbolic link does not exist.
|
|
||||||
|
/* If this intermediate inode in the is a soft link, then
|
||||||
|
* (1) get the name of the full path of the soft link, (2)
|
||||||
|
* recursively look-up the inode referenced by the soft
|
||||||
|
* link, and (3) continue searching with that inode instead.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
break;
|
status = inode_linktarget(node, desc);
|
||||||
}
|
if (status < 0)
|
||||||
else if (newnode != node)
|
|
||||||
{
|
|
||||||
/* The node was a valid symbolic link and we have jumped to a
|
|
||||||
* different, spot in the the pseudo file system tree.
|
|
||||||
*
|
|
||||||
* Continue from this new inode.
|
|
||||||
*/
|
|
||||||
|
|
||||||
node = newnode;
|
|
||||||
|
|
||||||
/* Check if this took us to a mountpoint. */
|
|
||||||
|
|
||||||
if (INODE_IS_MOUNTPT(newnode))
|
|
||||||
{
|
{
|
||||||
/* Yes.. return the mountpoint information.
|
/* Probably means that the the target of the symbolic
|
||||||
* REVISIT: The relpath is incorrect in this case. It is
|
* link does not exist.
|
||||||
* relative to symbolic link, not to the root of the mount.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (relpath)
|
ret = status;
|
||||||
{
|
|
||||||
*relpath = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
above = NULL;
|
|
||||||
left = NULL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FAR struct inode *newnode = desc->node;
|
||||||
|
|
||||||
|
if (newnode != node)
|
||||||
|
{
|
||||||
|
/* The node was a valid symbolic link and we have
|
||||||
|
* jumped to a different, spot in the the pseudo
|
||||||
|
* file system tree.
|
||||||
|
*
|
||||||
|
* Continue from this new inode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
node = newnode;
|
||||||
|
|
||||||
|
/* Check if this took us to a mountpoint. */
|
||||||
|
|
||||||
|
if (INODE_IS_MOUNTPT(node))
|
||||||
|
{
|
||||||
|
/* Yes.. return the mountpoint information.
|
||||||
|
* REVISIT: The relpath is incorrect in this case.
|
||||||
|
* It is relative to symbolic link, not to the
|
||||||
|
* root of the mount.
|
||||||
|
*/
|
||||||
|
|
||||||
|
relpath = name;
|
||||||
|
above = NULL;
|
||||||
|
left = NULL;
|
||||||
|
|
||||||
|
ret = OK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Keep looking at the next level "down" */
|
/* Keep looking at the next level "down" */
|
||||||
@@ -319,29 +400,22 @@ FAR struct inode *inode_search(FAR const char **path,
|
|||||||
* (4) When the node matching the full path is found
|
* (4) When the node matching the full path is found
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (peer)
|
desc->path = name;
|
||||||
{
|
desc->node = node;
|
||||||
*peer = left;
|
desc->peer = left;
|
||||||
}
|
desc->parent = above;
|
||||||
|
desc->relpath = relpath;
|
||||||
if (parent)
|
return ret;
|
||||||
{
|
|
||||||
*parent = above;
|
|
||||||
}
|
|
||||||
|
|
||||||
*path = name;
|
|
||||||
return node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
||||||
FAR struct inode *inode_search(FAR const char **path,
|
int inode_search(FAR struct inode_search_s *desc)
|
||||||
FAR struct inode **peer,
|
|
||||||
FAR struct inode **parent,
|
|
||||||
FAR const char **relpath)
|
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Lookup the terminal inode */
|
/* Lookup the terminal inode */
|
||||||
|
|
||||||
FAR struct inode *node = inode_search_nofollow(path, peer, parent, relpath);
|
ret = inode_search_nofollow(desc);
|
||||||
|
|
||||||
/* Did we find it? inode_search_nofollow() will terminate in one of
|
/* Did we find it? inode_search_nofollow() will terminate in one of
|
||||||
* three ways:
|
* three ways:
|
||||||
@@ -356,63 +430,26 @@ FAR struct inode *inode_search(FAR const char **path,
|
|||||||
* to symbolic link, not to the root of the mount.
|
* to symbolic link, not to the root of the mount.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (node != NULL && INODE_IS_SOFTLINK(node))
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
/* The terminating inode is a valid soft link: Return the inode,
|
/* Sucessfully found inode */
|
||||||
* corresponding to link target.
|
|
||||||
*/
|
|
||||||
|
|
||||||
return inode_linktarget(node, peer, parent, relpath);
|
FAR struct inode *node = desc->node;
|
||||||
}
|
DEBUGASSERT(node != NULL);
|
||||||
|
|
||||||
return node;
|
/* Is the terminal node a softlink? */
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
if (INODE_IS_SOFTLINK(node))
|
||||||
* Name: inode_linktarget
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* If the inode is a soft link, then (1) get the name of the full path of
|
|
||||||
* the soft link, (2) recursively look-up the inode referenced by the soft
|
|
||||||
* link, and (3) return the inode referenced by the soft link.
|
|
||||||
*
|
|
||||||
* Assumptions:
|
|
||||||
* The caller holds the g_inode_sem semaphore
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
|
||||||
FAR struct inode *inode_linktarget(FAR struct inode *node,
|
|
||||||
FAR struct inode **peer,
|
|
||||||
FAR struct inode **parent,
|
|
||||||
FAR const char **relpath)
|
|
||||||
{
|
|
||||||
FAR const char *copy;
|
|
||||||
unsigned int count = 0;
|
|
||||||
|
|
||||||
/* An infinite loop is avoided only by the loop count.
|
|
||||||
*
|
|
||||||
* REVISIT: The ELOOP error should be reported to the application in that
|
|
||||||
* case but there is no simple mechanism to do that.
|
|
||||||
*/
|
|
||||||
|
|
||||||
while (node != NULL && INODE_IS_SOFTLINK(node))
|
|
||||||
{
|
|
||||||
/* Careful: inode_search_nofollow overwrites the input string pointer */
|
|
||||||
|
|
||||||
copy = (FAR const char *)node->u.i_link;
|
|
||||||
|
|
||||||
/* Now, look-up the inode associated with the target path */
|
|
||||||
|
|
||||||
node = inode_search_nofollow(©, peer, parent, relpath);
|
|
||||||
if (node == NULL && ++count > SYMLOOP_MAX)
|
|
||||||
{
|
{
|
||||||
return NULL;
|
/* The terminating inode is a valid soft link: Return the inode,
|
||||||
|
* corresponding to link target.
|
||||||
|
*/
|
||||||
|
|
||||||
|
ret = inode_linktarget(node, desc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return node;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+26
-29
@@ -52,6 +52,29 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
/* This is the type of the argument to inode_search().
|
||||||
|
*
|
||||||
|
* path - INPUT: Path of inode to find
|
||||||
|
* OUTPUT: Residual part of path not traversed
|
||||||
|
* node - INPUT: (not used)
|
||||||
|
* OUTPUT: On success, holds the pointer to the inode found.
|
||||||
|
* peer - INPUT: (not used)
|
||||||
|
* OUTPUT: The inode to the "left" of the inode found.
|
||||||
|
* parent - INPUT: (not used)
|
||||||
|
* OUTPUT: The inode to the "above" of the inode found.
|
||||||
|
* relpath - INPUT: (not used)
|
||||||
|
* OUTPUT: If the returned inode is a mountpoint, this is the
|
||||||
|
* relative path from the mountpoint.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct inode_search_s
|
||||||
|
{
|
||||||
|
FAR const char *path; /* Path of inode to find */
|
||||||
|
FAR struct inode *node; /* Pointer to the inode found */
|
||||||
|
FAR struct inode *peer; /* Node to the "left" for the found inode */
|
||||||
|
FAR struct inode *parent; /* Node "above" the found inode */
|
||||||
|
FAR const char *relpath; /* Relative path into the mountpoint */
|
||||||
|
};
|
||||||
|
|
||||||
/* Callback used by foreach_inode to traverse all inodes in the pseudo-
|
/* Callback used by foreach_inode to traverse all inodes in the pseudo-
|
||||||
* file system.
|
* file system.
|
||||||
@@ -130,38 +153,12 @@ void inode_semgive(void);
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR struct inode *inode_search(FAR const char **path,
|
int inode_search(FAR struct inode_search_s *desc);
|
||||||
FAR struct inode **peer,
|
|
||||||
FAR struct inode **parent,
|
|
||||||
FAR const char **relpath);
|
|
||||||
|
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
||||||
FAR struct inode *inode_search_nofollow(FAR const char **path,
|
int inode_search_nofollow(FAR struct inode_search_s *desc);
|
||||||
FAR struct inode **peer,
|
|
||||||
FAR struct inode **parent,
|
|
||||||
FAR const char **relpath);
|
|
||||||
#else
|
#else
|
||||||
# define inode_search_nofollow(p,l,a,r) inode_search(p,l,a,r)
|
# define inode_search_nofollow(d) inode_search(d)
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: inode_linktarget
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* If the inode is a soft link, then (1) get the name of the full path of
|
|
||||||
* the soft link, (2) recursively look-up the inode referenced by the soft
|
|
||||||
* link, and (3) return the inode referenced by the soft link.
|
|
||||||
*
|
|
||||||
* Assumptions:
|
|
||||||
* The caller holds the g_inode_sem semaphore
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
|
||||||
FAR struct inode *inode_linktarget(FAR struct inode *node,
|
|
||||||
FAR struct inode **peer,
|
|
||||||
FAR struct inode **parent,
|
|
||||||
FAR const char **relpath);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+10
-10
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/mount/fs_automount.c
|
* fs/mount/fs_automount.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -124,9 +124,7 @@ static int automount_interrupt(FAR const struct automount_lower_s *lower,
|
|||||||
|
|
||||||
static int automount_findinode(FAR const char *path)
|
static int automount_findinode(FAR const char *path)
|
||||||
{
|
{
|
||||||
FAR struct inode *node;
|
struct inode_search_s desc;
|
||||||
FAR const char *srchpath;
|
|
||||||
FAR const char *relpath;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Make sure that we were given an absolute path */
|
/* Make sure that we were given an absolute path */
|
||||||
@@ -139,12 +137,14 @@ static int automount_findinode(FAR const char *path)
|
|||||||
|
|
||||||
/* Find the inode */
|
/* Find the inode */
|
||||||
|
|
||||||
srchpath = path;
|
memset(&desc, 0, sizeof(struct inode_search_s));
|
||||||
node = inode_search(&srchpath, (FAR struct inode**)NULL,
|
desc.path = path;
|
||||||
(FAR struct inode**)NULL, &relpath);
|
|
||||||
|
ret = inode_search(&desc);
|
||||||
|
|
||||||
/* Did we find it? */
|
/* Did we find it? */
|
||||||
|
|
||||||
if (!node)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
/* No.. Not found */
|
/* No.. Not found */
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ static int automount_findinode(FAR const char *path)
|
|||||||
|
|
||||||
/* Yes.. is it a mount point? */
|
/* Yes.. is it a mount point? */
|
||||||
|
|
||||||
else if (INODE_IS_MOUNTPT(node))
|
else if (INODE_IS_MOUNTPT(desc.node))
|
||||||
{
|
{
|
||||||
/* Yes.. we found a mountpoint at this path */
|
/* Yes.. we found a mountpoint at this path */
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ static int automount_findinode(FAR const char *path)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* No.. then somethin is in the way */
|
/* No.. then something is in the way */
|
||||||
|
|
||||||
ret = -ENOTDIR;
|
ret = -ENOTDIR;
|
||||||
}
|
}
|
||||||
|
|||||||
+30
-32
@@ -83,11 +83,6 @@ static inline int statpseudo(FAR struct inode *inode, FAR struct stat *buf)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (inode->u.i_ops != NULL)
|
|
||||||
{
|
|
||||||
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
||||||
/* Handle softlinks differently. Just call stat() recursively on the
|
/* Handle softlinks differently. Just call stat() recursively on the
|
||||||
* target of the softlink.
|
* target of the softlink.
|
||||||
@@ -124,39 +119,42 @@ static inline int statpseudo(FAR struct inode *inode, FAR struct stat *buf)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (inode->u.i_ops != NULL)
|
||||||
|
{
|
||||||
|
/* Determine read/write privileges based on the existence of read
|
||||||
|
* and write methods.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (inode->u.i_ops->read)
|
||||||
{
|
{
|
||||||
/* Determine read/write privileges based on the existence of read
|
buf->st_mode = S_IROTH | S_IRGRP | S_IRUSR;
|
||||||
* and write methods.
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
if (inode->u.i_ops->read)
|
if (inode->u.i_ops->write)
|
||||||
{
|
{
|
||||||
buf->st_mode = S_IROTH | S_IRGRP | S_IRUSR;
|
buf->st_mode |= S_IWOTH | S_IWGRP | S_IWUSR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inode->u.i_ops->write)
|
/* Determine the type of the inode */
|
||||||
{
|
|
||||||
buf->st_mode |= S_IWOTH | S_IWGRP | S_IWUSR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Determine the type of the inode */
|
if (INODE_IS_MOUNTPT(inode))
|
||||||
|
{
|
||||||
|
buf->st_mode |= S_IFDIR;
|
||||||
|
}
|
||||||
|
else if (INODE_IS_BLOCK(inode))
|
||||||
|
{
|
||||||
|
/* What is if also has child inodes? */
|
||||||
|
|
||||||
if (INODE_IS_MOUNTPT(inode))
|
buf->st_mode |= S_IFBLK;
|
||||||
{
|
}
|
||||||
buf->st_mode |= S_IFDIR;
|
else /* if (INODE_IS_DRIVER(inode)) */
|
||||||
}
|
{
|
||||||
else if (INODE_IS_BLOCK(inode))
|
/* What is it if it also has child inodes? */
|
||||||
{
|
|
||||||
/* What is if also has child inodes? */
|
|
||||||
|
|
||||||
buf->st_mode |= S_IFBLK;
|
buf->st_mode |= S_IFCHR;
|
||||||
}
|
|
||||||
else /* if (INODE_IS_DRIVER(inode)) */
|
|
||||||
{
|
|
||||||
/* What is it if it also has child inodes? */
|
|
||||||
|
|
||||||
buf->st_mode |= S_IFCHR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -130,7 +130,13 @@ int unlink(FAR const char *pathname)
|
|||||||
* or a soft link, then rm should remove the node.
|
* or a soft link, then rm should remove the node.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_PSEUDOFS_SOFTLINKS
|
||||||
|
/* A soft link is the only "specal" file that we can remove via unlink(). */
|
||||||
|
|
||||||
|
if (!INODE_IS_SPECIAL(inode) || INODE_IS_SOFTLINK(inode))
|
||||||
|
#else
|
||||||
if (!INODE_IS_SPECIAL(inode))
|
if (!INODE_IS_SPECIAL(inode))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* If this is a pseudo-file node (i.e., it has no operations)
|
/* If this is a pseudo-file node (i.e., it has no operations)
|
||||||
* then unlink should remove the node.
|
* then unlink should remove the node.
|
||||||
|
|||||||
@@ -76,11 +76,11 @@
|
|||||||
#define FSNODEFLAG_TYPE_DRIVER 0x00000000 /* Character driver */
|
#define FSNODEFLAG_TYPE_DRIVER 0x00000000 /* Character driver */
|
||||||
#define FSNODEFLAG_TYPE_BLOCK 0x00000001 /* Block driver */
|
#define FSNODEFLAG_TYPE_BLOCK 0x00000001 /* Block driver */
|
||||||
#define FSNODEFLAG_TYPE_MOUNTPT 0x00000002 /* Mount point */
|
#define FSNODEFLAG_TYPE_MOUNTPT 0x00000002 /* Mount point */
|
||||||
#define FSNODEFLAG_TYPE_SOFTLINK 0x00000003 /* Soft link */
|
|
||||||
#define FSNODEFLAG_TYPE_SPECIAL 0x00000004 /* Special OS type */
|
#define FSNODEFLAG_TYPE_SPECIAL 0x00000004 /* Special OS type */
|
||||||
#define FSNODEFLAG_TYPE_NAMEDSEM 0x00000004 /* Named semaphore */
|
#define FSNODEFLAG_TYPE_NAMEDSEM 0x00000004 /* Named semaphore */
|
||||||
#define FSNODEFLAG_TYPE_MQUEUE 0x00000005 /* Message Queue */
|
#define FSNODEFLAG_TYPE_MQUEUE 0x00000005 /* Message Queue */
|
||||||
#define FSNODEFLAG_TYPE_SHM 0x00000006 /* Shared memory region */
|
#define FSNODEFLAG_TYPE_SHM 0x00000006 /* Shared memory region */
|
||||||
|
#define FSNODEFLAG_TYPE_SOFTLINK 0x00000007 /* Soft link */
|
||||||
#define FSNODEFLAG_DELETED 0x00000008 /* Unlinked */
|
#define FSNODEFLAG_DELETED 0x00000008 /* Unlinked */
|
||||||
|
|
||||||
#define INODE_IS_TYPE(i,t) \
|
#define INODE_IS_TYPE(i,t) \
|
||||||
@@ -91,10 +91,10 @@
|
|||||||
#define INODE_IS_DRIVER(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_DRIVER)
|
#define INODE_IS_DRIVER(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_DRIVER)
|
||||||
#define INODE_IS_BLOCK(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_BLOCK)
|
#define INODE_IS_BLOCK(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_BLOCK)
|
||||||
#define INODE_IS_MOUNTPT(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_MOUNTPT)
|
#define INODE_IS_MOUNTPT(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_MOUNTPT)
|
||||||
#define INODE_IS_SOFTLINK(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_SOFTLINK)
|
|
||||||
#define INODE_IS_NAMEDSEM(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_NAMEDSEM)
|
#define INODE_IS_NAMEDSEM(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_NAMEDSEM)
|
||||||
#define INODE_IS_MQUEUE(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_MQUEUE)
|
#define INODE_IS_MQUEUE(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_MQUEUE)
|
||||||
#define INODE_IS_SHM(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_SHM)
|
#define INODE_IS_SHM(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_SHM)
|
||||||
|
#define INODE_IS_SOFTLINK(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_SOFTLINK)
|
||||||
|
|
||||||
#define INODE_GET_TYPE(i) ((i)->i_flags & FSNODEFLAG_TYPE_MASK)
|
#define INODE_GET_TYPE(i) ((i)->i_flags & FSNODEFLAG_TYPE_MASK)
|
||||||
#define INODE_SET_TYPE(i,t) \
|
#define INODE_SET_TYPE(i,t) \
|
||||||
@@ -107,10 +107,10 @@
|
|||||||
#define INODE_SET_DRIVER(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_DRIVER)
|
#define INODE_SET_DRIVER(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_DRIVER)
|
||||||
#define INODE_SET_BLOCK(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_BLOCK)
|
#define INODE_SET_BLOCK(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_BLOCK)
|
||||||
#define INODE_SET_MOUNTPT(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_MOUNTPT)
|
#define INODE_SET_MOUNTPT(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_MOUNTPT)
|
||||||
#define INODE_SET_SOFTLINK(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_SOFTLINK)
|
|
||||||
#define INODE_SET_NAMEDSEM(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_NAMEDSEM)
|
#define INODE_SET_NAMEDSEM(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_NAMEDSEM)
|
||||||
#define INODE_SET_MQUEUE(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_MQUEUE)
|
#define INODE_SET_MQUEUE(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_MQUEUE)
|
||||||
#define INODE_SET_SHM(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_SHM)
|
#define INODE_SET_SHM(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_SHM)
|
||||||
|
#define INODE_SET_SOFTLINK(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_SOFTLINK)
|
||||||
|
|
||||||
/* Mountpoint fd_flags values */
|
/* Mountpoint fd_flags values */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user