CernVM-FS  2.12.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  struct fuse_chan *, fuse_ino_t, const char *, size_t) // NOLINT
34  {
35  fuse_lowlevel_notify_inval_entry_cnt++;
36  return -1;
37  }
38  }
39  #define CVMFS_USE_LIBFUSE 2
40 #else // CVMFS_LIBCVMFS
41  #ifndef CVMFS_USE_LIBFUSE
42  #error "Build system error: CVMFS_USE_LIBFUSE unset"
43  #endif
44 
45  #if CVMFS_USE_LIBFUSE == 2
46  #define FUSE_USE_VERSION 26
47  #include <fuse/fuse_lowlevel.h>
48  #include <fuse/fuse_opt.h>
49  #if(FUSE_VERSION < 28)
50  #include <cstdlib>
51  extern "C" {
52  static int __attribute__((used)) fuse_lowlevel_notify_inval_entry(
53  void *, unsigned long, const char *, size_t) // NOLINT
54  {
55  abort();
56  }
57  static int __attribute__((used)) fuse_lowlevel_notify_inval_inode(
58  void *, fuse_ino_t, off_t, off_t) // NOLINT
59  {
60  abort();
61  }
62  }
63  #endif // FUSE_VERSION < 28
64  #else
65  // CVMFS_USE_LIBFUSE == 3
66 #ifdef CVMFS_ENABLE_FUSE3_LOOP_CONFIG
67  #define FUSE_USE_VERSION 312
68 #else
69  #define FUSE_USE_VERSION 31
70 #endif
71  #include <fuse3/fuse.h>
72  #include <fuse3/fuse_lowlevel.h>
73  #include <fuse3/fuse_opt.h>
74  #endif
75 #endif
76 
77 #endif // CVMFS_DUPLEX_FUSE_H_
struct cvmcache_object_info __attribute__
Definition: atomic.h:24