diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-12-31 10:56:05 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-01-27 06:54:22 +0100 |
commit | cf36b70e8dd8755e7dac6eb516169f586e78566d (patch) | |
tree | 97200818ec5dfeaa4e137a572fcbb4db746842b1 /cpukit/libfs/src/imfs/deviceio.c | |
parent | user/conf.t: Fix typo (diff) | |
download | rtems-cf36b70e8dd8755e7dac6eb516169f586e78566d.tar.bz2 |
IMFS: Replace node union with individual struct
This reduces the average node size.
Add and use IMFS_GENERIC_INITIALIZER().
Diffstat (limited to 'cpukit/libfs/src/imfs/deviceio.c')
-rw-r--r-- | cpukit/libfs/src/imfs/deviceio.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/cpukit/libfs/src/imfs/deviceio.c b/cpukit/libfs/src/imfs/deviceio.c index cdb18eef07..4819e8080e 100644 --- a/cpukit/libfs/src/imfs/deviceio.c +++ b/cpukit/libfs/src/imfs/deviceio.c @@ -29,17 +29,15 @@ int device_open( mode_t mode ) { - IMFS_jnode_t *the_jnode; - - the_jnode = iop->pathinfo.node_access; + const IMFS_device_t *device = IMFS_iop_to_device( iop ); return rtems_deviceio_open( iop, pathname, oflag, mode, - the_jnode->info.device.major, - the_jnode->info.device.minor + device->major, + device->minor ); } @@ -47,14 +45,12 @@ int device_close( rtems_libio_t *iop ) { - IMFS_jnode_t *the_jnode; - - the_jnode = iop->pathinfo.node_access; + const IMFS_device_t *device = IMFS_iop_to_device( iop ); return rtems_deviceio_close( iop, - the_jnode->info.device.major, - the_jnode->info.device.minor + device->major, + device->minor ); } @@ -64,16 +60,14 @@ ssize_t device_read( size_t count ) { - IMFS_jnode_t *the_jnode; - - the_jnode = iop->pathinfo.node_access; + const IMFS_device_t *device = IMFS_iop_to_device( iop ); return rtems_deviceio_read( iop, buffer, count, - the_jnode->info.device.major, - the_jnode->info.device.minor + device->major, + device->minor ); } @@ -83,16 +77,14 @@ ssize_t device_write( size_t count ) { - IMFS_jnode_t *the_jnode; - - the_jnode = iop->pathinfo.node_access; + const IMFS_device_t *device = IMFS_iop_to_device( iop ); return rtems_deviceio_write( iop, buffer, count, - the_jnode->info.device.major, - the_jnode->info.device.minor + device->major, + device->minor ); } @@ -102,16 +94,14 @@ int device_ioctl( void *buffer ) { - IMFS_jnode_t *the_jnode; - - the_jnode = iop->pathinfo.node_access; + const IMFS_device_t *device = IMFS_iop_to_device( iop ); return rtems_deviceio_control( iop, command, buffer, - the_jnode->info.device.major, - the_jnode->info.device.minor + device->major, + device->minor ); } |