fs: Add g_ prefix for all global mountpt_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
51dc67ad5f
commit
dd631265c4
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 },
|
||||
};
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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. */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 <nuttx/config.h>
|
||||
|
||||
#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 */
|
Loading…
Reference in New Issue