From e998c9851848691e98b1b1043d8d90c06215961b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 5 Mar 2012 11:51:23 +0100 Subject: IMFS: Node specific stat handlers --- cpukit/libfs/src/imfs/imfs_stat.c | 54 --------------------------------------- 1 file changed, 54 deletions(-) (limited to 'cpukit/libfs/src/imfs/imfs_stat.c') diff --git a/cpukit/libfs/src/imfs/imfs_stat.c b/cpukit/libfs/src/imfs/imfs_stat.c index 42185f3683..d0ebc4cd0e 100644 --- a/cpukit/libfs/src/imfs/imfs_stat.c +++ b/cpukit/libfs/src/imfs/imfs_stat.c @@ -22,24 +22,6 @@ #include "imfs.h" -#include -#include - -static size_t IMFS_directory_size( const IMFS_jnode_t *the_jnode ) -{ - size_t size = 0; - const rtems_chain_control *chain = &the_jnode->info.directory.Entries; - const rtems_chain_node *current = rtems_chain_immutable_first( chain ); - const rtems_chain_node *tail = rtems_chain_immutable_tail( chain ); - - while ( current != tail ) { - size += sizeof(struct dirent); - current = rtems_chain_immutable_next( current ); - } - - return size; -} - int IMFS_stat( const rtems_filesystem_location_info_t *loc, struct stat *buf @@ -47,38 +29,6 @@ int IMFS_stat( { IMFS_fs_info_t *fs_info = loc->mt_entry->fs_info; IMFS_jnode_t *the_jnode = loc->node_access; - IMFS_device_t *io = &the_jnode->info.device; - - if ( IMFS_type( the_jnode ) == IMFS_HARD_LINK ) { - the_jnode = the_jnode->info.hard_link.link_node; - } - - switch ( IMFS_type( the_jnode ) ) { - - case IMFS_DEVICE: - buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); - break; - - case IMFS_LINEAR_FILE: - case IMFS_MEMORY_FILE: - buf->st_size = the_jnode->info.file.size; - break; - - case IMFS_DIRECTORY: - buf->st_size = IMFS_directory_size( the_jnode ); - break; - - case IMFS_SYM_LINK: - buf->st_size = strlen( the_jnode->info.sym_link.name ); - break; - - case IMFS_FIFO: - break; - - default: - rtems_set_errno_and_return_minus_one( ENOTSUP ); - break; - } /* * The device number of the IMFS is the major number and the minor is the @@ -97,9 +47,5 @@ int IMFS_stat( buf->st_mtime = the_jnode->stat_mtime; buf->st_ctime = the_jnode->stat_ctime; - if ( !IMFS_is_directory( the_jnode ) ) { - buf->st_blksize = imfs_rq_memfile_bytes_per_block; - } - return 0; } -- cgit v1.2.3