CernVM-FS  2.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
duplex_fuse.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_DUPLEX_FUSE_H_
6 #define CVMFS_DUPLEX_FUSE_H_
7 
8 #ifdef CVMFS_LIBCVMFS
9  // Unit tests
10  #include <sys/types.h>
11  #define FUSE_VERSION 29
12  #define FUSE_ROOT_ID 1
13  extern "C" {
14  typedef unsigned long fuse_ino_t; // NOLINT
15  // Empty structs have different sizes in C and C++, hence the dummy int
16  struct fuse_chan { int dummy; };
17  struct fuse_lowlevel_ops { int dummy; }; // for loader.h
18  enum fuse_expire_flags {
19  FUSE_LL_EXPIRE_ONLY = (1 << 0),
20  };
21 
22 
23  // Defined in t_fuse_evict.cc
24  extern unsigned fuse_lowlevel_notify_inval_inode_cnt;
25  extern unsigned fuse_lowlevel_notify_inval_entry_cnt;
26  static int __attribute__((used)) fuse_lowlevel_notify_inval_inode(
27  void *, unsigned /*fuse_ino_t*/, off_t, off_t) // NOLINT (ulong from fuse)
28  {
29  fuse_lowlevel_notify_inval_inode_cnt++;
30  return -1;
31  }
32  static int __attribute__((used)) fuse_lowlevel_notify_inval_entry(
33  void *, unsigned /*fuse_ino_t*/, const char *, size_t) // NOLINT
34  {
35  fuse_lowlevel_notify_inval_entry_cnt++;
36  return -1;
37  }
38  static int __attribute__((used)) fuse_lowlevel_notify_expire_entry(
39  void *, unsigned /*fuse_ino_t*/, const char *, size_t, enum fuse_expire_flags) // NOLINT
40  {
41  fuse_lowlevel_notify_inval_entry_cnt++;
42  return -1;
43  }
44  }
45 #else // CVMFS_LIBCVMFS
46  #ifndef CVMFS_USE_LIBFUSE
47  #error "Build system error: CVMFS_USE_LIBFUSE unset"
48  #endif
49 
50  #if CVMFS_USE_LIBFUSE == 2
51  #define FUSE_USE_VERSION 26
52  #include <fuse/fuse_lowlevel.h>
53  #include <fuse/fuse_opt.h>
54  #if(FUSE_VERSION < 28)
55  #include <cstdlib>
56  extern "C" {
57  static int __attribute__((used)) fuse_lowlevel_notify_inval_entry(
58  void *, unsigned long, const char *, size_t) // NOLINT
59  {
60  abort();
61  }
62  static int __attribute__((used)) fuse_lowlevel_notify_inval_inode(
63  void *, fuse_ino_t, off_t, off_t) // NOLINT
64  {
65  abort();
66  }
67  }
68  #endif // FUSE_VERSION < 28
69  #else
70  // CVMFS_USE_LIBFUSE == 3
71  #define FUSE_USE_VERSION 31
72  #include <fuse3/fuse.h>
73  #include <fuse3/fuse_lowlevel.h>
74  #include <fuse3/fuse_opt.h>
75  #endif
76 #endif
77 
78 #endif // CVMFS_DUPLEX_FUSE_H_
struct cvmcache_object_info __attribute__
Definition: atomic.h:24