From c9f13d698c4dcd615ae68b16cde2909b6f58064e Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 26 Jul 2023 10:08:48 +0800 Subject: [PATCH] examples: Change unionfs_mount to mount since unionfs_mount isn't exported through syscall Signed-off-by: Xiang Xiao --- examples/thttpd/thttpd_main.c | 11 ++++------- examples/unionfs/unionfs_main.c | 13 ++++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/examples/thttpd/thttpd_main.c b/examples/thttpd/thttpd_main.c index 84d6505e3..9ed04917f 100644 --- a/examples/thttpd/thttpd_main.c +++ b/examples/thttpd/thttpd_main.c @@ -47,10 +47,6 @@ # include #endif -#ifdef CONFIG_THTTPD_BINFS -# include -#endif - #ifdef CONFIG_NET_SLIP # include #endif @@ -138,7 +134,7 @@ #ifdef CONFIG_THTTPD_BINFS # define ROMFS_MOUNTPT "/mnt/tmp1" -# define ROMFS_PREFIX NULL +# define ROMFS_PREFIX "" # define BINFS_MOUNTPT "/mnt/tmp2" # define BINFS_PREFIX "cgi-bin" # 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); - ret = unionfs_mount(ROMFS_MOUNTPT, ROMFS_PREFIX, BINFS_MOUNTPT, - BINFS_PREFIX, UNIONFS_MOUNTPT); + ret = mount(NULL, UNIONFS_MOUNTPT, "unionfs", 0, + "fspath1=" ROMFS_MOUNTPT ",prefix1=" ROMFS_PREFIX + ",fspath2=" BINFS_MOUNTPT ",prefix2=" BINFS_PREFIX); if (ret < 0) { printf("ERROR: Failed to create the union file system at %s: %d\n", diff --git a/examples/unionfs/unionfs_main.c b/examples/unionfs/unionfs_main.c index 8005b1103..31397bc61 100644 --- a/examples/unionfs/unionfs_main.c +++ b/examples/unionfs/unionfs_main.c @@ -39,7 +39,6 @@ #include #include -#include #include "romfs_atestdir.h" #include "romfs_btestdir.h" @@ -75,15 +74,15 @@ #endif #ifndef CONFIG_EXAMPLES_UNIONFS_MOUNTPT -# define "/mnt/unionfs" +# define CONFIG_EXAMPLES_UNIONFS_MOUNTPT "/mnt/unionfs" #endif #ifndef CONFIG_EXAMPLES_UNIONFS_TMPA -# define "/mnt/a" +# define CONFIG_EXAMPLES_UNIONFS_TMPA "/mnt/a" #endif #ifndef CONFIG_EXAMPLES_UNIONFS_TMPB -# define "/mnt/b" +# define CONFIG_EXAMPLES_UNIONFS_TMPB "/mnt/b" #endif #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 */ - ret = unionfs_mount(CONFIG_EXAMPLES_UNIONFS_TMPA, NULL, - CONFIG_EXAMPLES_UNIONFS_TMPB, "offset", - CONFIG_EXAMPLES_UNIONFS_MOUNTPT); + ret = mount(NULL, CONFIG_EXAMPLES_UNIONFS_MOUNTPT, "unionfs", 0, + "fspath1=" CONFIG_EXAMPLES_UNIONFS_TMPA + ",fspath2=" CONFIG_EXAMPLES_UNIONFS_TMPB ",prefix2=offset"); if (ret < 0) { printf("ERROR: Failed to create the union file system: %d\n", ret);