From 4a07d2b866a2104102215cbd196269dcce18c000 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Fri, 29 Oct 1999 15:19:13 +0000 Subject: Moved the rmnod callback from the operations table to the handler table. --- c/src/exec/libcsupport/include/rtems/libio.h | 10 +++++----- c/src/exec/libcsupport/src/rmdir.c | 4 ++-- c/src/exec/libfs/src/imfs/imfs_handlers_device.c | 3 ++- c/src/exec/libfs/src/imfs/imfs_handlers_directory.c | 11 ++++++++++- c/src/exec/libfs/src/imfs/imfs_handlers_memfile.c | 3 ++- c/src/exec/libfs/src/imfs/imfs_init.c | 1 - c/src/lib/include/rtems/libio.h | 10 +++++----- c/src/lib/libc/imfs_handlers_device.c | 3 ++- c/src/lib/libc/imfs_handlers_directory.c | 11 ++++++++++- c/src/lib/libc/imfs_handlers_memfile.c | 3 ++- c/src/lib/libc/imfs_init.c | 1 - c/src/lib/libc/libio.h | 10 +++++----- c/src/lib/libc/rmdir.c | 4 ++-- c/src/libfs/src/imfs/imfs_handlers_device.c | 3 ++- c/src/libfs/src/imfs/imfs_handlers_directory.c | 11 ++++++++++- c/src/libfs/src/imfs/imfs_handlers_memfile.c | 3 ++- c/src/libfs/src/imfs/imfs_init.c | 1 - 17 files changed, 61 insertions(+), 31 deletions(-) (limited to 'c') diff --git a/c/src/exec/libcsupport/include/rtems/libio.h b/c/src/exec/libcsupport/include/rtems/libio.h index c4e54c4132..5d71866164 100644 --- a/c/src/exec/libcsupport/include/rtems/libio.h +++ b/c/src/exec/libcsupport/include/rtems/libio.h @@ -121,6 +121,10 @@ typedef int (*rtems_filesystem_fcntl_t)( rtems_libio_t *iop ); +typedef int (*rtems_filesystem_rmnod_t)( + rtems_filesystem_location_info_t *pathloc /* IN */ +); + typedef struct { rtems_filesystem_open_t open; rtems_filesystem_close_t close; @@ -135,6 +139,7 @@ typedef struct { rtems_filesystem_fsync_t fsync; rtems_filesystem_fdatasync_t fdatasync; rtems_filesystem_fcntl_t fcntl; + rtems_filesystem_rmnod_t rmnod; } rtems_filesystem_file_handlers_r; /* @@ -193,10 +198,6 @@ typedef int (*rtems_filesystem_freenode_t)( rtems_filesystem_location_info_t *pathloc /* IN */ ); -typedef int (*rtems_filesystem_rmnod_t)( - rtems_filesystem_location_info_t *pathloc /* IN */ -); - typedef int (* rtems_filesystem_mount_t ) ( rtems_filesystem_mount_table_entry_t *mt_entry /* in */ ); @@ -254,7 +255,6 @@ typedef struct { rtems_filesystem_unlink_t unlink; rtems_filesystem_node_type_t node_type; rtems_filesystem_mknod_t mknod; - rtems_filesystem_rmnod_t rmnod; rtems_filesystem_chown_t chown; rtems_filesystem_freenode_t freenod; rtems_filesystem_mount_t mount; diff --git a/c/src/exec/libcsupport/src/rmdir.c b/c/src/exec/libcsupport/src/rmdir.c index 806176beaf..001d999ce2 100644 --- a/c/src/exec/libcsupport/src/rmdir.c +++ b/c/src/exec/libcsupport/src/rmdir.c @@ -53,12 +53,12 @@ int rmdir( * Use the filesystems rmnod to remove the node. */ - if ( !loc.ops->rmnod ){ + if ( !loc.handlers->rmnod ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->rmnod)( &loc ); + result = (*loc.handlers->rmnod)( &loc ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/exec/libfs/src/imfs/imfs_handlers_device.c b/c/src/exec/libfs/src/imfs/imfs_handlers_device.c index 38a6aca7d4..b6b9c808a0 100644 --- a/c/src/exec/libfs/src/imfs/imfs_handlers_device.c +++ b/c/src/exec/libfs/src/imfs/imfs_handlers_device.c @@ -33,5 +33,6 @@ rtems_filesystem_file_handlers_r IMFS_device_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ NULL, /* fdatasync */ - NULL /* fcntl */ + NULL, /* fcntl */ + IMFS_rmnod }; diff --git a/c/src/exec/libfs/src/imfs/imfs_handlers_directory.c b/c/src/exec/libfs/src/imfs/imfs_handlers_directory.c index 9f4e6a0e24..364f3cdf26 100644 --- a/c/src/exec/libfs/src/imfs/imfs_handlers_directory.c +++ b/c/src/exec/libfs/src/imfs/imfs_handlers_directory.c @@ -33,5 +33,14 @@ rtems_filesystem_file_handlers_r IMFS_directory_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ IMFS_fdatasync, - IMFS_fcntl + IMFS_fcntl, + IMFS_rmnod }; + + + + + + + + diff --git a/c/src/exec/libfs/src/imfs/imfs_handlers_memfile.c b/c/src/exec/libfs/src/imfs/imfs_handlers_memfile.c index 1e373b4745..f622c99558 100644 --- a/c/src/exec/libfs/src/imfs/imfs_handlers_memfile.c +++ b/c/src/exec/libfs/src/imfs/imfs_handlers_memfile.c @@ -33,5 +33,6 @@ rtems_filesystem_file_handlers_r IMFS_memfile_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ IMFS_fdatasync, - IMFS_fcntl + IMFS_fcntl, + IMFS_rmnod }; diff --git a/c/src/exec/libfs/src/imfs/imfs_init.c b/c/src/exec/libfs/src/imfs/imfs_init.c index 8f44a4e2cd..ad2781f63e 100644 --- a/c/src/exec/libfs/src/imfs/imfs_init.c +++ b/c/src/exec/libfs/src/imfs/imfs_init.c @@ -37,7 +37,6 @@ rtems_filesystem_operations_table IMFS_ops = { IMFS_unlink, IMFS_node_type, IMFS_mknod, - IMFS_rmnod, IMFS_chown, IMFS_freenodinfo, IMFS_mount, diff --git a/c/src/lib/include/rtems/libio.h b/c/src/lib/include/rtems/libio.h index c4e54c4132..5d71866164 100644 --- a/c/src/lib/include/rtems/libio.h +++ b/c/src/lib/include/rtems/libio.h @@ -121,6 +121,10 @@ typedef int (*rtems_filesystem_fcntl_t)( rtems_libio_t *iop ); +typedef int (*rtems_filesystem_rmnod_t)( + rtems_filesystem_location_info_t *pathloc /* IN */ +); + typedef struct { rtems_filesystem_open_t open; rtems_filesystem_close_t close; @@ -135,6 +139,7 @@ typedef struct { rtems_filesystem_fsync_t fsync; rtems_filesystem_fdatasync_t fdatasync; rtems_filesystem_fcntl_t fcntl; + rtems_filesystem_rmnod_t rmnod; } rtems_filesystem_file_handlers_r; /* @@ -193,10 +198,6 @@ typedef int (*rtems_filesystem_freenode_t)( rtems_filesystem_location_info_t *pathloc /* IN */ ); -typedef int (*rtems_filesystem_rmnod_t)( - rtems_filesystem_location_info_t *pathloc /* IN */ -); - typedef int (* rtems_filesystem_mount_t ) ( rtems_filesystem_mount_table_entry_t *mt_entry /* in */ ); @@ -254,7 +255,6 @@ typedef struct { rtems_filesystem_unlink_t unlink; rtems_filesystem_node_type_t node_type; rtems_filesystem_mknod_t mknod; - rtems_filesystem_rmnod_t rmnod; rtems_filesystem_chown_t chown; rtems_filesystem_freenode_t freenod; rtems_filesystem_mount_t mount; diff --git a/c/src/lib/libc/imfs_handlers_device.c b/c/src/lib/libc/imfs_handlers_device.c index 38a6aca7d4..b6b9c808a0 100644 --- a/c/src/lib/libc/imfs_handlers_device.c +++ b/c/src/lib/libc/imfs_handlers_device.c @@ -33,5 +33,6 @@ rtems_filesystem_file_handlers_r IMFS_device_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ NULL, /* fdatasync */ - NULL /* fcntl */ + NULL, /* fcntl */ + IMFS_rmnod }; diff --git a/c/src/lib/libc/imfs_handlers_directory.c b/c/src/lib/libc/imfs_handlers_directory.c index 9f4e6a0e24..364f3cdf26 100644 --- a/c/src/lib/libc/imfs_handlers_directory.c +++ b/c/src/lib/libc/imfs_handlers_directory.c @@ -33,5 +33,14 @@ rtems_filesystem_file_handlers_r IMFS_directory_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ IMFS_fdatasync, - IMFS_fcntl + IMFS_fcntl, + IMFS_rmnod }; + + + + + + + + diff --git a/c/src/lib/libc/imfs_handlers_memfile.c b/c/src/lib/libc/imfs_handlers_memfile.c index 1e373b4745..f622c99558 100644 --- a/c/src/lib/libc/imfs_handlers_memfile.c +++ b/c/src/lib/libc/imfs_handlers_memfile.c @@ -33,5 +33,6 @@ rtems_filesystem_file_handlers_r IMFS_memfile_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ IMFS_fdatasync, - IMFS_fcntl + IMFS_fcntl, + IMFS_rmnod }; diff --git a/c/src/lib/libc/imfs_init.c b/c/src/lib/libc/imfs_init.c index 8f44a4e2cd..ad2781f63e 100644 --- a/c/src/lib/libc/imfs_init.c +++ b/c/src/lib/libc/imfs_init.c @@ -37,7 +37,6 @@ rtems_filesystem_operations_table IMFS_ops = { IMFS_unlink, IMFS_node_type, IMFS_mknod, - IMFS_rmnod, IMFS_chown, IMFS_freenodinfo, IMFS_mount, diff --git a/c/src/lib/libc/libio.h b/c/src/lib/libc/libio.h index c4e54c4132..5d71866164 100644 --- a/c/src/lib/libc/libio.h +++ b/c/src/lib/libc/libio.h @@ -121,6 +121,10 @@ typedef int (*rtems_filesystem_fcntl_t)( rtems_libio_t *iop ); +typedef int (*rtems_filesystem_rmnod_t)( + rtems_filesystem_location_info_t *pathloc /* IN */ +); + typedef struct { rtems_filesystem_open_t open; rtems_filesystem_close_t close; @@ -135,6 +139,7 @@ typedef struct { rtems_filesystem_fsync_t fsync; rtems_filesystem_fdatasync_t fdatasync; rtems_filesystem_fcntl_t fcntl; + rtems_filesystem_rmnod_t rmnod; } rtems_filesystem_file_handlers_r; /* @@ -193,10 +198,6 @@ typedef int (*rtems_filesystem_freenode_t)( rtems_filesystem_location_info_t *pathloc /* IN */ ); -typedef int (*rtems_filesystem_rmnod_t)( - rtems_filesystem_location_info_t *pathloc /* IN */ -); - typedef int (* rtems_filesystem_mount_t ) ( rtems_filesystem_mount_table_entry_t *mt_entry /* in */ ); @@ -254,7 +255,6 @@ typedef struct { rtems_filesystem_unlink_t unlink; rtems_filesystem_node_type_t node_type; rtems_filesystem_mknod_t mknod; - rtems_filesystem_rmnod_t rmnod; rtems_filesystem_chown_t chown; rtems_filesystem_freenode_t freenod; rtems_filesystem_mount_t mount; diff --git a/c/src/lib/libc/rmdir.c b/c/src/lib/libc/rmdir.c index 806176beaf..001d999ce2 100644 --- a/c/src/lib/libc/rmdir.c +++ b/c/src/lib/libc/rmdir.c @@ -53,12 +53,12 @@ int rmdir( * Use the filesystems rmnod to remove the node. */ - if ( !loc.ops->rmnod ){ + if ( !loc.handlers->rmnod ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->rmnod)( &loc ); + result = (*loc.handlers->rmnod)( &loc ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/libfs/src/imfs/imfs_handlers_device.c b/c/src/libfs/src/imfs/imfs_handlers_device.c index 38a6aca7d4..b6b9c808a0 100644 --- a/c/src/libfs/src/imfs/imfs_handlers_device.c +++ b/c/src/libfs/src/imfs/imfs_handlers_device.c @@ -33,5 +33,6 @@ rtems_filesystem_file_handlers_r IMFS_device_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ NULL, /* fdatasync */ - NULL /* fcntl */ + NULL, /* fcntl */ + IMFS_rmnod }; diff --git a/c/src/libfs/src/imfs/imfs_handlers_directory.c b/c/src/libfs/src/imfs/imfs_handlers_directory.c index 9f4e6a0e24..364f3cdf26 100644 --- a/c/src/libfs/src/imfs/imfs_handlers_directory.c +++ b/c/src/libfs/src/imfs/imfs_handlers_directory.c @@ -33,5 +33,14 @@ rtems_filesystem_file_handlers_r IMFS_directory_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ IMFS_fdatasync, - IMFS_fcntl + IMFS_fcntl, + IMFS_rmnod }; + + + + + + + + diff --git a/c/src/libfs/src/imfs/imfs_handlers_memfile.c b/c/src/libfs/src/imfs/imfs_handlers_memfile.c index 1e373b4745..f622c99558 100644 --- a/c/src/libfs/src/imfs/imfs_handlers_memfile.c +++ b/c/src/libfs/src/imfs/imfs_handlers_memfile.c @@ -33,5 +33,6 @@ rtems_filesystem_file_handlers_r IMFS_memfile_handlers = { NULL, /* fpathconf */ NULL, /* fsync */ IMFS_fdatasync, - IMFS_fcntl + IMFS_fcntl, + IMFS_rmnod }; diff --git a/c/src/libfs/src/imfs/imfs_init.c b/c/src/libfs/src/imfs/imfs_init.c index 8f44a4e2cd..ad2781f63e 100644 --- a/c/src/libfs/src/imfs/imfs_init.c +++ b/c/src/libfs/src/imfs/imfs_init.c @@ -37,7 +37,6 @@ rtems_filesystem_operations_table IMFS_ops = { IMFS_unlink, IMFS_node_type, IMFS_mknod, - IMFS_rmnod, IMFS_chown, IMFS_freenodinfo, IMFS_mount, -- cgit v1.2.3