9
0
Fork 0

Move fs/fs.h to fs/inode/inode.h and some to fs/driver/driver.h

This commit is contained in:
Gregory Nutt 2014-09-29 07:14:38 -06:00
parent 780e75482a
commit bf393cd10e
63 changed files with 180 additions and 98 deletions

View File

@ -8703,3 +8703,5 @@
* nuttx/sched/init/os_start.c, semaphore/Make.defs, sem_initialize.c,
and semaphore.h: Semaphore initialization is now only required if
priority inheritance is enabled (2014-9-29).
* fs/Makefile and mqueue/: Add build support for messages queues as part
of the VFS (only build logic, no C files yet) (2014-9-29).

View File

@ -41,7 +41,7 @@
#include <stdbool.h>
#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>
#include "fs.h"
#include "inode/inode.h"
#include <queue.h>
#include <arch/irq.h>
#include <rgmp/rtos.h>

View File

@ -46,7 +46,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -49,7 +49,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -46,7 +46,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -45,7 +45,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -46,7 +46,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

102
nuttx/fs/driver/driver.h Normal file
View File

@ -0,0 +1,102 @@
/****************************************************************************
* fs/driver/driver.h
*
* Copyright (C) 2007, 2009, 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __FS_DRIVER_DRIVER_H
#define __FS_DRIVER_DRIVER_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <nuttx/fs/fs.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Global Variables
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
extern FAR struct inode *root_inode;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/* fs_findblockdriver.c *****************************************************/
/****************************************************************************
* Name: find_blockdriver
*
* Description:
* Return the inode of the block driver specified by 'pathname'
*
* Inputs:
* pathname - the full path to the block driver to be located
* mountflags - if MS_RDONLY is not set, then driver must support write
* operations (see include/sys/mount.h)
* ppinode - address of the location to return the inode reference
*
* Return:
* Returns zero on success or a negated errno on failure:
*
* EINVAL - pathname or pinode is NULL
* ENOENT - No block driver of this name is registered
* ENOTBLK - The inode associated with the pathname is not a block driver
* EACCESS - The MS_RDONLY option was not set but this driver does not
* support write access
*
****************************************************************************/
int find_blockdriver(FAR const char *pathname, int mountflags,
FAR struct inode **ppinode);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __FS_DRIVER_DRIVER_H */

View File

@ -43,7 +43,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -38,13 +38,16 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
#include "driver/driver.h"
/****************************************************************************
* Private Functions

View File

@ -43,7 +43,8 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
#include "driver/driver.h"
/****************************************************************************
* Private Functions

View File

@ -44,7 +44,7 @@
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor oDefinitions

View File

@ -44,7 +44,7 @@
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -53,7 +53,7 @@
#include <nuttx/arch.h>
#include <nuttx/syslog/syslog.h>
#include "fs.h"
#include "inode/inode.h"
#if defined(CONFIG_SYSLOG) && defined(CONFIG_SYSLOG_CHAR)

View File

@ -41,7 +41,7 @@
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -41,7 +41,7 @@
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -48,7 +48,7 @@
#include <nuttx/fs/fat.h>
#include <nuttx/fs/mkfatfs.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_fat32.h"
#include "fs_mkfatfs.h"

View File

@ -63,7 +63,7 @@
#include <nuttx/fs/fat.h>
#include <nuttx/fs/dirent.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_fat32.h"
/****************************************************************************

View File

@ -45,7 +45,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/fat.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_fat32.h"
/****************************************************************************

View File

@ -83,7 +83,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/fat.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_fat32.h"
/****************************************************************************

View File

@ -60,7 +60,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/fat.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_fat32.h"
/****************************************************************************

View File

@ -50,7 +50,7 @@
#include <nuttx/fs/fat.h>
#include <nuttx/fs/mkfatfs.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_fat32.h"
#include "fs_mkfatfs.h"

View File

@ -48,7 +48,7 @@
#include <nuttx/fs/fat.h>
#include <nuttx/fs/mkfatfs.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_fat32.h"
#include "fs_mkfatfs.h"

View File

@ -49,7 +49,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -47,7 +47,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -46,7 +46,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -41,7 +41,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -42,7 +42,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -44,7 +44,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -44,7 +44,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -45,7 +45,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -1,5 +1,5 @@
/****************************************************************************
* fs/fs.h
* fs/inode/inode.h
*
* Copyright (C) 2007, 2009, 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef _FS_FS_H
#define _FS_FS_H
#ifndef __FS_INODE_H
#define __FS_INODE_H
/****************************************************************************
* Included Files
@ -114,20 +114,20 @@ typedef int (*foreach_inode_t)(FAR struct inode *node,
* Global Variables
****************************************************************************/
extern FAR struct inode *root_inode;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
EXTERN FAR struct inode *root_inode;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/* fs_inode.c ***************************************************************/
/****************************************************************************
* Name: inode_semtake
@ -329,36 +329,9 @@ int files_close(int fd);
void files_release(int fd);
/* fs_findblockdriver.c *****************************************************/
/****************************************************************************
* Name: find_blockdriver
*
* Description:
* Return the inode of the block driver specified by 'pathname'
*
* Inputs:
* pathname - the full path to the block driver to be located
* mountflags - if MS_RDONLY is not set, then driver must support write
* operations (see include/sys/mount.h)
* ppinode - address of the location to return the inode reference
*
* Return:
* Returns zero on success or a negated errno on failure:
*
* EINVAL - pathname or pinode is NULL
* ENOENT - No block driver of this name is registered
* ENOTBLK - The inode associated with the pathname is not a block driver
* EACCESS - The MS_RDONLY option was not set but this driver does not
* support write access
*
****************************************************************************/
int find_blockdriver(FAR const char *pathname, int mountflags,
FAR struct inode **ppinode);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* _FS_FS_H */
#endif /* __FS_INODE_H */

View File

@ -46,7 +46,7 @@
#include <errno.h>
#include <debug.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_rammap.h"
/****************************************************************************

View File

@ -49,7 +49,7 @@
#include <nuttx/kmalloc.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_rammap.h"
#ifdef CONFIG_FS_RAMMAP

View File

@ -49,7 +49,7 @@
#include <nuttx/kmalloc.h>
#include "fs.h"
#include "inode/inode.h"
#include "fs_rammap.h"
#ifdef CONFIG_FS_RAMMAP

View File

@ -55,7 +55,7 @@
#include <nuttx/wqueue.h>
#include <nuttx/fs/automount.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -49,7 +49,7 @@
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
#ifndef CONFIG_DISABLE_MOUNTPOUNT

View File

@ -47,7 +47,8 @@
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
#include "driver/driver.h"
/* At least one filesystem must be defined, or this file will not compile.
* It may be desire-able to make filesystems dynamically registered at

View File

@ -43,7 +43,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -47,7 +47,7 @@
#include <nuttx/semaphore.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
#ifdef CONFIG_FS_NAMED_SEMAPHORES

View File

@ -52,7 +52,7 @@
#include <nuttx/semaphore.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
#include "semaphore/semaphore.h"
#ifdef CONFIG_FS_NAMED_SEMAPHORES

View File

@ -48,7 +48,7 @@
#include <nuttx/kmalloc.h>
#include "fs.h"
#include "inode/inode.h"
#include "semaphore/semaphore.h"
/****************************************************************************

View File

@ -48,7 +48,7 @@
# include <nuttx/net/net.h>
#endif
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Global Functions

View File

@ -44,7 +44,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -43,7 +43,7 @@
#include <sched.h>
#include <errno.h>
#include "fs.h"
#include "inode/inode.h"
/* This logic in this applies only when both socket and file descriptors are
* in that case, this function descriminates which type of dup2 is being

View File

@ -48,7 +48,7 @@
#include <nuttx/net/net.h>
#include <nuttx/sched.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -45,7 +45,7 @@
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
#if CONFIG_NFILE_DESCRIPTORS > 0

View File

@ -43,7 +43,7 @@
#include <sched.h>
#include <errno.h>
#include "fs.h"
#include "inode/inode.h"
#if CONFIG_NFILE_DESCRIPTORS > 0

View File

@ -47,7 +47,7 @@
#include <nuttx/fs/fs.h>
#include <nuttx/sched.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -50,7 +50,7 @@
# include <nuttx/net/net.h>
#endif
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Global Functions

View File

@ -45,7 +45,7 @@
#include <errno.h>
#include <assert.h>
#include "fs.h"
#include "inode/inode.h"
#if CONFIG_NFILE_DESCRIPTORS > 0

View File

@ -43,7 +43,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -50,7 +50,7 @@
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -52,7 +52,7 @@
#include <arch/irq.h>
#include "fs.h"
#include "inode/inode.h"
#ifndef CONFIG_DISABLE_POLL

View File

@ -46,7 +46,7 @@
#include <sched.h>
#include <errno.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -43,7 +43,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -43,7 +43,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -51,7 +51,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
#ifndef CONFIG_DISABLE_POLL

View File

@ -44,7 +44,7 @@
#include <sched.h>
#include <errno.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -45,7 +45,7 @@
#include <sched.h>
#include <errno.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions

View File

@ -43,7 +43,7 @@
#include <errno.h>
#include <nuttx/fs/fs.h>
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -49,7 +49,7 @@
# include <sys/socket.h>
#endif
#include "fs.h"
#include "inode/inode.h"
/****************************************************************************
* Private Functions