control: tags 1084421 + pending control: tags 1084421 + patch Will be uploading package on mentors with fuse3 port. Regards, Syed Shahrukh Hussain.
From: Syed-Shahrukh Hussain <syed.shahrukh@ossrevival.org>
Date: Thu, 18 Dec 2025 10:00:06 +0500
Subject: Migrate from FUSE2 to FUSE3.
--- a/plpfuse/Makefile.am
+++ b/plpfuse/Makefile.am
@@ -1,7 +1,7 @@
-AM_CPPFLAGS=-I$(top_srcdir)/lib $(FUSE_CFLAGS)
+AM_CPPFLAGS=-I$(top_srcdir)/lib $(FUSE3_CFLAGS)
sbin_PROGRAMS = plpfuse
-plpfuse_LDADD = $(LIB_PLP) $(INTLLIBS) $(FUSE_LIBS) -lattr
+plpfuse_LDADD = $(LIB_PLP) $(INTLLIBS) $(FUSE3_LIBS) -lattr
plpfuse_SOURCES = main.cc fuse.c
EXTRA_DIST = rfsv_api.h plpfuse.h
--- a/plpfuse/fuse.c
+++ b/plpfuse/fuse.c
@@ -7,6 +7,9 @@
See the file COPYING.
*/
+#define FUSE_USE_VERSION 31
+
+#include <fuse3/fuse.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -213,8 +216,9 @@
return ret;
}
-static int plp_getattr(const char *path, struct stat *st)
+static int plp_getattr(const char *path, struct stat *st, struct fuse_file_info *fi)
{
+ (void)fi;
char xattr[XATTR_MAXLEN + 1];
int ret = 0;
@@ -281,8 +285,9 @@
static int plp_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
- off_t offset, struct fuse_file_info *fi)
+ off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags flags)
{
+ (void)(flags);
device *dp;
dentry *e = NULL;
char xattr[XATTR_MAXLEN + 1];
@@ -303,7 +308,7 @@
name[1] = ':';
name[2] = '\0';
pattr2attr(dp->attrib, 1, 0, &st, xattr);
- if (filler(buf, (char *)name, &st, 0))
+ if (filler(buf, (char *)name, &st, 0, FUSE_FILL_DIR_PLUS))
break;
}
}
@@ -321,7 +326,7 @@
pattr2attr(e->attr, e->size, e->time, &st, xattr);
debuglog(" %s %o %d %d", name, st.st_mode, st.st_size, st.st_mtime);
- if (filler(buf, name, &st, 0))
+ if (filler(buf, name, &st, 0, FUSE_FILL_DIR_PLUS))
break;
free(e->name);
o = e;
@@ -373,8 +378,9 @@
return -EPERM;
}
-static int plp_rename(const char *from, const char *to)
+static int plp_rename(const char *from, const char *to, unsigned int flag)
{
+ (void)flag;
debuglog("plp_rename `%s' -> `%s'", ++from, ++to);
rfsv_remove(to);
return rfsv_rename(from, to);
@@ -386,8 +392,9 @@
return -EPERM;
}
-static int plp_chmod(const char *path, mode_t mode)
+static int plp_chmod(const char *path, mode_t mode, struct fuse_file_info *fi)
{
+ (void)fi;
int ret;
long psisattr, psidattr, pattr, psize, ptime;
struct stat st;
@@ -473,22 +480,25 @@
return -ENOTSUP;
}
-static int plp_chown(const char *path, uid_t uid, gid_t gid)
+static int plp_chown(const char *path, uid_t uid, gid_t gid, struct fuse_file_info *fi)
{
(void)uid;
(void)gid;
+ (void)fi;
debuglog("plp_chown `%s'", ++path);
return -EPERM;
}
-static int plp_truncate(const char *path, off_t size)
+static int plp_truncate(const char *path, off_t size, struct fuse_file_info *fi)
{
+ (void)fi;
debuglog("plp_truncate `%s'", ++path);
return rfsv_setsize(path, size);
}
-static int plp_utimens(const char *path, const struct timespec ts[2])
+static int plp_utimens(const char *path, const struct timespec ts[2], struct fuse_file_info *fi)
{
+ (void)fi;
debuglog("plp_utimens `%s'", ++path);
return rfsv_setmtime(path, ts[1].tv_sec);
}
--- a/plpfuse/main.cc
+++ b/plpfuse/main.cc
@@ -50,7 +50,7 @@
#endif
#include <getopt.h>
-#include <fuse/fuse_lowlevel.h>
+#include <fuse3/fuse_lowlevel.h>
using namespace std;
@@ -393,18 +393,17 @@
int fuse(int argc, char *argv[])
{
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
- struct fuse_chan *ch;
- char *mountpoint;
+ struct fuse_cmdline_opts opts;
+ struct fuse *fp;
int err = -1, foreground;
- if (fuse_parse_cmdline(&args, &mountpoint, NULL, &foreground) != -1 &&
- (ch = fuse_mount(mountpoint, &args)) != NULL) {
- if (fuse_daemonize(foreground) != -1) {
- struct fuse *fp = fuse_new(ch, &args, &plp_oper, sizeof(plp_oper), NULL);
- if (fp != NULL)
+ if (fuse_parse_cmdline(&args, &opts) != -1) {
+ if (fuse_daemonize(opts.foreground) != -1) {
+ fp = fuse_new(&args, &plp_oper, sizeof(plp_oper), NULL);
+ if (fp != NULL && (fuse_mount(fp, opts.mountpoint)) != 0)
err = fuse_loop(fp);
}
- fuse_unmount(mountpoint, ch);
+ fuse_unmount(fp);
}
fuse_opt_free_args(&args);
--- a/plpfuse/plpfuse.h
+++ b/plpfuse/plpfuse.h
@@ -5,7 +5,7 @@
#ifndef _plpfuse_h_
#define _plpfuse_h_
-#include <fuse.h>
+#include <fuse3/fuse.h>
typedef struct p_inode {
int inode;
Attachment:
signature.asc
Description: PGP signature