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 d5dd9842dc
commit ae90309b36
63 changed files with 180 additions and 98 deletions
+2
View File
@@ -8703,3 +8703,5 @@
* nuttx/sched/init/os_start.c, semaphore/Make.defs, sem_initialize.c, * nuttx/sched/init/os_start.c, semaphore/Make.defs, sem_initialize.c,
and semaphore.h: Semaphore initialization is now only required if and semaphore.h: Semaphore initialization is now only required if
priority inheritance is enabled (2014-9-29). 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).
+1 -1
View File
@@ -41,7 +41,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include "fs.h" #include "inode/inode.h"
#include <queue.h> #include <queue.h>
#include <arch/irq.h> #include <arch/irq.h>
#include <rgmp/rtos.h> #include <rgmp/rtos.h>
+1 -1
View File
@@ -46,7 +46,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h> #include <nuttx/fs/dirent.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
+1 -1
View File
@@ -49,7 +49,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h> #include <nuttx/fs/dirent.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
+1 -1
View File
@@ -46,7 +46,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h> #include <nuttx/fs/dirent.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
+1 -1
View File
@@ -45,7 +45,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h> #include <nuttx/fs/dirent.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
+1 -1
View File
@@ -46,7 +46,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/fs/dirent.h> #include <nuttx/fs/dirent.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
+102
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 */
+1 -1
View File
@@ -43,7 +43,7 @@
#include <errno.h> #include <errno.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
+4 -1
View File
@@ -38,13 +38,16 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <debug.h> #include <debug.h>
#include <errno.h> #include <errno.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
#include "driver/driver.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
+2 -1
View File
@@ -43,7 +43,8 @@
#include <errno.h> #include <errno.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
#include "driver/driver.h"
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
+1 -1
View File
@@ -44,7 +44,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor oDefinitions * Pre-processor oDefinitions
+1 -1
View File
@@ -44,7 +44,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -53,7 +53,7 @@
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/syslog/syslog.h> #include <nuttx/syslog/syslog.h>
#include "fs.h" #include "inode/inode.h"
#if defined(CONFIG_SYSLOG) && defined(CONFIG_SYSLOG_CHAR) #if defined(CONFIG_SYSLOG) && defined(CONFIG_SYSLOG_CHAR)
+1 -1
View File
@@ -41,7 +41,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -41,7 +41,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -48,7 +48,7 @@
#include <nuttx/fs/fat.h> #include <nuttx/fs/fat.h>
#include <nuttx/fs/mkfatfs.h> #include <nuttx/fs/mkfatfs.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_fat32.h" #include "fs_fat32.h"
#include "fs_mkfatfs.h" #include "fs_mkfatfs.h"
+1 -1
View File
@@ -63,7 +63,7 @@
#include <nuttx/fs/fat.h> #include <nuttx/fs/fat.h>
#include <nuttx/fs/dirent.h> #include <nuttx/fs/dirent.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_fat32.h" #include "fs_fat32.h"
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -45,7 +45,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/fs/fat.h> #include <nuttx/fs/fat.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_fat32.h" #include "fs_fat32.h"
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -83,7 +83,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/fs/fat.h> #include <nuttx/fs/fat.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_fat32.h" #include "fs_fat32.h"
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -60,7 +60,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/fs/fat.h> #include <nuttx/fs/fat.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_fat32.h" #include "fs_fat32.h"
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -50,7 +50,7 @@
#include <nuttx/fs/fat.h> #include <nuttx/fs/fat.h>
#include <nuttx/fs/mkfatfs.h> #include <nuttx/fs/mkfatfs.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_fat32.h" #include "fs_fat32.h"
#include "fs_mkfatfs.h" #include "fs_mkfatfs.h"
+1 -1
View File
@@ -48,7 +48,7 @@
#include <nuttx/fs/fat.h> #include <nuttx/fs/fat.h>
#include <nuttx/fs/mkfatfs.h> #include <nuttx/fs/mkfatfs.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_fat32.h" #include "fs_fat32.h"
#include "fs_mkfatfs.h" #include "fs_mkfatfs.h"
+1 -1
View File
@@ -49,7 +49,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -47,7 +47,7 @@
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -46,7 +46,7 @@
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -41,7 +41,7 @@
#include <errno.h> #include <errno.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -42,7 +42,7 @@
#include <errno.h> #include <errno.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -44,7 +44,7 @@
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -44,7 +44,7 @@
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -45,7 +45,7 @@
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+11 -38
View File
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* fs/fs.h * fs/inode/inode.h
* *
* Copyright (C) 2007, 2009, 2012, 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2009, 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef _FS_FS_H #ifndef __FS_INODE_H
#define _FS_FS_H #define __FS_INODE_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@@ -114,20 +114,20 @@ typedef int (*foreach_inode_t)(FAR struct inode *node,
* Global Variables * Global Variables
****************************************************************************/ ****************************************************************************/
extern FAR struct inode *root_inode;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
#define EXTERN extern "C" #define EXTERN extern "C"
extern "C" { extern "C"
{
#else #else
#define EXTERN extern #define EXTERN extern
#endif #endif
EXTERN FAR struct inode *root_inode;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/* fs_inode.c ***************************************************************/ /* fs_inode.c ***************************************************************/
/**************************************************************************** /****************************************************************************
* Name: inode_semtake * Name: inode_semtake
@@ -329,36 +329,9 @@ int files_close(int fd);
void files_release(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 #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
#endif /* _FS_FS_H */ #endif /* __FS_INODE_H */
+1 -1
View File
@@ -46,7 +46,7 @@
#include <errno.h> #include <errno.h>
#include <debug.h> #include <debug.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_rammap.h" #include "fs_rammap.h"
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -49,7 +49,7 @@
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_rammap.h" #include "fs_rammap.h"
#ifdef CONFIG_FS_RAMMAP #ifdef CONFIG_FS_RAMMAP
+1 -1
View File
@@ -49,7 +49,7 @@
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include "fs.h" #include "inode/inode.h"
#include "fs_rammap.h" #include "fs_rammap.h"
#ifdef CONFIG_FS_RAMMAP #ifdef CONFIG_FS_RAMMAP
+1 -1
View File
@@ -55,7 +55,7 @@
#include <nuttx/wqueue.h> #include <nuttx/wqueue.h>
#include <nuttx/fs/automount.h> #include <nuttx/fs/automount.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -49,7 +49,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
#ifndef CONFIG_DISABLE_MOUNTPOUNT #ifndef CONFIG_DISABLE_MOUNTPOUNT
+2 -1
View File
@@ -47,7 +47,8 @@
#include <nuttx/fs/fs.h> #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. /* At least one filesystem must be defined, or this file will not compile.
* It may be desire-able to make filesystems dynamically registered at * It may be desire-able to make filesystems dynamically registered at
+1 -1
View File
@@ -43,7 +43,7 @@
#include <errno.h> #include <errno.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -47,7 +47,7 @@
#include <nuttx/semaphore.h> #include <nuttx/semaphore.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
#ifdef CONFIG_FS_NAMED_SEMAPHORES #ifdef CONFIG_FS_NAMED_SEMAPHORES
+1 -1
View File
@@ -52,7 +52,7 @@
#include <nuttx/semaphore.h> #include <nuttx/semaphore.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
#include "semaphore/semaphore.h" #include "semaphore/semaphore.h"
#ifdef CONFIG_FS_NAMED_SEMAPHORES #ifdef CONFIG_FS_NAMED_SEMAPHORES
+1 -1
View File
@@ -48,7 +48,7 @@
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include "fs.h" #include "inode/inode.h"
#include "semaphore/semaphore.h" #include "semaphore/semaphore.h"
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -48,7 +48,7 @@
# include <nuttx/net/net.h> # include <nuttx/net/net.h>
#endif #endif
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Global Functions * Global Functions
+1 -1
View File
@@ -44,7 +44,7 @@
#include <errno.h> #include <errno.h>
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -43,7 +43,7 @@
#include <sched.h> #include <sched.h>
#include <errno.h> #include <errno.h>
#include "fs.h" #include "inode/inode.h"
/* This logic in this applies only when both socket and file descriptors are /* 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 * in that case, this function descriminates which type of dup2 is being
+1 -1
View File
@@ -48,7 +48,7 @@
#include <nuttx/net/net.h> #include <nuttx/net/net.h>
#include <nuttx/sched.h> #include <nuttx/sched.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
+1 -1
View File
@@ -45,7 +45,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include "fs.h" #include "inode/inode.h"
#if CONFIG_NFILE_DESCRIPTORS > 0 #if CONFIG_NFILE_DESCRIPTORS > 0
+1 -1
View File
@@ -43,7 +43,7 @@
#include <sched.h> #include <sched.h>
#include <errno.h> #include <errno.h>
#include "fs.h" #include "inode/inode.h"
#if CONFIG_NFILE_DESCRIPTORS > 0 #if CONFIG_NFILE_DESCRIPTORS > 0
+1 -1
View File
@@ -47,7 +47,7 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/sched.h> #include <nuttx/sched.h>
#include "fs.h" #include "inode/inode.h"
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions

Some files were not shown because too many files have changed in this diff Show More