Skip to content

Commit

Permalink
fs: Add g_ prefix for all global mountpt_operations instances
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 authored and jerpelea committed Apr 24, 2023
1 parent 51dc67a commit dd63126
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 124 deletions.
2 changes: 1 addition & 1 deletion drivers/bch/bch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/bch/bchdev_register.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions fs/binfs/fs_binfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <debug.h>

#include <nuttx/fs/fs.h>
#include <nuttx/fs/binfs.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/lib/builtin.h>

Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/cromfs/fs_cromfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/fat/fs_fat32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/hostfs/hostfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/littlefs/lfs_vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
68 changes: 34 additions & 34 deletions fs/mount/fs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};
Expand All @@ -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 },
};
Expand All @@ -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 },
};
Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/nfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/nxffs/nxffs_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/procfs/fs_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/romfs/fs_romfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/rpmsgfs/rpmsgfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/smartfs/smartfs_smart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/spiffs/src/spiffs_vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/tmpfs/fs_tmpfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion fs/tmpfs/fs_tmpfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions fs/unionfs/fs_unionfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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. */

Expand Down
2 changes: 1 addition & 1 deletion fs/userfs/fs_userfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading

0 comments on commit dd63126

Please sign in to comment.