summaryrefslogtreecommitdiff
path: root/nuttx/fs
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-10-06 08:11:37 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-10-06 08:11:37 -0600
commit97454278f2fd737610ac07aa794550ddf2f41b8e (patch)
treeee992e304a721ca74d9cc8e080451a2b3be24465 /nuttx/fs
parent0edf94158596b35cd4fedfc9bcccdad9de49820e (diff)
downloadnuttx-97454278f2fd737610ac07aa794550ddf2f41b8e.tar.gz
nuttx-97454278f2fd737610ac07aa794550ddf2f41b8e.tar.bz2
nuttx-97454278f2fd737610ac07aa794550ddf2f41b8e.zip
Modify FS initialization logic to handle AIO container initialization.
Diffstat (limited to 'nuttx/fs')
-rw-r--r--nuttx/fs/Makefile2
-rw-r--r--nuttx/fs/fs_initialize.c90
-rw-r--r--nuttx/fs/inode/fs_inode.c8
-rw-r--r--nuttx/fs/inode/inode.h11
4 files changed, 106 insertions, 5 deletions
diff --git a/nuttx/fs/Makefile b/nuttx/fs/Makefile
index 92f1a9400..0c7250604 100644
--- a/nuttx/fs/Makefile
+++ b/nuttx/fs/Makefile
@@ -38,7 +38,7 @@
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
-CSRCS =
+CSRCS = fs_initialize.c
DEPPATH = --dep-path .
VPATH = .
diff --git a/nuttx/fs/fs_initialize.c b/nuttx/fs/fs_initialize.c
new file mode 100644
index 000000000..eceb3c5c2
--- /dev/null
+++ b/nuttx/fs/fs_initialize.c
@@ -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
+}
diff --git a/nuttx/fs/inode/fs_inode.c b/nuttx/fs/inode/fs_inode.c
index b3ed320a9..805a2de6e 100644
--- a/nuttx/fs/inode/fs_inode.c
+++ b/nuttx/fs/inode/fs_inode.c
@@ -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);
diff --git a/nuttx/fs/inode/inode.h b/nuttx/fs/inode/inode.h
index 6bd412ac0..c1a7468a5 100644
--- a/nuttx/fs/inode/inode.h
+++ b/nuttx/fs/inode/inode.h
@@ -130,6 +130,17 @@ EXTERN FAR struct inode *root_inode;
****************************************************************************/
/* 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
*
* Description: