From d8e605e75c8ca614793447065595a3755764f115 Mon Sep 17 00:00:00 2001 From: Chunmei Xu Date: Wed, 23 Mar 2022 00:22:38 +0800 Subject: [PATCH] change to fuse3 Signed-off-by: Chunmei Xu --- 0001-change-to-use-fuse3.patch | 177 +++++++++++++++++++++++++++++++++ e2fsprogs.spec | 14 ++- 2 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 0001-change-to-use-fuse3.patch diff --git a/0001-change-to-use-fuse3.patch b/0001-change-to-use-fuse3.patch new file mode 100644 index 0000000..b782d50 --- /dev/null +++ b/0001-change-to-use-fuse3.patch @@ -0,0 +1,177 @@ +From 2705c51d4253ac8e45cc06d68b46ed36b28553c2 Mon Sep 17 00:00:00 2001 +From: Chunmei Xu +Date: Tue, 22 Mar 2022 23:42:19 +0800 +Subject: [PATCH] change to use fuse3 + +Signed-off-by: Chunmei Xu +--- + configure.ac | 10 +++++----- + misc/fuse2fs.c | 30 ++++++++++-------------------- + 2 files changed, 15 insertions(+), 25 deletions(-) + +diff --git a/configure.ac b/configure.ac +index dff3d1ca..59dc0000 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1286,10 +1286,10 @@ else + AC_CHECK_HEADERS([pthread.h fuse.h], [], + [AC_MSG_FAILURE([Cannot find fuse2fs headers.])], + [#define _FILE_OFFSET_BITS 64 +-#define FUSE_USE_VERSION 29]) ++#define FUSE_USE_VERSION 30]) + + AC_PREPROC_IFELSE( +-[AC_LANG_PROGRAM([[#define FUSE_USE_VERSION 29 ++[AC_LANG_PROGRAM([[#define FUSE_USE_VERSION 30 + #ifdef __linux__ + #include + #include +@@ -1298,14 +1298,14 @@ else + ]], [])], [], [AC_MSG_FAILURE([Cannot find fuse2fs Linux headers.])]) + + AC_CHECK_LIB(osxfuse, fuse_main, [FUSE_LIB=-losxfuse], +- [AC_CHECK_LIB(fuse, fuse_main, [FUSE_LIB=-lfuse], ++ [AC_CHECK_LIB(fuse3, fuse_main_real, [FUSE_LIB=-lfuse3], + [AC_MSG_FAILURE([Cannot find fuse library.])])]) + AC_MSG_RESULT([Enabling fuse2fs]) + fi + , + AC_CHECK_HEADERS([pthread.h fuse.h], [], [FUSE_CMT="#"], + [#define _FILE_OFFSET_BITS 64 +-#define FUSE_USE_VERSION 29 ++#define FUSE_USE_VERSION 30 + #ifdef __linux__ + # include + # include +@@ -1314,7 +1314,7 @@ AC_CHECK_HEADERS([pthread.h fuse.h], [], [FUSE_CMT="#"], + if test -z "$FUSE_CMT" + then + AC_CHECK_LIB(osxfuse, fuse_main, [FUSE_LIB=-losxfuse], +-[AC_CHECK_LIB(fuse, fuse_main, [FUSE_LIB=-lfuse], [FUSE_CMT="#"])]) ++[AC_CHECK_LIB(fuse3, fuse_main_real, [FUSE_LIB=-lfuse3], [FUSE_CMT="#"])]) + fi + if test -z "$FUSE_CMT" + then +diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c +index c5957212..68fe9091 100644 +--- a/misc/fuse2fs.c ++++ b/misc/fuse2fs.c +@@ -9,7 +9,7 @@ + * %End-Header% + */ + #define _FILE_OFFSET_BITS 64 +-#define FUSE_USE_VERSION 29 ++#define FUSE_USE_VERSION 30 + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #endif +@@ -727,7 +727,7 @@ static void op_destroy(void *p EXT2FS_ATTR((unused))) + } + } + +-static void *op_init(struct fuse_conn_info *conn) ++static void *op_init(struct fuse_conn_info *conn, struct fuse_config *cfg) + { + struct fuse_context *ctxt = fuse_get_context(); + struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data; +@@ -797,7 +797,7 @@ static int stat_inode(ext2_filsys fs, ext2_ino_t ino, struct stat *statbuf) + return ret; + } + +-static int op_getattr(const char *path, struct stat *statbuf) ++static int op_getattr(const char *path, struct stat *statbuf, struct fuse_file_info *fi) + { + struct fuse_context *ctxt = fuse_get_context(); + struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data; +@@ -1541,7 +1541,7 @@ static int update_dotdot_helper(ext2_ino_t dir EXT2FS_ATTR((unused)), + return 0; + } + +-static int op_rename(const char *from, const char *to) ++static int op_rename(const char *from, const char *to, unsigned int flags) + { + struct fuse_context *ctxt = fuse_get_context(); + struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data; +@@ -1870,7 +1870,7 @@ out: + return ret; + } + +-static int op_chmod(const char *path, mode_t mode) ++static int op_chmod(const char *path, mode_t mode, struct fuse_file_info *fi) + { + struct fuse_context *ctxt = fuse_get_context(); + struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data; +@@ -1929,7 +1929,7 @@ out: + return ret; + } + +-static int op_chown(const char *path, uid_t owner, gid_t group) ++static int op_chown(const char *path, uid_t owner, gid_t group, struct fuse_file_info *fi) + { + struct fuse_context *ctxt = fuse_get_context(); + struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data; +@@ -1999,7 +1999,7 @@ out: + return ret; + } + +-static int op_truncate(const char *path, off_t len) ++static int op_truncate(const char *path, off_t len, struct fuse_file_info *fi) + { + struct fuse_context *ctxt = fuse_get_context(); + struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data; +@@ -2751,7 +2751,7 @@ static int op_readdir_iter(ext2_ino_t dir EXT2FS_ATTR((unused)), + + memcpy(namebuf, dirent->name, dirent->name_len & 0xFF); + namebuf[dirent->name_len & 0xFF] = 0; +- ret = i->func(i->buf, namebuf, NULL, 0); ++ ret = i->func(i->buf, namebuf, NULL, 0, 0); + if (ret) + return DIRENT_ABORT; + +@@ -2761,7 +2761,7 @@ static int op_readdir_iter(ext2_ino_t dir EXT2FS_ATTR((unused)), + static int op_readdir(const char *path EXT2FS_ATTR((unused)), + void *buf, fuse_fill_dir_t fill_func, + off_t offset EXT2FS_ATTR((unused)), +- struct fuse_file_info *fp) ++ struct fuse_file_info *fp, enum fuse_readdir_flags flags) + { + struct fuse_context *ctxt = fuse_get_context(); + struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data; +@@ -3568,7 +3568,7 @@ out: + return ret; + } + # endif /* SUPPORT_FALLOCATE */ +-#endif /* FUSE 29 */ ++#endif /* FUSE 30 */ + + static struct fuse_operations fs_ops = { + .init = op_init, +@@ -3601,14 +3601,6 @@ static struct fuse_operations fs_ops = { + .fsyncdir = op_fsync, + .access = op_access, + .create = op_create, +- .ftruncate = op_ftruncate, +- .fgetattr = op_fgetattr, +- .utimens = op_utimens, +-#if FUSE_VERSION >= FUSE_MAKE_VERSION(2, 9) +-# if defined(UTIME_NOW) || defined(UTIME_OMIT) +- .flag_utime_omit_ok = 1, +-# endif +-#endif + .bmap = op_bmap, + #ifdef SUPERFLUOUS + .lock = op_lock, +@@ -3616,10 +3608,8 @@ static struct fuse_operations fs_ops = { + #endif + #if FUSE_VERSION >= FUSE_MAKE_VERSION(2, 8) + .ioctl = op_ioctl, +- .flag_nullpath_ok = 1, + #endif + #if FUSE_VERSION >= FUSE_MAKE_VERSION(2, 9) +- .flag_nopath = 1, + # ifdef SUPPORT_FALLOCATE + .fallocate = op_fallocate, + # endif +-- +2.19.1.6.gb485710b + diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 0ad8ec9..a525fe7 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 Name: e2fsprogs Version: 1.46.5 Release: %{anolis_release}%{?dist} @@ -7,6 +7,8 @@ License: GPLv2 URL: http://e2fsprogs.sourceforge.net/ Source0: https://www.kernel.org/pub/linux/kernel/people/tytso/%{name}/v%{version}/%{name}-%{version}.tar.xz +Patch1: 0001-change-to-use-fuse3.patch + BuildRequires: pkgconfig, texinfo, libselinux-devel, gcc BuildRequires: fuse-devel BuildRequires: libsepol-devel @@ -16,6 +18,7 @@ BuildRequires: gettext BuildRequires: systemd BuildRequires: make BuildRequires: gnupg2 xz +BuildRequires: autoconf Requires: e2fsprogs-libs%{?_isa} = %{version}-%{release} Requires: libcom_err%{?_isa} = %{version}-%{release} @@ -150,13 +153,17 @@ managed device with some free space available in respective volume group. %prep -%setup -q +%autosetup -p1 + +rm -f configure +autoconf rm -rf tests/m_rootdir_acl %global _udevdir %{_prefix}/lib/udev/rules.d %build +%global optflags %{optflags} -I%{_includedir}/fuse3 %configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ --enable-elf-shlibs --enable-nls --disable-uuidd --disable-fsck \ --disable-e2initrd-helper --disable-libblkid --disable-libuuid \ @@ -313,6 +320,9 @@ make PRINT_FAILED=yes fullcheck %{_udevdir}/96-e2scrub.rules %changelog +* Tue Mar 22 2022 Chunmei Xu - 1.46.5-2 +- change to fuse3 + * Tue Mar 08 2022 pangqing - 1.46.5-1 - Init for anolisOS 23 -- Gitee