diff --git a/drivers/bch/bch.h b/drivers/bch/bch.h index c766a89093..e60184316a 100644 --- a/drivers/bch/bch.h +++ b/drivers/bch/bch.h @@ -75,7 +75,7 @@ extern "C" #define EXTERN extern #endif -EXTERN const struct file_operations bch_fops; +EXTERN const struct file_operations g_bch_fops; /**************************************************************************** * Public Function Prototypes diff --git a/drivers/bch/bchdev_register.c b/drivers/bch/bchdev_register.c index 400c3a434f..f28f451e8c 100644 --- a/drivers/bch/bchdev_register.c +++ b/drivers/bch/bchdev_register.c @@ -67,7 +67,7 @@ int bchdev_register(FAR const char *blkdev, FAR const char *chardev, /* Then setup the character device */ - ret = register_driver(chardev, &bch_fops, 0666, handle); + ret = register_driver(chardev, &g_bch_fops, 0666, handle); if (ret < 0) { ferr("ERROR: register_driver failed: %d\n", -ret); diff --git a/fs/binfs/fs_binfs.c b/fs/binfs/fs_binfs.c index a03e81c7e1..1fe2fa7c8b 100644 --- a/fs/binfs/fs_binfs.c +++ b/fs/binfs/fs_binfs.c @@ -37,7 +37,6 @@ #include #include -#include #include #include @@ -101,7 +100,7 @@ static int binfs_stat(FAR struct inode *mountpt, FAR const char *relpath, * with any compiler. */ -const struct mountpt_operations binfs_operations = +const struct mountpt_operations g_binfs_operations = { binfs_open, /* open */ binfs_close, /* close */ diff --git a/fs/cromfs/fs_cromfs.c b/fs/cromfs/fs_cromfs.c index b3770dd803..a36be7783c 100644 --- a/fs/cromfs/fs_cromfs.c +++ b/fs/cromfs/fs_cromfs.c @@ -176,7 +176,7 @@ static int cromfs_stat(FAR struct inode *mountpt, * with any compiler. */ -const struct mountpt_operations cromfs_operations = +const struct mountpt_operations g_cromfs_operations = { cromfs_open, /* open */ cromfs_close, /* close */ diff --git a/fs/fat/fs_fat32.c b/fs/fat/fs_fat32.c index f2ac86a928..ccbe16b90d 100644 --- a/fs/fat/fs_fat32.c +++ b/fs/fat/fs_fat32.c @@ -107,7 +107,7 @@ static int fat_stat(struct inode *mountpt, const char *relpath, * with any compiler. */ -const struct mountpt_operations fat_operations = +const struct mountpt_operations g_fat_operations = { fat_open, /* open */ fat_close, /* close */ diff --git a/fs/hostfs/hostfs.c b/fs/hostfs/hostfs.c index dc9b53e112..8ee8aed21f 100644 --- a/fs/hostfs/hostfs.c +++ b/fs/hostfs/hostfs.c @@ -134,7 +134,7 @@ static mutex_t g_lock = NXMUTEX_INITIALIZER; * with any compiler. */ -const struct mountpt_operations hostfs_operations = +const struct mountpt_operations g_hostfs_operations = { hostfs_open, /* open */ hostfs_close, /* close */ diff --git a/fs/littlefs/lfs_vfs.c b/fs/littlefs/lfs_vfs.c index c00174d171..d245d4b5e5 100644 --- a/fs/littlefs/lfs_vfs.c +++ b/fs/littlefs/lfs_vfs.c @@ -140,7 +140,7 @@ static int littlefs_stat(FAR struct inode *mountpt, * with any compiler. */ -const struct mountpt_operations littlefs_operations = +const struct mountpt_operations g_littlefs_operations = { littlefs_open, /* open */ littlefs_close, /* close */ diff --git a/fs/mount/fs_mount.c b/fs/mount/fs_mount.c index 0e81dd267a..cb68f32678 100644 --- a/fs/mount/fs_mount.c +++ b/fs/mount/fs_mount.c @@ -90,31 +90,31 @@ struct fsmap_t /* File systems that require block drivers */ #ifdef CONFIG_FS_FAT -extern const struct mountpt_operations fat_operations; +extern const struct mountpt_operations g_fat_operations; #endif #ifdef CONFIG_FS_ROMFS -extern const struct mountpt_operations romfs_operations; +extern const struct mountpt_operations g_romfs_operations; #endif #ifdef CONFIG_FS_SMARTFS -extern const struct mountpt_operations smartfs_operations; +extern const struct mountpt_operations g_smartfs_operations; #endif #ifdef CONFIG_FS_LITTLEFS -extern const struct mountpt_operations littlefs_operations; +extern const struct mountpt_operations g_littlefs_operations; #endif static const struct fsmap_t g_bdfsmap[] = { #ifdef CONFIG_FS_FAT - { "vfat", &fat_operations }, + { "vfat", &g_fat_operations }, #endif #ifdef CONFIG_FS_ROMFS - { "romfs", &romfs_operations }, + { "romfs", &g_romfs_operations }, #endif #ifdef CONFIG_FS_SMARTFS - { "smartfs", &smartfs_operations }, + { "smartfs", &g_smartfs_operations }, #endif #ifdef CONFIG_FS_LITTLEFS - { "littlefs", &littlefs_operations }, + { "littlefs", &g_littlefs_operations }, #endif { NULL, NULL }, }; @@ -124,25 +124,25 @@ static const struct fsmap_t g_bdfsmap[] = /* File systems that require MTD drivers */ #ifdef CONFIG_FS_ROMFS -extern const struct mountpt_operations romfs_operations; +extern const struct mountpt_operations g_romfs_operations; #endif #ifdef CONFIG_FS_SPIFFS -extern const struct mountpt_operations spiffs_operations; +extern const struct mountpt_operations g_spiffs_operations; #endif #ifdef CONFIG_FS_LITTLEFS -extern const struct mountpt_operations littlefs_operations; +extern const struct mountpt_operations g_littlefs_operations; #endif static const struct fsmap_t g_mdfsmap[] = { #ifdef CONFIG_FS_ROMFS - { "romfs", &romfs_operations }, + { "romfs", &g_romfs_operations }, #endif #ifdef CONFIG_FS_SPIFFS - { "spiffs", &spiffs_operations }, + { "spiffs", &g_spiffs_operations }, #endif #ifdef CONFIG_FS_LITTLEFS - { "littlefs", &littlefs_operations }, + { "littlefs", &g_littlefs_operations }, #endif { NULL, NULL }, }; @@ -152,67 +152,67 @@ static const struct fsmap_t g_mdfsmap[] = /* File systems that require neither block nor MTD drivers */ #ifdef CONFIG_FS_NXFFS -extern const struct mountpt_operations nxffs_operations; +extern const struct mountpt_operations g_nxffs_operations; #endif #ifdef CONFIG_FS_TMPFS -extern const struct mountpt_operations tmpfs_operations; +extern const struct mountpt_operations g_tmpfs_operations; #endif #ifdef CONFIG_NFS -extern const struct mountpt_operations nfs_operations; +extern const struct mountpt_operations g_nfs_operations; #endif #ifdef CONFIG_FS_BINFS -extern const struct mountpt_operations binfs_operations; +extern const struct mountpt_operations g_binfs_operations; #endif #ifdef CONFIG_FS_PROCFS -extern const struct mountpt_operations procfs_operations; +extern const struct mountpt_operations g_procfs_operations; #endif #ifdef CONFIG_FS_USERFS -extern const struct mountpt_operations userfs_operations; +extern const struct mountpt_operations g_userfs_operations; #endif #ifdef CONFIG_FS_HOSTFS -extern const struct mountpt_operations hostfs_operations; +extern const struct mountpt_operations g_hostfs_operations; #endif #ifdef CONFIG_FS_CROMFS -extern const struct mountpt_operations cromfs_operations; +extern const struct mountpt_operations g_cromfs_operations; #endif #ifdef CONFIG_FS_UNIONFS -extern const struct mountpt_operations unionfs_operations; +extern const struct mountpt_operations g_unionfs_operations; #endif #ifdef CONFIG_FS_RPMSGFS -extern const struct mountpt_operations rpmsgfs_operations; +extern const struct mountpt_operations g_rpmsgfs_operations; #endif static const struct fsmap_t g_nonbdfsmap[] = { #ifdef CONFIG_FS_NXFFS - { "nxffs", &nxffs_operations }, + { "nxffs", &g_nxffs_operations }, #endif #ifdef CONFIG_FS_TMPFS - { "tmpfs", &tmpfs_operations }, + { "tmpfs", &g_tmpfs_operations }, #endif #ifdef CONFIG_NFS - { "nfs", &nfs_operations }, + { "nfs", &g_nfs_operations }, #endif #ifdef CONFIG_FS_BINFS - { "binfs", &binfs_operations }, + { "binfs", &g_binfs_operations }, #endif #ifdef CONFIG_FS_PROCFS - { "procfs", &procfs_operations }, + { "procfs", &g_procfs_operations }, #endif #ifdef CONFIG_FS_USERFS - { "userfs", &userfs_operations }, + { "userfs", &g_userfs_operations }, #endif #ifdef CONFIG_FS_HOSTFS - { "hostfs", &hostfs_operations }, + { "hostfs", &g_hostfs_operations }, #endif #ifdef CONFIG_FS_CROMFS - { "cromfs", &cromfs_operations }, + { "cromfs", &g_cromfs_operations }, #endif #ifdef CONFIG_FS_UNIONFS - { "unionfs", &unionfs_operations }, + { "unionfs", &g_unionfs_operations }, #endif #ifdef CONFIG_FS_RPMSGFS - { "rpmsgfs", &rpmsgfs_operations }, + { "rpmsgfs", &g_rpmsgfs_operations }, #endif { NULL, NULL }, }; diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c index 1358bc4f81..b423b6a3c9 100644 --- a/fs/nfs/nfs_vfsops.c +++ b/fs/nfs/nfs_vfsops.c @@ -190,7 +190,7 @@ struct nfsstats nfsstats; /* nfs vfs operations. */ -const struct mountpt_operations nfs_operations = +const struct mountpt_operations g_nfs_operations = { nfs_open, /* open */ nfs_close, /* close */ diff --git a/fs/nxffs/nxffs_initialize.c b/fs/nxffs/nxffs_initialize.c index 7e97e19b95..a572ebadf2 100644 --- a/fs/nxffs/nxffs_initialize.c +++ b/fs/nxffs/nxffs_initialize.c @@ -46,7 +46,7 @@ * with any compiler. */ -const struct mountpt_operations nxffs_operations = +const struct mountpt_operations g_nxffs_operations = { nxffs_open, /* open */ nxffs_close, /* close */ diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index 28f3a12511..be3461472e 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -244,7 +244,7 @@ static int procfs_initialize(void); * with any compiler. */ -const struct mountpt_operations procfs_operations = +const struct mountpt_operations g_procfs_operations = { procfs_open, /* open */ procfs_close, /* close */ diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index 2a65790a74..ad72d82ea1 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -113,7 +113,7 @@ static int romfs_stat(FAR struct inode *mountpt, FAR const char *relpath, * with any compiler. */ -const struct mountpt_operations romfs_operations = +const struct mountpt_operations g_romfs_operations = { romfs_open, /* open */ romfs_close, /* close */ diff --git a/fs/rpmsgfs/rpmsgfs.c b/fs/rpmsgfs/rpmsgfs.c index b97466376f..71f1349f1c 100644 --- a/fs/rpmsgfs/rpmsgfs.c +++ b/fs/rpmsgfs/rpmsgfs.c @@ -153,7 +153,7 @@ static int rpmsgfs_chstat(FAR struct inode *mountpt, * with any compiler. */ -const struct mountpt_operations rpmsgfs_operations = +const struct mountpt_operations g_rpmsgfs_operations = { rpmsgfs_open, /* open */ rpmsgfs_close, /* close */ diff --git a/fs/smartfs/smartfs_smart.c b/fs/smartfs/smartfs_smart.c index d7928edd1a..3c6ea1fad4 100644 --- a/fs/smartfs/smartfs_smart.c +++ b/fs/smartfs/smartfs_smart.c @@ -132,7 +132,7 @@ static mutex_t g_lock = NXMUTEX_INITIALIZER; * with any compiler. */ -const struct mountpt_operations smartfs_operations = +const struct mountpt_operations g_smartfs_operations = { smartfs_open, /* open */ smartfs_close, /* close */ diff --git a/fs/spiffs/src/spiffs_vfs.c b/fs/spiffs/src/spiffs_vfs.c index 163c427054..718943f8f0 100644 --- a/fs/spiffs/src/spiffs_vfs.c +++ b/fs/spiffs/src/spiffs_vfs.c @@ -133,7 +133,7 @@ static int spiffs_stat(FAR struct inode *mountpt, FAR const char *relpath, * Public Data ****************************************************************************/ -const struct mountpt_operations spiffs_operations = +const struct mountpt_operations g_spiffs_operations = { spiffs_open, /* open */ spiffs_close, /* close */ diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c index ed9d637f38..d01435a75d 100644 --- a/fs/tmpfs/fs_tmpfs.c +++ b/fs/tmpfs/fs_tmpfs.c @@ -170,7 +170,7 @@ static int tmpfs_stat(FAR struct inode *mountpt, FAR const char *relpath, * Public Data ****************************************************************************/ -const struct mountpt_operations tmpfs_operations = +const struct mountpt_operations g_tmpfs_operations = { tmpfs_open, /* open */ tmpfs_close, /* close */ diff --git a/fs/tmpfs/fs_tmpfs.h b/fs/tmpfs/fs_tmpfs.h index 0a14e6f58c..49a640fff9 100644 --- a/fs/tmpfs/fs_tmpfs.h +++ b/fs/tmpfs/fs_tmpfs.h @@ -166,7 +166,7 @@ extern "C" #define EXTERN extern #endif -EXTERN const struct mountpt_operations tmpfs_operations; +EXTERN const struct mountpt_operations g_tmpfs_operations; /**************************************************************************** * Public Function Prototypes diff --git a/fs/unionfs/fs_unionfs.c b/fs/unionfs/fs_unionfs.c index e4aed41ec1..523270329f 100644 --- a/fs/unionfs/fs_unionfs.c +++ b/fs/unionfs/fs_unionfs.c @@ -206,7 +206,7 @@ static int unionfs_dobind(FAR const char *fspath1, * with any compiler. */ -const struct mountpt_operations unionfs_operations = +const struct mountpt_operations g_unionfs_operations = { unionfs_open, /* open */ unionfs_close, /* close */ @@ -2733,7 +2733,7 @@ int unionfs_mount(FAR const char *fspath1, FAR const char *prefix1, INODE_SET_MOUNTPT(mpinode); - mpinode->u.i_mops = &unionfs_operations; + mpinode->u.i_mops = &g_unionfs_operations; /* Call unionfs_dobind to do the real work. */ diff --git a/fs/userfs/fs_userfs.c b/fs/userfs/fs_userfs.c index 953b3c6cab..a8cc512e87 100644 --- a/fs/userfs/fs_userfs.c +++ b/fs/userfs/fs_userfs.c @@ -152,7 +152,7 @@ static int userfs_chstat(FAR struct inode *mountpt, * with any compiler. */ -const struct mountpt_operations userfs_operations = +const struct mountpt_operations g_userfs_operations = { userfs_open, /* open */ userfs_close, /* close */ diff --git a/include/nuttx/fs/binfs.h b/include/nuttx/fs/binfs.h deleted file mode 100644 index 945ecf0e0c..0000000000 --- a/include/nuttx/fs/binfs.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** - * include/nuttx/fs/binfs.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __INCLUDE_NUTTX_FS_BINFS_H -#define __INCLUDE_NUTTX_FS_BINFS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#ifdef CONFIG_FS_BINFS - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/* The "bindir" is file system that supports access to the builtin - * applications. - * It is typically mounted under /bin. - */ - -struct mountpt_operations; -EXTERN const struct mountpt_operations binfs_operations; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_FS_BINFS */ -#endif /* __INCLUDE_NUTTX_FS_BINFS_H */