IMFS: Use rtems_filesystem_make_dev_t_from_pointer

This commit is contained in:
Sebastian Huber
2015-01-31 21:25:57 +01:00
parent 4c14ace6dd
commit 95308caf58
3 changed files with 3 additions and 29 deletions

View File

@@ -227,19 +227,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

View File

@@ -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,

View File

@@ -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;