summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c/src/lib/libbsp/shared/umon/tfsDriver.c2
-rw-r--r--cpukit/include/rtems/fs.h1
-rw-r--r--cpukit/libcsupport/include/rtems/libio.h5
-rw-r--r--cpukit/libcsupport/include/rtems/libio_.h14
-rw-r--r--cpukit/libcsupport/src/__usrenv.c2
-rw-r--r--cpukit/libcsupport/src/_rename_r.c2
-rw-r--r--cpukit/libcsupport/src/chmod.c2
-rw-r--r--cpukit/libcsupport/src/chown.c7
-rw-r--r--cpukit/libcsupport/src/chroot.c4
-rw-r--r--cpukit/libcsupport/src/clonenode.c2
-rw-r--r--cpukit/libcsupport/src/fchmod.c2
-rw-r--r--cpukit/libcsupport/src/fchown.c6
-rw-r--r--cpukit/libcsupport/src/freenode.c2
-rw-r--r--cpukit/libcsupport/src/link.c2
-rw-r--r--cpukit/libcsupport/src/mknod.c4
-rw-r--r--cpukit/libcsupport/src/mount.c4
-rw-r--r--cpukit/libcsupport/src/open.c2
-rw-r--r--cpukit/libcsupport/src/readlink.c6
-rw-r--r--cpukit/libcsupport/src/rmdir.c9
-rw-r--r--cpukit/libcsupport/src/statvfs.c2
-rw-r--r--cpukit/libcsupport/src/sup_fs_eval_path.c6
-rw-r--r--cpukit/libcsupport/src/sup_fs_eval_path_generic.c10
-rw-r--r--cpukit/libcsupport/src/sup_fs_location.c3
-rw-r--r--cpukit/libcsupport/src/sup_fs_node_type.c2
-rw-r--r--cpukit/libcsupport/src/symlink.c2
-rw-r--r--cpukit/libcsupport/src/unlink.c6
-rw-r--r--cpukit/libcsupport/src/unmount.c5
-rw-r--r--cpukit/libcsupport/src/utime.c2
-rw-r--r--cpukit/libfs/src/devfs/devfs_init.c2
-rw-r--r--cpukit/libfs/src/devfs/devfs_show.c2
-rw-r--r--cpukit/libfs/src/dosfs/msdos_initsupp.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_initsupp.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_load_tar.c6
-rw-r--r--cpukit/libfs/src/nfsclient/src/nfs.c2
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-rtems.c5
-rw-r--r--cpukit/libnetworking/lib/ftpfs.c2
-rw-r--r--cpukit/libnetworking/lib/tftpDriver.c2
-rw-r--r--cpukit/libnetworking/rtems/rtems_syscall.c1
-rw-r--r--testsuites/fstests/fsnofs01/init.c1
39 files changed, 77 insertions, 66 deletions
diff --git a/c/src/lib/libbsp/shared/umon/tfsDriver.c b/c/src/lib/libbsp/shared/umon/tfsDriver.c
index 426d9baee7..20e588329b 100644
--- a/c/src/lib/libbsp/shared/umon/tfsDriver.c
+++ b/c/src/lib/libbsp/shared/umon/tfsDriver.c
@@ -92,8 +92,8 @@ static int rtems_tfs_mount_me(
rtems_set_errno_and_return_minus_one(ENOMEM);
}
+ mt_entry->ops = &rtems_tfs_ops;
mt_entry->mt_fs_root->location.handlers = &rtems_tfs_handlers;
- mt_entry->mt_fs_root->location.ops = &rtems_tfs_ops;
mt_entry->mt_fs_root->location.node_access = root_path;
return 0;
diff --git a/cpukit/include/rtems/fs.h b/cpukit/include/rtems/fs.h
index 7e4dff9cad..6270877ee5 100644
--- a/cpukit/include/rtems/fs.h
+++ b/cpukit/include/rtems/fs.h
@@ -53,7 +53,6 @@ typedef struct rtems_filesystem_location_info_tt {
void *node_access;
void *node_access_2;
const rtems_filesystem_file_handlers_r *handlers;
- const rtems_filesystem_operations_table *ops;
rtems_filesystem_mount_table_entry_t *mt_entry;
} rtems_filesystem_location_info_t;
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index 44dd847ebb..0e74c4c7fe 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -1431,13 +1431,14 @@ extern int rtems_mkdir(const char *path, mode_t mode);
*/
struct rtems_filesystem_mount_table_entry_tt {
rtems_chain_node mt_node;
+ void *fs_info;
+ const rtems_filesystem_operations_table *ops;
+ const void *immutable_fs_info;
rtems_chain_control location_chain;
rtems_filesystem_global_location_t *mt_point_node;
rtems_filesystem_global_location_t *mt_fs_root;
bool mounted;
bool writeable;
- void *fs_info;
- const void *immutable_fs_info;
rtems_filesystem_limits_and_options_t pathconf_limits_and_options;
/*
diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h
index 3e2139f450..418f4a31ec 100644
--- a/cpukit/libcsupport/include/rtems/libio_.h
+++ b/cpukit/libcsupport/include/rtems/libio_.h
@@ -250,14 +250,18 @@ static inline void rtems_filesystem_instance_lock(
const rtems_filesystem_location_info_t *loc
)
{
- (*loc->ops->lock_h)( loc->mt_entry );
+ const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
+
+ (*mt_entry->ops->lock_h)( mt_entry );
}
static inline void rtems_filesystem_instance_unlock(
const rtems_filesystem_location_info_t *loc
)
{
- (*loc->ops->unlock_h)( loc->mt_entry );
+ const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
+
+ (*mt_entry->ops->unlock_h)( mt_entry );
}
/*
@@ -582,9 +586,11 @@ static inline bool rtems_filesystem_location_is_root(
const rtems_filesystem_location_info_t *loc
)
{
- return (*loc->ops->are_nodes_equal_h)(
+ const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
+
+ return (*mt_entry->ops->are_nodes_equal_h)(
loc,
- &loc->mt_entry->mt_fs_root->location
+ &mt_entry->mt_fs_root->location
);
}
diff --git a/cpukit/libcsupport/src/__usrenv.c b/cpukit/libcsupport/src/__usrenv.c
index 73d2b06366..6a793755ab 100644
--- a/cpukit/libcsupport/src/__usrenv.c
+++ b/cpukit/libcsupport/src/__usrenv.c
@@ -220,6 +220,7 @@ rtems_filesystem_mount_table_entry_t rtems_filesystem_null_mt_entry = {
.fill = &rtems_filesystem_global_location_null.location.mt_entry_node,
}
},
+ .ops = &null_ops,
.mt_point_node = &rtems_filesystem_global_location_null,
.mt_fs_root = &rtems_filesystem_global_location_null,
.mounted = false,
@@ -233,7 +234,6 @@ rtems_filesystem_global_location_t rtems_filesystem_global_location_null = {
.previous = &rtems_filesystem_null_mt_entry.location_chain.Head.Node
},
.handlers = &rtems_filesystem_null_handlers,
- .ops = &null_ops,
.mt_entry = &rtems_filesystem_null_mt_entry
},
diff --git a/cpukit/libcsupport/src/_rename_r.c b/cpukit/libcsupport/src/_rename_r.c
index 45ba0adb6b..007f2499c4 100644
--- a/cpukit/libcsupport/src/_rename_r.c
+++ b/cpukit/libcsupport/src/_rename_r.c
@@ -57,7 +57,7 @@ int _rename_r(
new_currentloc
);
if ( rv == 0 ) {
- rv = (*new_currentloc->ops->rename_h)(
+ rv = (*new_currentloc->mt_entry->ops->rename_h)(
&old_parentloc,
old_currentloc,
new_currentloc,
diff --git a/cpukit/libcsupport/src/chmod.c b/cpukit/libcsupport/src/chmod.c
index 73333fe831..47de601b98 100644
--- a/cpukit/libcsupport/src/chmod.c
+++ b/cpukit/libcsupport/src/chmod.c
@@ -25,7 +25,7 @@ int chmod( const char *path, mode_t mode )
const rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
- rv = (*currentloc->ops->fchmod_h)( currentloc, mode );
+ rv = (*currentloc->mt_entry->ops->fchmod_h)( currentloc, mode );
rtems_filesystem_eval_path_cleanup( &ctx );
diff --git a/cpukit/libcsupport/src/chown.c b/cpukit/libcsupport/src/chown.c
index fa677cbe9c..7cc03a2a07 100644
--- a/cpukit/libcsupport/src/chown.c
+++ b/cpukit/libcsupport/src/chown.c
@@ -32,12 +32,9 @@ int rtems_filesystem_chown(
int eval_flags = eval_follow_link;
const rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
+ const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
- rv = (*currentloc->ops->chown_h)(
- currentloc,
- owner,
- group
- );
+ rv = (*ops->chown_h)( currentloc, owner, group );
rtems_filesystem_eval_path_cleanup( &ctx );
diff --git a/cpukit/libcsupport/src/chroot.c b/cpukit/libcsupport/src/chroot.c
index 11ae8fce7a..9e63704f95 100644
--- a/cpukit/libcsupport/src/chroot.c
+++ b/cpukit/libcsupport/src/chroot.c
@@ -49,7 +49,9 @@ int chroot( const char *path )
rtems_filesystem_global_location_t *new_root_loc =
rtems_filesystem_global_location_obtain( &new_current_loc );
rtems_filesystem_node_types_t type =
- (*new_root_loc->location.ops->node_type_h)( &new_root_loc->location );
+ (*new_root_loc->location.mt_entry->ops->node_type_h)(
+ &new_root_loc->location
+ );
if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
sc = rtems_libio_set_private_env();
diff --git a/cpukit/libcsupport/src/clonenode.c b/cpukit/libcsupport/src/clonenode.c
index 380ad90699..0ac7c9ef40 100644
--- a/cpukit/libcsupport/src/clonenode.c
+++ b/cpukit/libcsupport/src/clonenode.c
@@ -26,7 +26,7 @@ void rtems_filesystem_location_clone(
int rv = 0;
clone = rtems_filesystem_location_copy( clone, master );
- rv = (*clone->ops->clonenod_h)( clone );
+ rv = (*clone->mt_entry->ops->clonenod_h)( clone );
if ( rv != 0 ) {
rtems_filesystem_location_remove_from_mt_entry( clone );
rtems_filesystem_location_initialize_to_null( clone );
diff --git a/cpukit/libcsupport/src/fchmod.c b/cpukit/libcsupport/src/fchmod.c
index e2f166a8ab..944873817d 100644
--- a/cpukit/libcsupport/src/fchmod.c
+++ b/cpukit/libcsupport/src/fchmod.c
@@ -28,7 +28,7 @@ int fchmod( int fd, mode_t mode )
if (iop->pathinfo.mt_entry->writeable) {
rtems_filesystem_instance_lock( &iop->pathinfo );
- rv = (*iop->pathinfo.ops->fchmod_h)( &iop->pathinfo, mode );
+ rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode );
rtems_filesystem_instance_unlock( &iop->pathinfo );
} else {
errno = EROFS;
diff --git a/cpukit/libcsupport/src/fchown.c b/cpukit/libcsupport/src/fchown.c
index bacdbacfd8..6dfbc52ff3 100644
--- a/cpukit/libcsupport/src/fchown.c
+++ b/cpukit/libcsupport/src/fchown.c
@@ -28,7 +28,11 @@ int fchown( int fd, uid_t owner, gid_t group )
if (iop->pathinfo.mt_entry->writeable) {
rtems_filesystem_instance_lock( &iop->pathinfo );
- rv = (*iop->pathinfo.ops->chown_h)( &iop->pathinfo, owner, group );
+ rv = (*iop->pathinfo.mt_entry->ops->chown_h)(
+ &iop->pathinfo,
+ owner,
+ group
+ );
rtems_filesystem_instance_unlock( &iop->pathinfo );
} else {
errno = EROFS;
diff --git a/cpukit/libcsupport/src/freenode.c b/cpukit/libcsupport/src/freenode.c
index 28913a4e7d..84e58256d2 100644
--- a/cpukit/libcsupport/src/freenode.c
+++ b/cpukit/libcsupport/src/freenode.c
@@ -21,7 +21,7 @@
void rtems_filesystem_location_free( rtems_filesystem_location_info_t *loc )
{
rtems_filesystem_instance_lock( loc );
- (*loc->ops->freenod_h)( loc );
+ (*loc->mt_entry->ops->freenod_h)( loc );
rtems_filesystem_instance_unlock( loc );
rtems_filesystem_location_remove_from_mt_entry( loc );
}
diff --git a/cpukit/libcsupport/src/link.c b/cpukit/libcsupport/src/link.c
index 19ca2d6776..c16e7a018e 100644
--- a/cpukit/libcsupport/src/link.c
+++ b/cpukit/libcsupport/src/link.c
@@ -36,7 +36,7 @@ int link( const char *path1, const char *path2 )
currentloc_2
);
if ( rv == 0 ) {
- rv = (*currentloc_2->ops->link_h)(
+ rv = (*currentloc_2->mt_entry->ops->link_h)(
currentloc_2,
currentloc_1,
rtems_filesystem_eval_path_get_token( &ctx_2 ),
diff --git a/cpukit/libcsupport/src/mknod.c b/cpukit/libcsupport/src/mknod.c
index c9dc1d7ece..6a63455d81 100644
--- a/cpukit/libcsupport/src/mknod.c
+++ b/cpukit/libcsupport/src/mknod.c
@@ -47,7 +47,9 @@ int rtems_filesystem_mknod(
}
if ( rv == 0 ) {
- rv = (*parentloc->ops->mknod_h)( parentloc, name, namelen, mode, dev );
+ const rtems_filesystem_operations_table *ops = parentloc->mt_entry->ops;
+
+ rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
}
return rv;
diff --git a/cpukit/libcsupport/src/mount.c b/cpukit/libcsupport/src/mount.c
index 52886d15b6..4563bdbf24 100644
--- a/cpukit/libcsupport/src/mount.c
+++ b/cpukit/libcsupport/src/mount.c
@@ -122,7 +122,7 @@ static int register_subordinate_file_system(
rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc );
mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc );
mt_entry->mt_point_node = mt_point_node;
- rv = (*mt_point_node->location.ops->mount_h)( mt_entry );
+ rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry );
if ( rv == 0 ) {
rtems_filesystem_mt_lock();
rtems_chain_append_unprotected(
@@ -218,7 +218,7 @@ int mount(
}
if ( rv != 0 ) {
- (*mt_entry->mt_fs_root->location.ops->fsunmount_me_h)( mt_entry );
+ (*mt_entry->ops->fsunmount_me_h)( mt_entry );
}
}
diff --git a/cpukit/libcsupport/src/open.c b/cpukit/libcsupport/src/open.c
index 6bfbd53202..02436b66e7 100644
--- a/cpukit/libcsupport/src/open.c
+++ b/cpukit/libcsupport/src/open.c
@@ -85,7 +85,7 @@ static int do_open(
const rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc( &ctx );
rtems_filesystem_node_types_t type =
- (*currentloc->ops->node_type_h)( currentloc );
+ (*currentloc->mt_entry->ops->node_type_h)( currentloc );
if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
rtems_filesystem_eval_path_error( &ctx, EISDIR );
diff --git a/cpukit/libcsupport/src/readlink.c b/cpukit/libcsupport/src/readlink.c
index 3e7a831295..2cafcca10d 100644
--- a/cpukit/libcsupport/src/readlink.c
+++ b/cpukit/libcsupport/src/readlink.c
@@ -24,11 +24,11 @@ ssize_t readlink( const char *path, char *buf, size_t bufsize )
int eval_flags = RTEMS_FS_FOLLOW_HARD_LINK;
const rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
- rtems_filesystem_node_types_t type =
- (*currentloc->ops->node_type_h)( currentloc );
+ const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
+ rtems_filesystem_node_types_t type = (*ops->node_type_h)( currentloc );
if ( type == RTEMS_FILESYSTEM_SYM_LINK ) {
- rv = (*currentloc->ops->readlink_h)( currentloc, buf, bufsize );
+ rv = (*ops->readlink_h)( currentloc, buf, bufsize );
} else {
rtems_filesystem_eval_path_error( &ctx, EINVAL );
rv = -1;
diff --git a/cpukit/libcsupport/src/rmdir.c b/cpukit/libcsupport/src/rmdir.c
index 9b54987e79..4e7baf5e39 100644
--- a/cpukit/libcsupport/src/rmdir.c
+++ b/cpukit/libcsupport/src/rmdir.c
@@ -34,14 +34,11 @@ int rmdir( const char *path )
&parentloc,
parent_eval_flags
);
- rtems_filesystem_node_types_t type =
- (*currentloc->ops->node_type_h)( currentloc );
+ const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
+ rtems_filesystem_node_types_t type = (*ops->node_type_h)( currentloc );
if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
- rv = (*currentloc->ops->rmnod_h)(
- &parentloc,
- currentloc
- );
+ rv = (*ops->rmnod_h)( &parentloc, currentloc );
} else {
rtems_filesystem_eval_path_error( &ctx, ENOTDIR );
rv = -1;
diff --git a/cpukit/libcsupport/src/statvfs.c b/cpukit/libcsupport/src/statvfs.c
index b944b631eb..163d51eb1a 100644
--- a/cpukit/libcsupport/src/statvfs.c
+++ b/cpukit/libcsupport/src/statvfs.c
@@ -29,7 +29,7 @@ int statvfs( const char *path, struct statvfs *buf )
memset( buf, 0, sizeof( *buf ) );
- rv = (*currentloc->ops->statvfs_h)( currentloc, buf );
+ rv = (*currentloc->mt_entry->ops->statvfs_h)( currentloc, buf );
rtems_filesystem_eval_path_cleanup( &ctx );
diff --git a/cpukit/libcsupport/src/sup_fs_eval_path.c b/cpukit/libcsupport/src/sup_fs_eval_path.c
index 5f7b606e7d..f323dbc8f3 100644
--- a/cpukit/libcsupport/src/sup_fs_eval_path.c
+++ b/cpukit/libcsupport/src/sup_fs_eval_path.c
@@ -104,7 +104,7 @@ void rtems_filesystem_eval_path_continue(
int eval_flags;
while (ctx->pathlen > 0) {
- (*ctx->currentloc.ops->eval_path_h)(ctx);
+ (*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
}
eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
@@ -260,7 +260,7 @@ void rtems_filesystem_eval_path_recursive(
++ctx->recursionlevel;
while (ctx->pathlen > 0) {
- (*ctx->currentloc.ops->eval_path_h)(ctx);
+ (*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
}
--ctx->recursionlevel;
@@ -297,7 +297,7 @@ static void free_location(rtems_filesystem_location_info_t *loc)
{
rtems_filesystem_mt_entry_declare_lock_context(lock_context);
- (*loc->ops->freenod_h)(loc);
+ (*loc->mt_entry->ops->freenod_h)(loc);
rtems_filesystem_mt_entry_lock(lock_context);
rtems_chain_extract_unprotected(&loc->mt_entry_node);
diff --git a/cpukit/libcsupport/src/sup_fs_eval_path_generic.c b/cpukit/libcsupport/src/sup_fs_eval_path_generic.c
index d8629c64ab..27dd80145a 100644
--- a/cpukit/libcsupport/src/sup_fs_eval_path_generic.c
+++ b/cpukit/libcsupport/src/sup_fs_eval_path_generic.c
@@ -20,10 +20,11 @@
static bool is_fs_root( const rtems_filesystem_location_info_t *loc )
{
+ const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
const rtems_filesystem_location_info_t *mt_fs_root =
- &loc->mt_entry->mt_fs_root->location;
+ &mt_entry->mt_fs_root->location;
- return (*loc->ops->are_nodes_equal_h)( loc, mt_fs_root );
+ return (*mt_entry->ops->are_nodes_equal_h)( loc, mt_fs_root );
}
static bool is_eval_path_root(
@@ -31,10 +32,11 @@ static bool is_eval_path_root(
const rtems_filesystem_location_info_t *loc
)
{
+ const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
const rtems_filesystem_location_info_t *rootloc = &ctx->rootloc->location;
- return loc->mt_entry == rootloc->mt_entry
- && (*loc->ops->are_nodes_equal_h)( loc, rootloc );
+ return mt_entry == rootloc->mt_entry
+ && (*mt_entry->ops->are_nodes_equal_h)( loc, rootloc );
}
void rtems_filesystem_eval_path_generic(
diff --git a/cpukit/libcsupport/src/sup_fs_location.c b/cpukit/libcsupport/src/sup_fs_location.c
index 5234c01ddc..4ebf5f04d7 100644
--- a/cpukit/libcsupport/src/sup_fs_location.c
+++ b/cpukit/libcsupport/src/sup_fs_location.c
@@ -33,7 +33,6 @@ rtems_filesystem_location_info_t *rtems_filesystem_location_copy(
dst->node_access = src->node_access;
dst->node_access_2 = src->node_access_2;
dst->handlers = src->handlers;
- dst->ops = src->ops;
dst->mt_entry = src->mt_entry;
rtems_filesystem_location_add_to_mt_entry(dst);
@@ -213,6 +212,6 @@ void rtems_filesystem_do_unmount(
rtems_chain_extract_unprotected(&mt_entry->mt_node);
rtems_filesystem_mt_unlock();
rtems_filesystem_global_location_release(mt_entry->mt_point_node);
- (*mt_entry->mt_fs_root->location.ops->fsunmount_me_h)(mt_entry);
+ (*mt_entry->ops->fsunmount_me_h)(mt_entry);
free(mt_entry);
}
diff --git a/cpukit/libcsupport/src/sup_fs_node_type.c b/cpukit/libcsupport/src/sup_fs_node_type.c
index f78451dee1..0eb4221402 100644
--- a/cpukit/libcsupport/src/sup_fs_node_type.c
+++ b/cpukit/libcsupport/src/sup_fs_node_type.c
@@ -25,7 +25,7 @@ rtems_filesystem_node_types_t rtems_filesystem_node_type(
rtems_filesystem_node_types_t type;
rtems_filesystem_instance_lock(loc);
- type = (*loc->ops->node_type_h)(loc);
+ type = (*loc->mt_entry->ops->node_type_h)(loc);
rtems_filesystem_instance_unlock(loc);
return type;
diff --git a/cpukit/libcsupport/src/symlink.c b/cpukit/libcsupport/src/symlink.c
index f49730df70..07ab87fc57 100644
--- a/cpukit/libcsupport/src/symlink.c
+++ b/cpukit/libcsupport/src/symlink.c
@@ -27,7 +27,7 @@ int symlink( const char *path1, const char *path2 )
const rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_start( &ctx, path2, eval_flags );
- rv = (*currentloc->ops->symlink_h)(
+ rv = (*currentloc->mt_entry->ops->symlink_h)(
currentloc,
rtems_filesystem_eval_path_get_token( &ctx ),
rtems_filesystem_eval_path_get_tokenlen( &ctx ),
diff --git a/cpukit/libcsupport/src/unlink.c b/cpukit/libcsupport/src/unlink.c
index 6a6091575b..9817ad9611 100644
--- a/cpukit/libcsupport/src/unlink.c
+++ b/cpukit/libcsupport/src/unlink.c
@@ -34,11 +34,9 @@ int unlink( const char *path )
&parentloc,
parent_eval_flags
);
+ const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
- rv = (*currentloc->ops->rmnod_h)(
- &parentloc,
- currentloc
- );
+ rv = (*ops->rmnod_h)( &parentloc, currentloc );
rtems_filesystem_eval_path_cleanup_with_parent( &ctx, &parentloc );
diff --git a/cpukit/libcsupport/src/unmount.c b/cpukit/libcsupport/src/unmount.c
index cf4befe5a4..b58955d33c 100644
--- a/cpukit/libcsupport/src/unmount.c
+++ b/cpukit/libcsupport/src/unmount.c
@@ -32,7 +32,10 @@ int unmount( const char *path )
rtems_filesystem_mount_table_entry_t *mt_entry = currentloc->mt_entry;
if ( rtems_filesystem_location_is_root( currentloc ) ) {
- rv = (*mt_entry->mt_point_node->location.ops->unmount_h)( mt_entry );
+ const rtems_filesystem_operations_table *mt_point_ops =
+ mt_entry->mt_point_node->location.mt_entry->ops;
+
+ rv = (*mt_point_ops->unmount_h)( mt_entry );
if ( rv == 0 ) {
rtems_filesystem_mt_entry_declare_lock_context( lock_context );
diff --git a/cpukit/libcsupport/src/utime.c b/cpukit/libcsupport/src/utime.c
index fe4f7109a3..0f65397166 100644
--- a/cpukit/libcsupport/src/utime.c
+++ b/cpukit/libcsupport/src/utime.c
@@ -38,7 +38,7 @@ int utime( const char *path, const struct utimbuf *times )
times = &now_times;
}
- rv = (*currentloc->ops->utime_h)(
+ rv = (*currentloc->mt_entry->ops->utime_h)(
currentloc,
times->actime,
times->modtime
diff --git a/cpukit/libfs/src/devfs/devfs_init.c b/cpukit/libfs/src/devfs/devfs_init.c
index e489781f63..7ec3d9f9be 100644
--- a/cpukit/libfs/src/devfs/devfs_init.c
+++ b/cpukit/libfs/src/devfs/devfs_init.c
@@ -56,9 +56,9 @@ int devFS_initialize(
int rv = 0;
if (data != NULL) {
+ mt_entry->ops = &devFS_ops;
mt_entry->immutable_fs_info = data;
mt_entry->mt_fs_root->location.handlers = &devFS_file_handlers;
- mt_entry->mt_fs_root->location.ops = &devFS_ops;
} else {
errno = EINVAL;
rv = -1;
diff --git a/cpukit/libfs/src/devfs/devfs_show.c b/cpukit/libfs/src/devfs/devfs_show.c
index acaa346784..56badb1207 100644
--- a/cpukit/libfs/src/devfs/devfs_show.c
+++ b/cpukit/libfs/src/devfs/devfs_show.c
@@ -14,7 +14,7 @@ void devFS_Show(void)
{
rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location;
- if (rootloc->ops == &devFS_ops) {
+ if (rootloc->mt_entry->ops == &devFS_ops) {
const devFS_data *data = devFS_get_data(rootloc);
size_t i = 0;
size_t n = data->count;
diff --git a/cpukit/libfs/src/dosfs/msdos_initsupp.c b/cpukit/libfs/src/dosfs/msdos_initsupp.c
index 1f05398dd9..f3a2cc5281 100644
--- a/cpukit/libfs/src/dosfs/msdos_initsupp.c
+++ b/cpukit/libfs/src/dosfs/msdos_initsupp.c
@@ -141,7 +141,7 @@ msdos_initialize_support(
temp_mt_entry->mt_fs_root->location.node_access = fat_fd;
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
- temp_mt_entry->mt_fs_root->location.ops = op_table;
+ temp_mt_entry->ops = op_table;
return rc;
}
diff --git a/cpukit/libfs/src/imfs/imfs_initsupp.c b/cpukit/libfs/src/imfs/imfs_initsupp.c
index 39b691a49b..f005774e1d 100644
--- a/cpukit/libfs/src/imfs/imfs_initsupp.c
+++ b/cpukit/libfs/src/imfs/imfs_initsupp.c
@@ -79,9 +79,9 @@ int IMFS_initialize_support(
);
if ( root_node != NULL ) {
mt_entry->fs_info = fs_info;
+ mt_entry->ops = op_table;
mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
mt_entry->mt_fs_root->location.node_access = root_node;
- mt_entry->mt_fs_root->location.ops = op_table;
IMFS_Set_handlers( &mt_entry->mt_fs_root->location );
} else {
errno = ENOMEM;
diff --git a/cpukit/libfs/src/imfs/imfs_load_tar.c b/cpukit/libfs/src/imfs/imfs_load_tar.c
index 9abaf2f8ee..e51194fa8c 100644
--- a/cpukit/libfs/src/imfs/imfs_load_tar.c
+++ b/cpukit/libfs/src/imfs/imfs_load_tar.c
@@ -101,7 +101,11 @@ int rtems_tarfs_load(
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
- if (rootloc.ops != &IMFS_ops && rootloc.ops != &fifoIMFS_ops) {
+
+ if (
+ rootloc.mt_entry->ops != &IMFS_ops
+ && rootloc.mt_entry->ops != &fifoIMFS_ops
+ ) {
rv = -1;
}
diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c
index 0f33cf39ad..372f078f14 100644
--- a/cpukit/libfs/src/nfsclient/src/nfs.c
+++ b/cpukit/libfs/src/nfsclient/src/nfs.c
@@ -1753,7 +1753,7 @@ char *path = mt_entry->dev;
rootNode = 0;
- mt_entry->mt_fs_root->location.ops = &nfs_fs_ops;
+ mt_entry->ops = &nfs_fs_ops;
mt_entry->mt_fs_root->location.handlers = &nfs_dir_file_handlers;
mt_entry->pathconf_limits_and_options = nfs_limits_and_options;
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
index 9a245f5f3b..ba6c9056e6 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
@@ -918,11 +918,10 @@ rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
return rtems_rfs_rtems_error ("initialise: open", rc);
}
- mt_entry->fs_info = fs;
-
+ mt_entry->fs_info = fs;
+ mt_entry->ops = &rtems_rfs_ops;
mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
mt_entry->mt_fs_root->location.handlers = &rtems_rfs_rtems_dir_handlers;
- mt_entry->mt_fs_root->location.ops = &rtems_rfs_ops;
rtems_rfs_rtems_unlock (fs);
diff --git a/cpukit/libnetworking/lib/ftpfs.c b/cpukit/libnetworking/lib/ftpfs.c
index fad8f48a24..8c5f4db091 100644
--- a/cpukit/libnetworking/lib/ftpfs.c
+++ b/cpukit/libnetworking/lib/ftpfs.c
@@ -1194,7 +1194,7 @@ int rtems_ftpfs_initialize(
/* Set handler and oparations table */
e->mt_fs_root->location.handlers = &rtems_ftpfs_root_handlers;
- e->mt_fs_root->location.ops = &rtems_ftpfs_ops;
+ e->ops = &rtems_ftpfs_ops;
/* We maintain no real file system nodes, so there is no real root */
e->mt_fs_root->location.node_access = NULL;
diff --git a/cpukit/libnetworking/lib/tftpDriver.c b/cpukit/libnetworking/lib/tftpDriver.c
index 3b81f54692..d549436c46 100644
--- a/cpukit/libnetworking/lib/tftpDriver.c
+++ b/cpukit/libnetworking/lib/tftpDriver.c
@@ -205,7 +205,7 @@ int rtems_tftpfs_initialize(
mt_entry->fs_info = fs;
mt_entry->mt_fs_root->location.node_access = root_path;
mt_entry->mt_fs_root->location.handlers = &rtems_tftp_handlers;
- mt_entry->mt_fs_root->location.ops = &rtems_tftp_ops;
+ mt_entry->ops = &rtems_tftp_ops;
/*
* Now allocate a semaphore for mutual exclusion.
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
index d4a9e57b4f..727eac6ad2 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall.c
@@ -88,7 +88,6 @@ rtems_bsdnet_makeFdForSocket (void *so)
iop->data0 = fd;
iop->data1 = so;
iop->pathinfo.handlers = &socket_handlers;
- iop->pathinfo.ops = &rtems_filesystem_operations_default;
iop->pathinfo.mt_entry = &rtems_filesystem_null_mt_entry;
rtems_filesystem_location_add_to_mt_entry(&iop->pathinfo);
return fd;
diff --git a/testsuites/fstests/fsnofs01/init.c b/testsuites/fstests/fsnofs01/init.c
index 3ddc615ba2..9d7f98b053 100644
--- a/testsuites/fstests/fsnofs01/init.c
+++ b/testsuites/fstests/fsnofs01/init.c
@@ -53,7 +53,6 @@ static void rtems_test_assert_equal_to_null_loc(
rtems_test_assert(null_loc->location.node_access == local_loc->node_access);
rtems_test_assert(null_loc->location.node_access_2 == local_loc->node_access_2);
rtems_test_assert(null_loc->location.handlers == local_loc->handlers);
- rtems_test_assert(null_loc->location.ops == local_loc->ops);
rtems_test_assert(null_loc->location.mt_entry == local_loc->mt_entry);
}