From 937ab62c3070f76e26c14d25d705d9167136f26c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 15 Jun 1999 22:16:30 +0000 Subject: After comments D. V. Henkel-Wallace , the interface to mount() was changed to avoid the use of a string as the options. --- c/src/exec/libcsupport/include/rtems/libio.h | 2 +- c/src/exec/libcsupport/src/base_fs.c | 2 +- c/src/exec/libcsupport/src/mount.c | 38 +++------------------------- c/src/exec/libnetworking/lib/tftpDriver.c | 2 +- c/src/lib/include/rtems/libio.h | 2 +- c/src/lib/libc/base_fs.c | 2 +- c/src/lib/libc/libio.h | 2 +- c/src/lib/libc/mount.c | 38 +++------------------------- c/src/lib/libnetworking/lib/tftpDriver.c | 2 +- c/src/libnetworking/lib/tftpDriver.c | 2 +- 10 files changed, 14 insertions(+), 78 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 e3b0e5316e..653d247742 100644 --- a/c/src/exec/libcsupport/include/rtems/libio.h +++ b/c/src/exec/libcsupport/include/rtems/libio.h @@ -562,7 +562,7 @@ int unmount( int mount( rtems_filesystem_mount_table_entry_t **mt_entry, rtems_filesystem_operations_table *fs_ops, - char *fsoptions, + rtems_filesystem_options_t fsoptions, char *device, char *mount_point ); diff --git a/c/src/exec/libcsupport/src/base_fs.c b/c/src/exec/libcsupport/src/base_fs.c index a3bb196482..e5f53c042b 100644 --- a/c/src/exec/libcsupport/src/base_fs.c +++ b/c/src/exec/libcsupport/src/base_fs.c @@ -55,7 +55,7 @@ void rtems_filesystem_initialize( void ) status = mount( &first_entry, &IMFS_ops, - "RW", + RTEMS_FILESYSTEM_READ_WRITE, NULL, NULL ); if( status == -1 ){ diff --git a/c/src/exec/libcsupport/src/mount.c b/c/src/exec/libcsupport/src/mount.c index c4b62c3a28..ed15881494 100644 --- a/c/src/exec/libcsupport/src/mount.c +++ b/c/src/exec/libcsupport/src/mount.c @@ -60,11 +60,6 @@ int search_mt_for_mount_point( rtems_filesystem_location_info_t *location_of_mount_point ); - -rtems_filesystem_options_t get_file_system_options( - char *fsoptions -); - int init_fs_mount_table( void ); @@ -93,7 +88,7 @@ int init_fs_mount_table( void ); int mount( rtems_filesystem_mount_table_entry_t **mt_entry, rtems_filesystem_operations_table *fs_ops, - char *fsoptions, + rtems_filesystem_options_t fsoptions, char *device, char *mount_point ) @@ -117,13 +112,8 @@ int mount( * Are the file system options valid? */ - if ( fsoptions == NULL ) { - errno = EINVAL; - return -1; - } - - options = get_file_system_options( fsoptions ); - if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ) { + if ( fsoptions != RTEMS_FILESYSTEM_READ_ONLY && + fsoptions != RTEMS_FILESYSTEM_READ_WRITE ) { errno = EINVAL; return -1; } @@ -257,28 +247,6 @@ int init_fs_mount_table() return 0; } -/* - * get_file_system_options - * - * This routine will determine is the text string that represents the options - * that are to be used to mount the file system are actually valid. If the - * options are valid the appropriate file system options type will be returned - * to the calling routine. - */ - -rtems_filesystem_options_t get_file_system_options( - char *fsoptions -) -{ - if ( strcasecmp( "RO", fsoptions ) == 0 ) - return RTEMS_FILESYSTEM_READ_ONLY; - if ( strcasecmp( "RW", fsoptions ) == 0 ) - return RTEMS_FILESYSTEM_READ_WRITE; - else - return RTEMS_FILESYSTEM_BAD_OPTIONS; -} - - /* * search_mt_for_mount_point diff --git a/c/src/exec/libnetworking/lib/tftpDriver.c b/c/src/exec/libnetworking/lib/tftpDriver.c index a14a7d0365..d9995019f8 100644 --- a/c/src/exec/libnetworking/lib/tftpDriver.c +++ b/c/src/exec/libnetworking/lib/tftpDriver.c @@ -234,7 +234,7 @@ int rtems_bsdnet_initialize_tftp_filesystem () status = mount( &entry, &rtems_tftp_ops, - "RO", + RTEMS_FILESYSTEM_READ_ONLY, NULL, TFTP_PATHNAME_PREFIX ); diff --git a/c/src/lib/include/rtems/libio.h b/c/src/lib/include/rtems/libio.h index e3b0e5316e..653d247742 100644 --- a/c/src/lib/include/rtems/libio.h +++ b/c/src/lib/include/rtems/libio.h @@ -562,7 +562,7 @@ int unmount( int mount( rtems_filesystem_mount_table_entry_t **mt_entry, rtems_filesystem_operations_table *fs_ops, - char *fsoptions, + rtems_filesystem_options_t fsoptions, char *device, char *mount_point ); diff --git a/c/src/lib/libc/base_fs.c b/c/src/lib/libc/base_fs.c index a3bb196482..e5f53c042b 100644 --- a/c/src/lib/libc/base_fs.c +++ b/c/src/lib/libc/base_fs.c @@ -55,7 +55,7 @@ void rtems_filesystem_initialize( void ) status = mount( &first_entry, &IMFS_ops, - "RW", + RTEMS_FILESYSTEM_READ_WRITE, NULL, NULL ); if( status == -1 ){ diff --git a/c/src/lib/libc/libio.h b/c/src/lib/libc/libio.h index e3b0e5316e..653d247742 100644 --- a/c/src/lib/libc/libio.h +++ b/c/src/lib/libc/libio.h @@ -562,7 +562,7 @@ int unmount( int mount( rtems_filesystem_mount_table_entry_t **mt_entry, rtems_filesystem_operations_table *fs_ops, - char *fsoptions, + rtems_filesystem_options_t fsoptions, char *device, char *mount_point ); diff --git a/c/src/lib/libc/mount.c b/c/src/lib/libc/mount.c index c4b62c3a28..ed15881494 100644 --- a/c/src/lib/libc/mount.c +++ b/c/src/lib/libc/mount.c @@ -60,11 +60,6 @@ int search_mt_for_mount_point( rtems_filesystem_location_info_t *location_of_mount_point ); - -rtems_filesystem_options_t get_file_system_options( - char *fsoptions -); - int init_fs_mount_table( void ); @@ -93,7 +88,7 @@ int init_fs_mount_table( void ); int mount( rtems_filesystem_mount_table_entry_t **mt_entry, rtems_filesystem_operations_table *fs_ops, - char *fsoptions, + rtems_filesystem_options_t fsoptions, char *device, char *mount_point ) @@ -117,13 +112,8 @@ int mount( * Are the file system options valid? */ - if ( fsoptions == NULL ) { - errno = EINVAL; - return -1; - } - - options = get_file_system_options( fsoptions ); - if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ) { + if ( fsoptions != RTEMS_FILESYSTEM_READ_ONLY && + fsoptions != RTEMS_FILESYSTEM_READ_WRITE ) { errno = EINVAL; return -1; } @@ -257,28 +247,6 @@ int init_fs_mount_table() return 0; } -/* - * get_file_system_options - * - * This routine will determine is the text string that represents the options - * that are to be used to mount the file system are actually valid. If the - * options are valid the appropriate file system options type will be returned - * to the calling routine. - */ - -rtems_filesystem_options_t get_file_system_options( - char *fsoptions -) -{ - if ( strcasecmp( "RO", fsoptions ) == 0 ) - return RTEMS_FILESYSTEM_READ_ONLY; - if ( strcasecmp( "RW", fsoptions ) == 0 ) - return RTEMS_FILESYSTEM_READ_WRITE; - else - return RTEMS_FILESYSTEM_BAD_OPTIONS; -} - - /* * search_mt_for_mount_point diff --git a/c/src/lib/libnetworking/lib/tftpDriver.c b/c/src/lib/libnetworking/lib/tftpDriver.c index a14a7d0365..d9995019f8 100644 --- a/c/src/lib/libnetworking/lib/tftpDriver.c +++ b/c/src/lib/libnetworking/lib/tftpDriver.c @@ -234,7 +234,7 @@ int rtems_bsdnet_initialize_tftp_filesystem () status = mount( &entry, &rtems_tftp_ops, - "RO", + RTEMS_FILESYSTEM_READ_ONLY, NULL, TFTP_PATHNAME_PREFIX ); diff --git a/c/src/libnetworking/lib/tftpDriver.c b/c/src/libnetworking/lib/tftpDriver.c index a14a7d0365..d9995019f8 100644 --- a/c/src/libnetworking/lib/tftpDriver.c +++ b/c/src/libnetworking/lib/tftpDriver.c @@ -234,7 +234,7 @@ int rtems_bsdnet_initialize_tftp_filesystem () status = mount( &entry, &rtems_tftp_ops, - "RO", + RTEMS_FILESYSTEM_READ_ONLY, NULL, TFTP_PATHNAME_PREFIX ); -- cgit v1.2.3