unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fuse3 branch updates
@ 2023-07-26 12:45 Eric Wong
  2023-07-26 12:45 ` [PATCH 1/2] f3: safer fixed buffer size for alternate F3_NS Eric Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Wong @ 2023-07-26 12:45 UTC (permalink / raw)
  To: meta

Brain is fried from coderepo <=> inbox joins, some FUSE3 stuff
from the other project using this shim...

Patch 2/2: naming things is hard  :<  I think `lei' is a
suitable FS name, since `leifs' is very confusing.
The mount executable can be `lei.fuse'...

Eric Wong (2):
  f3: safer fixed buffer size for alternate F3_NS
  f3: define F3_NS in cflags rather than C code

 lib/PublicInbox/LeiF3.pm | 5 +++--
 lib/PublicInbox/f3.h     | 8 +++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] f3: safer fixed buffer size for alternate F3_NS
  2023-07-26 12:45 [PATCH 0/2] fuse3 branch updates Eric Wong
@ 2023-07-26 12:45 ` Eric Wong
  2023-07-26 12:45 ` [PATCH 2/2] f3: define F3_NS in cflags rather than C code Eric Wong
  2023-08-02 21:35 ` [PATCH 3/2] f3: fix test with updated executable name Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2023-07-26 12:45 UTC (permalink / raw)
  To: meta

This accounts for longer F3_NS values if we need them.
---
 lib/PublicInbox/f3.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/f3.h b/lib/PublicInbox/f3.h
index 3ac3f575..4494e61b 100644
--- a/lib/PublicInbox/f3.h
+++ b/lib/PublicInbox/f3.h
@@ -1347,7 +1347,7 @@ f3_getxattr(fuse_req_t req, fuse_ino_t ino, const char *name, size_t size)
 	size_t rlen = sizeof(fxr);
 
 	if (ino == FUSE_ROOT_ID) { /* show f3 internal vars */
-		char x[80];
+		char x[sizeof(F3_NS) + 75];
 		int n = INT_MAX;
 
 		if (!strcmp(name, F3_NS".entry_timeout"))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] f3: define F3_NS in cflags rather than C code
  2023-07-26 12:45 [PATCH 0/2] fuse3 branch updates Eric Wong
  2023-07-26 12:45 ` [PATCH 1/2] f3: safer fixed buffer size for alternate F3_NS Eric Wong
@ 2023-07-26 12:45 ` Eric Wong
  2023-08-02 21:35 ` [PATCH 3/2] f3: fix test with updated executable name Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2023-07-26 12:45 UTC (permalink / raw)
  To: meta

This enhances reusability in other projects which use the same C
shim.  The executable will also be `lei.fuse' rather than `leifs',
because `leifs' is likely confused as `leafs' which makes no
sense.
---
 lib/PublicInbox/LeiF3.pm | 5 +++--
 lib/PublicInbox/f3.h     | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/LeiF3.pm b/lib/PublicInbox/LeiF3.pm
index 74ad135d..1121340a 100644
--- a/lib/PublicInbox/LeiF3.pm
+++ b/lib/PublicInbox/LeiF3.pm
@@ -13,11 +13,12 @@ use PublicInbox::Spawn;
 my $dir = ($ENV{PERL_INLINE_DIRECTORY} //
 	die('BUG: PERL_INLINE_DIRECTORY unset')) . '/f3';
 my $F3_NS = 'lei';
-my $bin = "$dir/${F3_NS}fs.fuse";
+my $bin = "$dir/${F3_NS}.fuse";
 my ($srcpfx) = (__FILE__ =~ m!\A(.+/)[^/]+\z!);
 my @srcs = map { $srcpfx.$_ } qw(f3.h);
 my $xflags = ($ENV{CFLAGS} // '-Wall -ggdb3 -O0') . ' ' .
-	($ENV{LDFLAGS} // '-Wl,-O1 -Wl,--compress-debug-sections=zlib');
+	($ENV{LDFLAGS} // '-Wl,-O1 -Wl,--compress-debug-sections=zlib') .
+	qq{ -DF3_NS='"$F3_NS"'};
 
 sub xflags_chg () {
 	open my $fh, '<', "$dir/XFLAGS" or return 1;
diff --git a/lib/PublicInbox/f3.h b/lib/PublicInbox/f3.h
index 4494e61b..4572f7f2 100644
--- a/lib/PublicInbox/f3.h
+++ b/lib/PublicInbox/f3.h
@@ -8,7 +8,9 @@
  */
 
 /* another project may use this: */
-#define F3_NS "lei"
+#ifndef F3_NS
+#error F3_NS not defined
+#endif
 
 #define _GNU_SOURCE
 #define _FILE_OFFSET_BITS 64
@@ -126,7 +128,7 @@ static struct f3_data f3 = {
 };
 
 static const struct fuse_opt f3_opt[] = {
-	/* *-fd and root-vid are internal knobs */
+	/* *-fd and root-vid are internal knobs used by perl mount wrapper */
 	{ "reader-fd=%d", offsetof(struct f3_data, rfd) },
 	{ "worker-fd=%d", offsetof(struct f3_data, wfd) },
 	{ "root-vid=%"PRId64, offsetof(struct f3_data, vroot.vid) },

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/2] f3: fix test with updated executable name
  2023-07-26 12:45 [PATCH 0/2] fuse3 branch updates Eric Wong
  2023-07-26 12:45 ` [PATCH 1/2] f3: safer fixed buffer size for alternate F3_NS Eric Wong
  2023-07-26 12:45 ` [PATCH 2/2] f3: define F3_NS in cflags rather than C code Eric Wong
@ 2023-08-02 21:35 ` Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2023-08-02 21:35 UTC (permalink / raw)
  To: meta

Only noticed since this was on a new PERL_INLINE_DIRECTORY;
not sure if there's a good way to test this without blowing
away caches and slowing down tests even more :<
---
 t/lei_f3.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/lei_f3.t b/t/lei_f3.t
index feebf534..5196618e 100644
--- a/t/lei_f3.t
+++ b/t/lei_f3.t
@@ -12,7 +12,7 @@ if (my $err = $@) {
 	my $pkg_config = $ENV{PKG_CONFIG} // 'pkg-config';
 	like($err, qr/$pkg_config.*failed/, 'build failed');
 } else {
-	ok(-x "$ENV{PERL_INLINE_DIRECTORY}/f3/leifs.fuse",
+	ok(-x "$ENV{PERL_INLINE_DIRECTORY}/f3/lei.fuse",
 		'built executable');
 }
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-02 21:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26 12:45 [PATCH 0/2] fuse3 branch updates Eric Wong
2023-07-26 12:45 ` [PATCH 1/2] f3: safer fixed buffer size for alternate F3_NS Eric Wong
2023-07-26 12:45 ` [PATCH 2/2] f3: define F3_NS in cflags rather than C code Eric Wong
2023-08-02 21:35 ` [PATCH 3/2] f3: fix test with updated executable name Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).