Modify FS initialization logic to handle AIO container initialization.
This commit is contained in:
parent
39c26d4cd4
commit
d2797bf482
@ -38,7 +38,7 @@
|
||||
ASRCS =
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
|
||||
CSRCS =
|
||||
CSRCS = fs_initialize.c
|
||||
|
||||
DEPPATH = --dep-path .
|
||||
VPATH = .
|
||||
|
90
fs/fs_initialize.c
Normal file
90
fs/fs_initialize.c
Normal file
@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* fs/fs_initialize.c
|
||||
*
|
||||
* Copyright (C) 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "inode/inode.h"
|
||||
#include "aio/aio.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: fs_initialize
|
||||
*
|
||||
* Description:
|
||||
* This is called from the OS initialization logic to configure the file
|
||||
* system.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void fs_initialize(void)
|
||||
{
|
||||
/* Initial inode, file, and VFS data structures */
|
||||
|
||||
inode_initialize();
|
||||
|
||||
#ifdef CONFIG_FS_AIO
|
||||
/* Initialize for asynchronous I/O */
|
||||
|
||||
aio_initialize();
|
||||
|
||||
#endif
|
||||
}
|
@ -170,7 +170,7 @@ static int _inode_compare(FAR const char *fname,
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: fs_initialize
|
||||
* Name: inode_initialize
|
||||
*
|
||||
* Description:
|
||||
* This is called from the OS initialization logic to configure the file
|
||||
@ -178,10 +178,10 @@ static int _inode_compare(FAR const char *fname,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void fs_initialize(void)
|
||||
void inode_initialize(void)
|
||||
{
|
||||
/* Initialize the semaphore to one (to support one-at-
|
||||
* a-time access to the inode tree).
|
||||
/* Initialize the semaphore to one (to support one-at-a-time access to the
|
||||
* inode tree).
|
||||
*/
|
||||
|
||||
(void)sem_init(&g_inode_sem.sem, 0, 1);
|
||||
|
@ -129,6 +129,17 @@ EXTERN FAR struct inode *root_inode;
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
/* fs_inode.c ***************************************************************/
|
||||
/****************************************************************************
|
||||
* Name: inode_initialize
|
||||
*
|
||||
* Description:
|
||||
* This is called from the OS initialization logic to configure the file
|
||||
* system.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void inode_initialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: inode_semtake
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user