summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-05-14 16:55:41 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-05-15 10:01:43 +0200
commitda154e14f69e909a71ab0479c02dd56158f66ee0 (patch)
tree942675feba74c0ec16d60566fa32458c305daa2e /cpukit/libfs
parentFilesystem: Add const qualifier to lock/unlock (diff)
downloadrtems-da154e14f69e909a71ab0479c02dd56158f66ee0.tar.bz2
Filesystem: Move operations to mount table entry
The scope of the file system operations is the file system instance. The scope of the file system node handlers is the file location. The benefit of moving the operations to the mount table entry is a size reduction of the file location (rtems_filesystem_location_info_t). The code size is slightly increased due to additional load instructions. Restructure rtems_filesystem_mount_table_entry_t to improve cache efficiency.
Diffstat (limited to 'cpukit/libfs')
-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
7 files changed, 12 insertions, 9 deletions
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);