commit eb1e713

hovercats  ·  2024-10-04 10:51:47 +0000 UTC
parent 2e029e6
fuse: import from oasis
15 files changed,  +337, -0
+4, -0
1@@ -296,3 +296,7 @@
2 [submodule "pkg/libpkgconf/src"]
3 	path = pkg/libpkgconf/src
4 	url = https://github.com/pkgconf/pkgconf
5+[submodule "pkg/fuse/src"]
6+	path = pkg/fuse/src
7+	url = https://github.com/libfuse/libfuse
8+	ignore = all
+22, -0
 1@@ -0,0 +1,22 @@
 2+#define FUSERMOUNT_DIR "/bin"
 3+#define FUSE_CONF "/etc/fuse.conf"
 4+#define FUSE_USE_VERSION 35
 5+#define IGNORE_MTAB
 6+
 7+#define HAVE_COPY_FILE_RANGE
 8+#define HAVE_FALLOCATE
 9+#define HAVE_FDATASYNC
10+#define HAVE_FORK
11+#define HAVE_FSTATAT
12+#undef HAVE_ICONV
13+#define HAVE_OPENAT
14+#define HAVE_PIPE2
15+#define HAVE_POSIX_FALLOCATE
16+#define HAVE_READLINKAT
17+#define HAVE_SETXATTR
18+#define HAVE_SPLICE
19+#define HAVE_STRUCT_STAT_ST_ATIM
20+#undef HAVE_STRUCT_STAT_ST_ATIMESPEC
21+#define HAVE_UTIMENSAT
22+#define HAVE_VMSPLICE
23+#define PACKAGE_VERSION "3.10.5"
+33, -0
 1@@ -0,0 +1,33 @@
 2+cflags{
 3+	'-std=gnu11', '-Wall', '-Wpedantic',
 4+	'-Wno-overflow',  -- ioctl opcode conversion
 5+	'-D _POSIX_C_SOURCE=200809L',
 6+	'-I $dir',
 7+	'-I $srcdir/include',
 8+	'-I $srcdir/lib',
 9+}
10+
11+pkg.hdrs = copy('$outdir/include', '$srcdir/include', {
12+	'fuse.h',
13+	'fuse_common.h',
14+	'fuse_log.h',
15+	'fuse_lowlevel.h',
16+	'fuse_opt.h',
17+})
18+
19+cc('lib/mount_util.c')
20+
21+exe('fusermount3', {'util/fusermount.c', 'lib/mount_util.c.o'})
22+file('bin/fusermount3', '4755', '$outdir/fusermount3')
23+man{'doc/fusermount3.1'}
24+
25+lib('libfuse.a', [[lib/(
26+	fuse.c fuse_loop.c fuse_loop_mt.c
27+	fuse_lowlevel.c fuse_opt.c
28+	fuse_signals.c buffer.c cuse_lowlevel.c
29+	helper.c modules/subdir.c mount_util.c.o
30+	fuse_log.c
31+	mount.c
32+)]])
33+
34+fetch 'git'
+45, -0
 1@@ -0,0 +1,45 @@
 2+From 374d50ca9322cefef0e2405c0189fb8e13838a3a Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 17 Jun 2019 23:21:39 -0700
 5+Subject: [PATCH] Avoid statement expressions in container_of macro
 6+
 7+---
 8+ lib/fuse.c          | 5 ++---
 9+ lib/fuse_lowlevel.c | 5 ++---
10+ 2 files changed, 4 insertions(+), 6 deletions(-)
11+
12+diff --git a/lib/fuse.c b/lib/fuse.c
13+index a95d7c1..1c7ddbe 100644
14+--- a/lib/fuse.c
15++++ b/lib/fuse.c
16+@@ -93,9 +93,8 @@ struct node_table {
17+ 	size_t split;
18+ };
19+ 
20+-#define container_of(ptr, type, member) ({                              \
21+-			const typeof( ((type *)0)->member ) *__mptr = (ptr); \
22+-			(type *)( (char *)__mptr - offsetof(type,member) );})
23++#define container_of(ptr, type, member)         \
24++	((type *)((char *)ptr - offsetof(type,member)))
25+ 
26+ #define list_entry(ptr, type, member)           \
27+ 	container_of(ptr, type, member)
28+diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
29+index d227688..ccf52d0 100644
30+--- a/lib/fuse_lowlevel.c
31++++ b/lib/fuse_lowlevel.c
32+@@ -39,9 +39,8 @@
33+ #define PARAM(inarg) (((char *)(inarg)) + sizeof(*(inarg)))
34+ #define OFFSET_MAX 0x7fffffffffffffffLL
35+ 
36+-#define container_of(ptr, type, member) ({				\
37+-			const typeof( ((type *)0)->member ) *__mptr = (ptr); \
38+-			(type *)( (char *)__mptr - offsetof(type,member) );})
39++#define container_of(ptr, type, member)         \
40++	((type *)((char *)ptr - offsetof(type,member)))
41+ 
42+ struct fuse_pollhandle {
43+ 	uint64_t kh;
44+-- 
45+2.32.0
46+
+29, -0
 1@@ -0,0 +1,29 @@
 2+From 71ff6ec2055f486f2fe7578d5b3baeebee747e4d Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Wed, 3 Jul 2019 00:52:16 -0700
 5+Subject: [PATCH] Fix build without symbol versioning
 6+
 7+---
 8+ include/fuse.h | 6 +++++-
 9+ 1 file changed, 5 insertions(+), 1 deletion(-)
10+
11+diff --git a/include/fuse.h b/include/fuse.h
12+index 9e6c633..f584a54 100644
13+--- a/include/fuse.h
14++++ b/include/fuse.h
15+@@ -922,7 +922,11 @@ void fuse_lib_help(struct fuse_args *args);
16+  *            `struct fuse_operations.init` handler.
17+  * @return the created FUSE handle
18+  */
19+-#if FUSE_USE_VERSION == 30
20++#if FUSE_USE_VERSION == 31
21++struct fuse *fuse_new_31(struct fuse_args *args, const struct fuse_operations *op,
22++			 size_t op_size, void *private_data);
23++#define fuse_new(args, op, size, data) fuse_new_31(args, op, size, data)
24++#elif FUSE_USE_VERSION == 30
25+ struct fuse *fuse_new_30(struct fuse_args *args, const struct fuse_operations *op,
26+ 			 size_t op_size, void *private_data);
27+ #define fuse_new(args, op, size, data) fuse_new_30(args, op, size, data)
28+-- 
29+2.32.0
30+
+57, -0
 1@@ -0,0 +1,57 @@
 2+From 4526a08c6e97ab0260c2c7ae963626d7f7e18ca2 Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 6 Sep 2021 23:08:22 -0700
 5+Subject: [PATCH] Avoid invalid use of flexible array members
 6+
 7+---
 8+ include/fuse_kernel.h | 10 +++++++---
 9+ lib/fuse_lowlevel.c   |  7 +++----
10+ 2 files changed, 10 insertions(+), 7 deletions(-)
11+
12+diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
13+index 018a00a..939af6a 100644
14+--- a/include/fuse_kernel.h
15++++ b/include/fuse_kernel.h
16+@@ -769,13 +769,17 @@ struct fuse_dirent {
17+ 
18+ struct fuse_direntplus {
19+ 	struct fuse_entry_out entry_out;
20+-	struct fuse_dirent dirent;
21++	uint64_t	ino;
22++	uint64_t	off;
23++	uint32_t	namelen;
24++	uint32_t	type;
25++	char name[];
26+ };
27+ 
28+ #define FUSE_NAME_OFFSET_DIRENTPLUS \
29+-	offsetof(struct fuse_direntplus, dirent.name)
30++	offsetof(struct fuse_direntplus, name)
31+ #define FUSE_DIRENTPLUS_SIZE(d) \
32+-	FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
33++	FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->namelen)
34+ 
35+ struct fuse_notify_inval_inode_out {
36+ 	uint64_t	ino;
37+diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
38+index ccf52d0..a12f5cc 100644
39+--- a/lib/fuse_lowlevel.c
40++++ b/lib/fuse_lowlevel.c
41+@@ -367,11 +367,10 @@ size_t fuse_add_direntry_plus(fuse_req_t req, char *buf, size_t bufsize,
42+ 	if ((buf == NULL) || (entlen_padded > bufsize))
43+ 	  return entlen_padded;
44+ 
45+-	struct fuse_direntplus *dp = (struct fuse_direntplus *) buf;
46+-	memset(&dp->entry_out, 0, sizeof(dp->entry_out));
47+-	fill_entry(&dp->entry_out, e);
48++	struct fuse_direntplus *dirent = (struct fuse_direntplus *) buf;
49++	memset(&dirent->entry_out, 0, sizeof(dirent->entry_out));
50++	fill_entry(&dirent->entry_out, e);
51+ 
52+-	struct fuse_dirent *dirent = &dp->dirent;
53+ 	dirent->ino = e->attr.st_ino;
54+ 	dirent->off = off;
55+ 	dirent->namelen = namelen;
56+-- 
57+2.32.0
58+
+27, -0
 1@@ -0,0 +1,27 @@
 2+From 92210452ee8f336c6121ee2a4d6ffae8a085db15 Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 6 Sep 2021 23:22:16 -0700
 5+Subject: [PATCH] Prevent unused-label warning with IGNORE_MTAB
 6+
 7+---
 8+ lib/mount.c | 2 ++
 9+ 1 file changed, 2 insertions(+)
10+
11+diff --git a/lib/mount.c b/lib/mount.c
12+index 979f8d9..a51731f 100644
13+--- a/lib/mount.c
14++++ b/lib/mount.c
15+@@ -500,8 +500,10 @@ static int fuse_mount_sys(const char *mnt, struct mount_opts *mo,
16+ 
17+ 	return fd;
18+ 
19++#ifndef IGNORE_MTAB
20+ out_umount:
21+ 	umount2(mnt, 2); /* lazy umount */
22++#endif
23+ out_close:
24+ 	free(type);
25+ 	free(source);
26+-- 
27+2.32.0
28+
+25, -0
 1@@ -0,0 +1,25 @@
 2+From b556d59ad2ffa73e4baa4c8345210c70a255296a Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 6 Sep 2021 23:26:54 -0700
 5+Subject: [PATCH] Fix sscanf format specifier
 6+
 7+---
 8+ lib/mount_util.c | 2 +-
 9+ 1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+diff --git a/lib/mount_util.c b/lib/mount_util.c
12+index 35e9948..85ab119 100644
13+--- a/lib/mount_util.c
14++++ b/lib/mount_util.c
15+@@ -360,7 +360,7 @@ int fuse_mnt_parse_fuse_fd(const char *mountpoint)
16+ 	int fd = -1;
17+ 	int len = 0;
18+ 
19+-	if (sscanf(mountpoint, "/dev/fd/%u%n", &fd, &len) == 1 &&
20++	if (sscanf(mountpoint, "/dev/fd/%d%n", &fd, &len) == 1 &&
21+ 	    len == strlen(mountpoint)) {
22+ 		return fd;
23+ 	}
24+-- 
25+2.32.0
26+
+25, -0
 1@@ -0,0 +1,25 @@
 2+From 31a2af8891c0d460942f0c182442615618248388 Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 6 Sep 2021 23:27:23 -0700
 5+Subject: [PATCH] Avoid conversion between function and object pointer
 6+
 7+---
 8+ lib/fuse_lowlevel.c | 2 +-
 9+ 1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
12+index a12f5cc..b864d90 100644
13+--- a/lib/fuse_lowlevel.c
14++++ b/lib/fuse_lowlevel.c
15+@@ -2496,7 +2496,7 @@ static struct {
16+ 	[FUSE_POLL]	   = { do_poll,        "POLL"	     },
17+ 	[FUSE_FALLOCATE]   = { do_fallocate,   "FALLOCATE"   },
18+ 	[FUSE_DESTROY]	   = { do_destroy,     "DESTROY"     },
19+-	[FUSE_NOTIFY_REPLY] = { (void *) 1,    "NOTIFY_REPLY" },
20++	[FUSE_NOTIFY_REPLY] = { (void (*)()) 1, "NOTIFY_REPLY" },
21+ 	[FUSE_BATCH_FORGET] = { do_batch_forget, "BATCH_FORGET" },
22+ 	[FUSE_READDIRPLUS] = { do_readdirplus,	"READDIRPLUS"},
23+ 	[FUSE_RENAME2]     = { do_rename2,      "RENAME2"    },
24+-- 
25+2.32.0
26+
+41, -0
 1@@ -0,0 +1,41 @@
 2+From f66ab008acda13411c1de0c7a3b5d6faeca2df43 Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 6 Sep 2021 23:30:18 -0700
 5+Subject: [PATCH] Define _GNU_SOURCE for realpath()
 6+
 7+---
 8+ lib/helper.c     | 3 +++
 9+ lib/mount_util.c | 3 +++
10+ 2 files changed, 6 insertions(+)
11+
12+diff --git a/lib/helper.c b/lib/helper.c
13+index 64ff7ad..a291fa2 100644
14+--- a/lib/helper.c
15++++ b/lib/helper.c
16+@@ -10,6 +10,9 @@
17+   See the file COPYING.LIB.
18+ */
19+ 
20++/* For realpath() */
21++#define _GNU_SOURCE
22++
23+ #include "config.h"
24+ #include "fuse_i.h"
25+ #include "fuse_misc.h"
26+diff --git a/lib/mount_util.c b/lib/mount_util.c
27+index 85ab119..d242cc2 100644
28+--- a/lib/mount_util.c
29++++ b/lib/mount_util.c
30+@@ -8,6 +8,9 @@
31+   See the file COPYING.LIB.
32+ */
33+ 
34++/* For realpath() */
35++#define _GNU_SOURCE
36++
37+ #include "config.h"
38+ #include "mount_util.h"
39+ #include <stdio.h>
40+-- 
41+2.32.0
42+
+25, -0
 1@@ -0,0 +1,25 @@
 2+From f738d8ef399b4eda78a521ced66b626cc7a3a02b Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 6 Sep 2021 23:36:31 -0700
 5+Subject: [PATCH] Only use symbol versioning on GNU-compatible compilers
 6+
 7+---
 8+ lib/fuse_misc.h | 2 +-
 9+ 1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+diff --git a/lib/fuse_misc.h b/lib/fuse_misc.h
12+index f956ab7..a86717c 100644
13+--- a/lib/fuse_misc.h
14++++ b/lib/fuse_misc.h
15+@@ -12,7 +12,7 @@
16+   Versioned symbols cannot be used in some cases because it
17+     - not supported on MacOSX (in MachO binary format)
18+ */
19+-#ifndef __APPLE__
20++#if !defined(__APPLE__) && defined(__GNUC__)
21+ # if HAVE_SYMVER_ATTRIBUTE
22+ #  define FUSE_SYMVER(sym1, sym2) __attribute__ ((symver (sym2)))
23+ # else
24+-- 
25+2.32.0
26+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit d709c24cbd9e1041264c551c2a4445e654eaf429
+1, -0
1@@ -0,0 +1 @@
2+3.10.5 r2
+1, -0
1@@ -24,6 +24,7 @@ subgen 'fontconfig'
2 subgen 'freetype'
3 subgen 'fribidi'
4 subgen 'fspec-sync'
5+subgen 'fuse'
6 subgen 'git'
7 subgen 'hotplugd'
8 subgen 'iproute2'
+1, -0
1@@ -25,6 +25,7 @@ return {
2 		'dosfstools',
3 		'e2fsprogs',
4 		'file',
5+		'fuse',
6 		'less',
7 		'mandoc',
8 		'netbsd-curses',