diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-12-21 20:12:28 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-01-22 07:52:40 +0100 |
commit | c625a641218fbda23582354b3cfc7a7c7a4e4287 (patch) | |
tree | 82853d039ebb88fb4e7afe0b572c1d072a3f4d00 /cpukit/libcsupport/include | |
parent | powerpc: Fix AltiVec VSCR save/restore (diff) | |
download | rtems-c625a641218fbda23582354b3cfc7a7c7a4e4287.tar.bz2 |
Filesystem: Delete node type operation
Use the fstat handler instead.
Diffstat (limited to '')
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 35 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio_.h | 35 |
2 files changed, 20 insertions, 50 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index dabee60910..a4607de0e9 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -54,18 +54,6 @@ struct knote; /**@{**/ /** - * @brief File system node types. - */ -typedef enum { - RTEMS_FILESYSTEM_DIRECTORY, - RTEMS_FILESYSTEM_DEVICE, - RTEMS_FILESYSTEM_HARD_LINK, - RTEMS_FILESYSTEM_SYM_LINK, - RTEMS_FILESYSTEM_MEMORY_FILE, - RTEMS_FILESYSTEM_INVALID_NODE_TYPE -} rtems_filesystem_node_types_t; - -/** * @brief Locks a file system instance. * * This lock must allow nesting. @@ -343,19 +331,6 @@ typedef bool (*rtems_filesystem_are_nodes_equal_t)( ); /** - * @brief Returns the node type. - * - * @param[in] loc The location of the node. - * - * @return Type of the node. - * - * @see rtems_filesystem_default_node_type(). - */ -typedef rtems_filesystem_node_types_t (*rtems_filesystem_node_type_t)( - const rtems_filesystem_location_info_t *loc -); - -/** * @brief Creates a new node. * * This handler should create a new node according to the parameters. @@ -499,7 +474,6 @@ struct _rtems_filesystem_operations_table { rtems_filesystem_eval_path_t eval_path_h; rtems_filesystem_link_t link_h; rtems_filesystem_are_nodes_equal_t are_nodes_equal_h; - rtems_filesystem_node_type_t node_type_h; rtems_filesystem_mknod_t mknod_h; rtems_filesystem_rmnod_t rmnod_h; rtems_filesystem_fchmod_t fchmod_h; @@ -581,15 +555,6 @@ bool rtems_filesystem_default_are_nodes_equal( ); /** - * @retval RTEMS_FILESYSTEM_INVALID_NODE_TYPE Always. - * - * @see rtems_filesystem_node_type_t. - */ -rtems_filesystem_node_types_t rtems_filesystem_default_node_type( - const rtems_filesystem_location_info_t *pathloc -); - -/** * @retval -1 Always. The errno is set to ENOTSUP. * * @see rtems_filesystem_mknod_t. diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 458201ea3f..e204508cf1 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -206,21 +206,6 @@ void rtems_filesystem_location_clone( ); /** - * @brief Returns the type of a node. - * - * This function obtains and releases the file system instance lock. - * - * @param[in] loc The location of the node. - * - * @retval type The node type. - * - * @see rtems_filesystem_instance_lock(). - */ -rtems_filesystem_node_types_t rtems_filesystem_node_type( - const rtems_filesystem_location_info_t *loc -); - -/** * @brief Releases all resources of a location. * * This function may block on a mutex and may complete an unmount process. @@ -919,6 +904,26 @@ static inline ssize_t rtems_libio_iovec_eval( return total; } +/** + * @brief Returns the file type of the file referenced by the filesystem + * location. + * + * @brief[in] loc The filesystem location. + * + * @return The type of the file or an invalid file type in case of an error. + */ +static inline mode_t rtems_filesystem_location_type( + const rtems_filesystem_location_info_t *loc +) +{ + struct stat st; + + st.st_mode = 0; + (void) ( *loc->handlers->fstat_h )( loc, &st ); + + return st.st_mode; +} + /** @} */ #ifdef __cplusplus |