examples: Change unionfs_mount to mount
since unionfs_mount isn't exported through syscall Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
52ec336c55
commit
c9f13d698c
@ -47,10 +47,6 @@
|
|||||||
# include <sys/boardctl.h>
|
# include <sys/boardctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_THTTPD_BINFS
|
|
||||||
# include <nuttx/fs/unionfs.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_NET_SLIP
|
#ifdef CONFIG_NET_SLIP
|
||||||
# include <nuttx/net/net.h>
|
# include <nuttx/net/net.h>
|
||||||
#endif
|
#endif
|
||||||
@ -138,7 +134,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_THTTPD_BINFS
|
#ifdef CONFIG_THTTPD_BINFS
|
||||||
# define ROMFS_MOUNTPT "/mnt/tmp1"
|
# define ROMFS_MOUNTPT "/mnt/tmp1"
|
||||||
# define ROMFS_PREFIX NULL
|
# define ROMFS_PREFIX ""
|
||||||
# define BINFS_MOUNTPT "/mnt/tmp2"
|
# define BINFS_MOUNTPT "/mnt/tmp2"
|
||||||
# define BINFS_PREFIX "cgi-bin"
|
# define BINFS_PREFIX "cgi-bin"
|
||||||
# define UNIONFS_MOUNTPT CONFIG_THTTPD_PATH
|
# define UNIONFS_MOUNTPT CONFIG_THTTPD_PATH
|
||||||
@ -294,8 +290,9 @@ int main(int argc, FAR char *argv[])
|
|||||||
|
|
||||||
printf("Creating UNIONFS filesystem at %s\n", UNIONFS_MOUNTPT);
|
printf("Creating UNIONFS filesystem at %s\n", UNIONFS_MOUNTPT);
|
||||||
|
|
||||||
ret = unionfs_mount(ROMFS_MOUNTPT, ROMFS_PREFIX, BINFS_MOUNTPT,
|
ret = mount(NULL, UNIONFS_MOUNTPT, "unionfs", 0,
|
||||||
BINFS_PREFIX, UNIONFS_MOUNTPT);
|
"fspath1=" ROMFS_MOUNTPT ",prefix1=" ROMFS_PREFIX
|
||||||
|
",fspath2=" BINFS_MOUNTPT ",prefix2=" BINFS_PREFIX);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
printf("ERROR: Failed to create the union file system at %s: %d\n",
|
printf("ERROR: Failed to create the union file system at %s: %d\n",
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <nuttx/drivers/ramdisk.h>
|
#include <nuttx/drivers/ramdisk.h>
|
||||||
#include <nuttx/fs/unionfs.h>
|
|
||||||
|
|
||||||
#include "romfs_atestdir.h"
|
#include "romfs_atestdir.h"
|
||||||
#include "romfs_btestdir.h"
|
#include "romfs_btestdir.h"
|
||||||
@ -75,15 +74,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_EXAMPLES_UNIONFS_MOUNTPT
|
#ifndef CONFIG_EXAMPLES_UNIONFS_MOUNTPT
|
||||||
# define "/mnt/unionfs"
|
# define CONFIG_EXAMPLES_UNIONFS_MOUNTPT "/mnt/unionfs"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_EXAMPLES_UNIONFS_TMPA
|
#ifndef CONFIG_EXAMPLES_UNIONFS_TMPA
|
||||||
# define "/mnt/a"
|
# define CONFIG_EXAMPLES_UNIONFS_TMPA "/mnt/a"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_EXAMPLES_UNIONFS_TMPB
|
#ifndef CONFIG_EXAMPLES_UNIONFS_TMPB
|
||||||
# define "/mnt/b"
|
# define CONFIG_EXAMPLES_UNIONFS_TMPB "/mnt/b"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NSECTORS(b) (((b)+CONFIG_EXAMPLES_UNIONFS_SECTORSIZE-1)/CONFIG_EXAMPLES_UNIONFS_SECTORSIZE)
|
#define NSECTORS(b) (((b)+CONFIG_EXAMPLES_UNIONFS_SECTORSIZE-1)/CONFIG_EXAMPLES_UNIONFS_SECTORSIZE)
|
||||||
@ -175,9 +174,9 @@ int main(int argc, FAR char *argv[])
|
|||||||
|
|
||||||
/* Now create and mount the union file system */
|
/* Now create and mount the union file system */
|
||||||
|
|
||||||
ret = unionfs_mount(CONFIG_EXAMPLES_UNIONFS_TMPA, NULL,
|
ret = mount(NULL, CONFIG_EXAMPLES_UNIONFS_MOUNTPT, "unionfs", 0,
|
||||||
CONFIG_EXAMPLES_UNIONFS_TMPB, "offset",
|
"fspath1=" CONFIG_EXAMPLES_UNIONFS_TMPA
|
||||||
CONFIG_EXAMPLES_UNIONFS_MOUNTPT);
|
",fspath2=" CONFIG_EXAMPLES_UNIONFS_TMPB ",prefix2=offset");
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
printf("ERROR: Failed to create the union file system: %d\n", ret);
|
printf("ERROR: Failed to create the union file system: %d\n", ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user