mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-26 05:00:00 +08:00
2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio.h: Changed rtems_filesystem_node_types_t to an enum. Declare rtems_filesystem_handlers_default, rtems_filesystem_operations_default, rtems_filesystem_default_evalpath(), rtems_filesystem_default_evalformake, and rtems_filesystem_default_node_type(). * libfs/src/dosfs/msdos.h: Fixed msdos_node_type() prototype. * libfs/src/defaults/default_evalformake.c, libfs/src/defaults/default_handlers.c, libfs/src/defaults/default_node_type.c, libfs/src/defaults/default_ops.c: New files. * libfs/Makefile.am: Reflect changes above.
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* libcsupport/include/rtems/libio.h: Changed
|
||||
rtems_filesystem_node_types_t to an enum. Declare
|
||||
rtems_filesystem_handlers_default,
|
||||
rtems_filesystem_operations_default,
|
||||
rtems_filesystem_default_evalpath(),
|
||||
rtems_filesystem_default_evalformake, and
|
||||
rtems_filesystem_default_node_type().
|
||||
* libfs/src/dosfs/msdos.h: Fixed msdos_node_type() prototype.
|
||||
* libfs/src/defaults/default_evalformake.c,
|
||||
libfs/src/defaults/default_handlers.c,
|
||||
libfs/src/defaults/default_node_type.c,
|
||||
libfs/src/defaults/default_ops.c: New files.
|
||||
* libfs/Makefile.am: Reflect changes above.
|
||||
|
||||
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libnetworking/rtems/rtems_syscall.c: Fix warning.
|
||||
|
||||
@@ -56,20 +56,16 @@ extern "C" {
|
||||
typedef _off64_t rtems_off64_t;
|
||||
|
||||
/**
|
||||
* @name File System Node Types
|
||||
*
|
||||
* @{
|
||||
* @brief File system node types.
|
||||
*/
|
||||
|
||||
#define RTEMS_FILESYSTEM_DIRECTORY 1
|
||||
#define RTEMS_FILESYSTEM_DEVICE 2
|
||||
#define RTEMS_FILESYSTEM_HARD_LINK 3
|
||||
#define RTEMS_FILESYSTEM_SYM_LINK 4
|
||||
#define RTEMS_FILESYSTEM_MEMORY_FILE 5
|
||||
|
||||
/** @} */
|
||||
|
||||
typedef int rtems_filesystem_node_types_t;
|
||||
typedef enum {
|
||||
RTEMS_FILESYSTEM_INVALID_NODE_TYPE,
|
||||
RTEMS_FILESYSTEM_DIRECTORY,
|
||||
RTEMS_FILESYSTEM_DEVICE,
|
||||
RTEMS_FILESYSTEM_HARD_LINK,
|
||||
RTEMS_FILESYSTEM_SYM_LINK,
|
||||
RTEMS_FILESYSTEM_MEMORY_FILE
|
||||
} rtems_filesystem_node_types_t;
|
||||
|
||||
/**
|
||||
* @name File System Node Operations
|
||||
@@ -360,6 +356,10 @@ struct _rtems_filesystem_file_handlers_r {
|
||||
*/
|
||||
rtems_filesystem_rmnod_t rmnod_h;
|
||||
};
|
||||
|
||||
extern const rtems_filesystem_file_handlers_r
|
||||
rtems_filesystem_handlers_default;
|
||||
|
||||
/**
|
||||
* This method defines the interface to the default open(2)
|
||||
* system call support which is provided by a file system
|
||||
@@ -892,10 +892,29 @@ struct _rtems_filesystem_operations_table {
|
||||
rtems_filesystem_statvfs_t statvfs_h;
|
||||
};
|
||||
|
||||
/*
|
||||
* @brief Default filesystem evalpath
|
||||
*/
|
||||
extern const rtems_filesystem_operations_table
|
||||
rtems_filesystem_operations_default;
|
||||
|
||||
/**
|
||||
* @brief Provides a defualt routine for filesystem
|
||||
* implementation of path evaluation.
|
||||
*/
|
||||
int rtems_filesystem_default_evalpath(
|
||||
const char *pathname,
|
||||
size_t pathnamelen,
|
||||
int flags,
|
||||
rtems_filesystem_location_info_t *pathloc
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Provides a defualt routine for filesystem
|
||||
* implementation of path evaluation for make.
|
||||
*/
|
||||
int rtems_filesystem_default_evalformake(
|
||||
const char *path,
|
||||
rtems_filesystem_location_info_t *pathloc,
|
||||
const char **name
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Provides a defualt routine for filesystem
|
||||
@@ -916,6 +935,14 @@ int rtems_filesystem_default_unlink(
|
||||
rtems_filesystem_location_info_t *pathloc /* IN */
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Provides a defualt routine for filesystem
|
||||
* implementation to determine the node type.
|
||||
*/
|
||||
rtems_filesystem_node_types_t rtems_filesystem_default_node_type(
|
||||
rtems_filesystem_location_info_t *pathloc
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Provides a defualt routine for filesystem
|
||||
* implementation to create a new node.
|
||||
|
||||
@@ -30,7 +30,9 @@ libdefaultfs_a_SOURCES = \
|
||||
src/defaults/default_write.c src/defaults/default_fpathconf.c \
|
||||
src/defaults/default_unmount.c src/defaults/default_evaluate_link.c \
|
||||
src/defaults/default_open.c src/defaults/default_close.c \
|
||||
src/defaults/default_fsunmount.c src/defaults/default_mknod.c
|
||||
src/defaults/default_fsunmount.c src/defaults/default_mknod.c \
|
||||
src/defaults/default_node_type.c src/defaults/default_evalformake.c \
|
||||
src/defaults/default_handlers.c src/defaults/default_ops.c
|
||||
|
||||
noinst_LIBRARIES += libimfs.a
|
||||
libimfs_a_SOURCES =
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief rtems_filesystem_default_evalformake() implementation.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* D-82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/libio.h>
|
||||
#include <rtems/seterr.h>
|
||||
|
||||
int rtems_filesystem_default_evalformake(
|
||||
const char *path,
|
||||
rtems_filesystem_location_info_t *pathloc,
|
||||
const char **name
|
||||
)
|
||||
{
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief rtems_filesystem_handlers_default definition.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* D-82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/libio.h>
|
||||
|
||||
const rtems_filesystem_file_handlers_r rtems_filesystem_handlers_default = {
|
||||
.open_h = rtems_filesystem_default_open,
|
||||
.close_h = rtems_filesystem_default_close,
|
||||
.read_h = rtems_filesystem_default_read,
|
||||
.write_h = rtems_filesystem_default_write,
|
||||
.ioctl_h = rtems_filesystem_default_ioctl,
|
||||
.lseek_h = rtems_filesystem_default_lseek,
|
||||
.fstat_h = rtems_filesystem_default_fstat,
|
||||
.fchmod_h = rtems_filesystem_default_fchmod,
|
||||
.ftruncate_h = rtems_filesystem_default_ftruncate,
|
||||
.fpathconf_h = rtems_filesystem_default_fpathconf,
|
||||
.fsync_h = rtems_filesystem_default_fsync,
|
||||
.fdatasync_h = rtems_filesystem_default_fdatasync,
|
||||
.fcntl_h = rtems_filesystem_default_fcntl,
|
||||
.rmnod_h = rtems_filesystem_default_rmnod
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief rtems_filesystem_default_node_type() implementation.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* D-82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/libio.h>
|
||||
|
||||
rtems_filesystem_node_types_t rtems_filesystem_default_node_type(
|
||||
rtems_filesystem_location_info_t *pathloc
|
||||
)
|
||||
{
|
||||
return RTEMS_FILESYSTEM_INVALID_NODE_TYPE;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief rtems_filesystem_operations_default definition.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* D-82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/libio.h>
|
||||
|
||||
const rtems_filesystem_operations_table rtems_filesystem_operations_default = {
|
||||
.evalpath_h = rtems_filesystem_default_evalpath,
|
||||
.evalformake_h = rtems_filesystem_default_evalformake,
|
||||
.link_h = rtems_filesystem_default_link,
|
||||
.unlink_h = rtems_filesystem_default_unlink,
|
||||
.node_type_h = rtems_filesystem_default_node_type,
|
||||
.mknod_h = rtems_filesystem_default_mknod,
|
||||
.chown_h = rtems_filesystem_default_chown,
|
||||
.freenod_h = rtems_filesystem_default_freenode,
|
||||
.mount_h = rtems_filesystem_default_mount,
|
||||
.fsmount_me_h = rtems_filesystem_default_fsmount,
|
||||
.unmount_h = rtems_filesystem_default_unmount,
|
||||
.fsunmount_me_h = rtems_filesystem_default_fsunmount,
|
||||
.utime_h = rtems_filesystem_default_utime,
|
||||
.eval_link_h = rtems_filesystem_default_evaluate_link,
|
||||
.symlink_h = rtems_filesystem_default_symlink,
|
||||
.readlink_h = rtems_filesystem_default_readlink,
|
||||
.rename_h = rtems_filesystem_default_rename,
|
||||
.statvfs_h = rtems_filesystem_default_statvfs
|
||||
};
|
||||
@@ -242,7 +242,7 @@ int msdos_unlink(rtems_filesystem_location_info_t *pathloc /* IN */);
|
||||
|
||||
int msdos_free_node_info(rtems_filesystem_location_info_t *pathloc /* IN */);
|
||||
|
||||
int msdos_node_type(rtems_filesystem_location_info_t *pathloc);
|
||||
rtems_filesystem_node_types_t msdos_node_type(rtems_filesystem_location_info_t *pathloc);
|
||||
|
||||
int msdos_mknod(
|
||||
const char *path, /* IN */
|
||||
|
||||
Reference in New Issue
Block a user