Skip to content

Commit

Permalink
Merge pull request #126 from DrDaveD/fix-32bit
Browse files Browse the repository at this point in the history
Fix 32 bit compile on Fedora 40
  • Loading branch information
vasi authored Feb 18, 2024
2 parents ceb31cc + cb148fc commit dca5492
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,12 @@ void sqfs_ll_op_getxattr(fuse_req_t req, fuse_ino_t ino,
}

void sqfs_ll_op_forget(fuse_req_t req, fuse_ino_t ino,
unsigned long nlookup) {
#ifdef HAVE_FUSE_LL_FORGET_OP_64T
uint64_t nlookup
#else
unsigned long nlookup
#endif
) {
sqfs_ll_i lli;
update_access_time();
sqfs_ll_iget(req, &lli, SQFS_FUSE_INODE_NONE);
Expand Down
7 changes: 6 additions & 1 deletion ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ void sqfs_ll_op_getxattr(fuse_req_t req, fuse_ino_t ino,
);

void sqfs_ll_op_forget(fuse_req_t req, fuse_ino_t ino,
unsigned long nlookup);
#ifdef HAVE_FUSE_LL_FORGET_OP_64T
uint64_t nlookup
#else
unsigned long nlookup
#endif
);

void sqfs_ll_op_init(void *userdata, struct fuse_conn_info *conn);

Expand Down
19 changes: 19 additions & 0 deletions m4/squashfuse_fuse.m4
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,25 @@ AC_DEFUN([SQ_FUSE_API_VERSION],[
[Define if we have two-argument fuse_unmount])
])
AC_CACHE_CHECK([for 64_t third argument to fuse ll forget op],
[sq_cv_decl_fuse_forget_64_t],[
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([
#include <fuse.h>
#include <fuse_lowlevel.h>],
[
void f(fuse_req_t, fuse_ino_t, uint64_t);
struct fuse_lowlevel_ops flo;
flo.forget = f;
])],
[sq_cv_decl_fuse_forget_64_t=yes],
[sq_cv_decl_fuse_forget_64_t=no])
])
AS_IF([test "x$sq_cv_decl_fuse_forget_64_t" = xyes],[
AC_DEFINE([HAVE_FUSE_LL_FORGET_OP_64T],1,
[Define if we have uint64_t as type of 3rd arg to ll forget op])
])
AC_CHECK_DECLS([fuse_cmdline_help],,,
[#include <fuse_lowlevel.h>])
])
Expand Down

0 comments on commit dca5492

Please sign in to comment.