Squashed commit of the following:

fs/userfs:  This completes coding of the UserFS client and of the UserFS feature in general.  This feature is being merged to main now because I believe it is innocuous.  It is, however, untesed.  The next step will be to develop a test case to verify the feature.
    fs/userfs:  Completes the request logic for the UserFS client.  Still need the logic that receives the responses.
    fs/userfs:  Completes coding for most of the server side of the user filesystem logic.
    fs/userfs:  Big design changes, simplications. Use Unix domain local sockets instead of message queues.  Easier to transfer big data in local sockets than message queues.  Remove character drvier 'factory' it is not necessary.
    fs/userfs:  Minor reparitioning; volume private info does not need to be held on the OS client side.
    libc/userfs:  Add some of the server side logic.
    fs/userfs:  Add some UserFS initialization logic.
    fs/userfs:  Add frame work for the UserFS proxy.  Remove all references to a block driver.  There is no block dricer... what was I thinking?
    fs/userfs: Add some initialization of the character driver, 'factory' device.
    fs/userfs:  Rename from fusefs to userfs to that we don't stomp on someone else's cool name.
    Add a header file describing the fusefs interface.
This commit is contained in:
Gregory Nutt
2017-10-30 18:04:28 -06:00
parent ef1ca963a5
commit 6e9039bb08
21 changed files with 3509 additions and 9 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ else
OTHERDIRS += audio
endif
ifeq ($(CONFIG_DRIVERS_WIRELESS),y)
ifeq ($(CONFIG_WIRELESS),y)
NONFSDIRS += wireless
else
OTHERDIRS += wireless
+12 -3
View File
@@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/mm/iob.h>
#include <nuttx/serial/pty.h>
#include <arch/board/board.h>
@@ -188,11 +189,19 @@ void up_initialize(void)
ramlog_consoleinit();
#endif
/* Initialize the system logging device */
#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1)
/* Register the master pseudo-terminal multiplexor device */
#ifdef CONFIG_SYSLOG_CHAR
syslog_initialize();
(void)ptmx_register();
#endif
/* Early initialization of the system logging device. Some SYSLOG channel
* can be initialized early in the initialization sequence because they
* depend on only minimal OS initialization.
*/
syslog_initialize(SYSLOG_INIT_EARLY);
#ifdef CONFIG_RAMLOG_SYSLOG
ramlog_sysloginit();
#endif
+1
View File
@@ -86,4 +86,5 @@ source fs/smartfs/Kconfig
source fs/binfs/Kconfig
source fs/procfs/Kconfig
source fs/unionfs/Kconfig
source fs/userfs/Kconfig
source fs/hostfs/Kconfig
+3 -1
View File
@@ -1,7 +1,8 @@
############################################################################
# fs/Makefile
#
# Copyright (C) 2007, 2008, 2011-2014, 2016-2017 Gregory Nutt. All rights reserved.
# Copyright (C) 2007, 2008, 2011-2014, 2016-2017 Gregory Nutt. All rights
# reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -71,6 +72,7 @@ include smartfs/Make.defs
include binfs/Make.defs
include procfs/Make.defs
include unionfs/Make.defs
include userfs/Make.defs
include hostfs/Make.defs
endif
+7 -1
View File
@@ -132,6 +132,12 @@ FAR const char *fs_gettype(FAR struct statfs *statbuf)
break;
#endif
#ifdef CONFIG_FS_USERFS
case USERFS_MAGIC:
fstype = "userfs";
break;
#endif
default:
fstype = "Unrecognized";
break;
@@ -140,4 +146,4 @@ FAR const char *fs_gettype(FAR struct statfs *statbuf)
return fstype;
}
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
+7 -1
View File
@@ -79,7 +79,7 @@
#if defined(CONFIG_FS_NXFFS) || defined(CONFIG_FS_BINFS) || \
defined(CONFIG_FS_PROCFS) || defined(CONFIG_NFS) || \
defined(CONFIG_FS_TMPFS)
defined(CONFIG_FS_TMPFS) || defined(CONFIG_FS_USERFS)
# define NONBDFS_SUPPORT
#endif
@@ -139,6 +139,9 @@ extern const struct mountpt_operations binfs_operations;
#ifdef CONFIG_FS_PROCFS
extern const struct mountpt_operations procfs_operations;
#endif
#ifdef CONFIG_FS_USERFS
extern const struct mountpt_operations userfs_operations;
#endif
#ifdef CONFIG_FS_HOSTFS
extern const struct mountpt_operations hostfs_operations;
#endif
@@ -160,6 +163,9 @@ static const struct fsmap_t g_nonbdfsmap[] =
#ifdef CONFIG_FS_PROCFS
{ "procfs", &procfs_operations },
#endif
#ifdef CONFIG_FS_USERFS
{ "userfs", &userfs_operations },
#endif
#ifdef CONFIG_FS_HOSTFS
{ "hostfs", &hostfs_operations },
#endif
+14
View File
@@ -0,0 +1,14 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config FS_USERFS
bool "User file system"
default n
depends on NET_LOCAL
---help---
Enable support for user file system. See include/nuttx/fs/userfs.h
if FS_USERFS
endif
+46
View File
@@ -0,0 +1,46 @@
############################################################################
# fs/userfs/Make.defs
#
# Copyright (C) 2017 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.
#
############################################################################
ifeq ($(CONFIG_FS_USERFS),y)
# Add the userfs C files to the build
CSRCS += fs_userfs.c
# Add the userfs directory to the build
DEPPATH += --dep-path userfs
VPATH += :userfs
endif
File diff suppressed because it is too large Load Diff
+52
View File
@@ -0,0 +1,52 @@
/****************************************************************************
* fs/userfs/userfs.h
*
* Copyright (C) 2017 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_USERFS_USERFS_H
#define __FS_USERFS_USERFS_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#ifdef CONFIG_FS_USERFS
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#endif /* CONFIG_FS_USERFS */
#endif /* __FS_USERFS_USERFS_H */
+15 -1
View File
@@ -177,6 +177,17 @@ struct fs_unionfsdir_s
};
#endif
#ifdef CONFIG_FS_USERFS
/* The UserFS uses an opaque representation since the actual userspace representation
* of the directory state structure is unknowable.
*/
struct fs_userfsdir_s
{
FAR void *fs_dir; /* Opaque pointer to UserFS DIR */
};
#endif
#ifdef CONFIG_FS_HOSTFS
/* HOSTFS provides mapping to directories on the host machine in the
* sim environment.
@@ -184,7 +195,7 @@ struct fs_unionfsdir_s
struct fs_hostfsdir_s
{
FAR void *fs_dir; /* Opaque pointer to host DIR * */
FAR void *fs_dir; /* Opaque pointer to host DIR */
};
#endif
@@ -254,6 +265,9 @@ struct fs_dirent_s
#ifdef CONFIG_FS_UNIONFS
struct fs_unionfsdir_s unionfs;
#endif
#ifdef CONFIG_FS_USERFS
struct fs_userfsdir_s userfs;
#endif
#ifdef CONFIG_FS_HOSTFS
struct fs_hostfsdir_s hostfs;
#endif
+5
View File
@@ -149,6 +149,11 @@
#define FIONSPACE _FIOC(0x0007) /* IN: Location to return value (int *)
* OUT: Free space in send queue.
*/
#define FIONUSERFS _FIOC(0x0008) /* IN: Pointer to struct usefs_config_s
* holding userfs configuration.
* OUT: Instance number is returned on
* success.
*/
/* NuttX file system ioctl definitions **************************************/
File diff suppressed because it is too large Load Diff
+1
View File
@@ -104,6 +104,7 @@
#define SMARTFS_MAGIC 0x54524D53
#define UNIONFS_MAGIC 0x53464e55
#define HOSTFS_MAGIC 0x54534f48
#define USERFS_MAGIC 0x52455355
/****************************************************************************
* Type Definitions
+1
View File
@@ -22,3 +22,4 @@ source libc/netdb/Kconfig
source libc/misc/Kconfig
source libc/wqueue/Kconfig
source libc/hex2bin/Kconfig
source libc/userfs/Kconfig
+1
View File
@@ -94,6 +94,7 @@ include unistd/Make.defs
include wchar/Make.defs
include wctype/Make.defs
include wqueue/Make.defs
include userfs/Make.defs
# REVISIT: Backslash causes problems in $(COBJS) target
DELIM := $(strip /)
+10
View File
@@ -0,0 +1,10 @@
/.built
/.tzbuilt
/.tzunpack
/romfs_zoneinfo.img
/romfs_zoneinfo.h
/tzbin
/tzcode-latest.tar.gz
/tzcode
/tzdata-latest.tar.gz
+4
View File
@@ -0,0 +1,4 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
+47
View File
@@ -0,0 +1,47 @@
############################################################################
# libc/userfs/Make.defs
#
# Copyright (C) 2017 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.
#
############################################################################
ifeq ($(CONFIG_FS_USERFS),y)
# Add the internal C files to the build
CSRCS += lib_userfs.c
# Add the userfs directory to the build
DEPPATH += --dep-path userfs
VPATH += :userfs
endif
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
apps/system/zoninfo/README.txt
apps/system/zoneinfo/README.txt
Author: Gregory Nutt <gnutt@nuttx.org>
Directory Contents