summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-01-31 21:25:57 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-02-04 19:31:55 +0100
commit95308caf587391f267de052260991e687db68a36 (patch)
tree281d4446a0510a97429e9ea9c2923f2dd6587a44
parentAdd rtems_filesystem_make_dev_t_from_pointer() (diff)
downloadrtems-95308caf587391f267de052260991e687db68a36.tar.bz2
IMFS: Use rtems_filesystem_make_dev_t_from_pointer
-rw-r--r--cpukit/libfs/src/imfs/imfs.h19
-rw-r--r--cpukit/libfs/src/imfs/imfs_initsupp.c3
-rw-r--r--cpukit/libfs/src/imfs/imfs_stat.c10
3 files changed, 3 insertions, 29 deletions
diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h
index b8ff29dc70..c296bffc06 100644
--- a/cpukit/libfs/src/imfs/imfs.h
+++ b/cpukit/libfs/src/imfs/imfs.h
@@ -228,19 +228,6 @@ typedef struct {
/**@{*/
/*
- * Major device number for the IMFS. This is not a real device number because
- * the IMFS is just a file system and does not have a driver.
- */
-#define IMFS_DEVICE_MAJOR_NUMBER (0xfffe)
-
-/**
- * @ingroup IMFSGenericNodes
- *
- * @brief Generic IMFS device major number.
- */
-#define IMFS_GENERIC_DEVICE_MAJOR_NUMBER (0xfffd)
-
-/*
* Maximum length of a "basename" of an IMFS file/node.
*/
@@ -385,7 +372,6 @@ static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode )
}
typedef struct {
- int instance;
ino_t ino_count;
const IMFS_node_control *node_controls [IMFS_TYPE_COUNT];
} IMFS_fs_info_t;
@@ -1008,10 +994,7 @@ static inline dev_t IMFS_generic_get_device_identifier_by_node(
const IMFS_jnode_t *node
)
{
- return rtems_filesystem_make_dev_t(
- IMFS_GENERIC_DEVICE_MAJOR_NUMBER,
- node->st_ino
- );
+ return rtems_filesystem_make_dev_t_from_pointer( node );
}
#ifdef __cplusplus
diff --git a/cpukit/libfs/src/imfs/imfs_initsupp.c b/cpukit/libfs/src/imfs/imfs_initsupp.c
index 5f857d1594..563d6203c3 100644
--- a/cpukit/libfs/src/imfs/imfs_initsupp.c
+++ b/cpukit/libfs/src/imfs/imfs_initsupp.c
@@ -61,15 +61,12 @@ int IMFS_initialize_support(
const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT]
)
{
- static int imfs_instance;
-
int rv = 0;
IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) );
if ( fs_info != NULL ) {
IMFS_jnode_t *root_node;
- fs_info->instance = imfs_instance++;
memcpy(
fs_info->node_controls,
node_controls,
diff --git a/cpukit/libfs/src/imfs/imfs_stat.c b/cpukit/libfs/src/imfs/imfs_stat.c
index 1499d2b83c..3d07fe8092 100644
--- a/cpukit/libfs/src/imfs/imfs_stat.c
+++ b/cpukit/libfs/src/imfs/imfs_stat.c
@@ -28,16 +28,10 @@ int IMFS_stat(
struct stat *buf
)
{
- IMFS_fs_info_t *fs_info = loc->mt_entry->fs_info;
+ const IMFS_fs_info_t *fs_info = loc->mt_entry->fs_info;
IMFS_jnode_t *the_jnode = loc->node_access;
- /*
- * The device number of the IMFS is the major number and the minor is the
- * instance.
- */
- buf->st_dev =
- rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance );
-
+ buf->st_dev = rtems_filesystem_make_dev_t_from_pointer( fs_info );
buf->st_mode = the_jnode->st_mode;
buf->st_nlink = the_jnode->st_nlink;
buf->st_ino = the_jnode->st_ino;