CernVM-FS  2.13.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 {
17  int dummy;
18 };
19 struct fuse_lowlevel_ops {
20  int dummy;
21 }; // for loader.h
22 enum fuse_expire_flags {
23  FUSE_LL_EXPIRE_ONLY = (1 << 0),
24 };
25 
26 
27 // Defined in t_fuse_evict.cc
28 extern unsigned fuse_lowlevel_notify_inval_inode_cnt;
29 extern unsigned fuse_lowlevel_notify_inval_entry_cnt;
30 static int __attribute__((used)) fuse_lowlevel_notify_inval_inode(
31  void *, unsigned /*fuse_ino_t*/, off_t, off_t) // NOLINT (ulong from fuse)
32 {
33  fuse_lowlevel_notify_inval_inode_cnt++;
34  return -1;
35 }
36 static int __attribute__((used)) fuse_lowlevel_notify_inval_entry(
37  struct fuse_chan *, fuse_ino_t, const char *, size_t) // NOLINT
38 {
39  fuse_lowlevel_notify_inval_entry_cnt++;
40  return -1;
41 }
42 }
43 #define CVMFS_USE_LIBFUSE 2
44 #else // CVMFS_LIBCVMFS
45 #ifndef CVMFS_USE_LIBFUSE
46 #error "Build system error: CVMFS_USE_LIBFUSE unset"
47 #endif
48 
49 #if CVMFS_USE_LIBFUSE == 2
50 #define FUSE_USE_VERSION 26
51 #include <fuse/fuse_lowlevel.h>
52 #include <fuse/fuse_opt.h>
53 #if (FUSE_VERSION < 28)
54 #include <cstdlib>
55 extern "C" {
56 static int __attribute__((used)) fuse_lowlevel_notify_inval_entry(
57  void *, unsigned long, const char *, size_t) // NOLINT
58 {
59  abort();
60 }
61 static int __attribute__((used)) fuse_lowlevel_notify_inval_inode(
62  void *, fuse_ino_t, off_t, off_t) // NOLINT
63 {
64  abort();
65 }
66 }
67 #endif // FUSE_VERSION < 28
68 #else
69 // CVMFS_USE_LIBFUSE == 3
70 #ifdef CVMFS_ENABLE_FUSE3_LOOP_CONFIG
71 #define FUSE_USE_VERSION 312
72 #else
73 #define FUSE_USE_VERSION 31
74 #endif
75 #include <fuse3/fuse.h>
76 #include <fuse3/fuse_lowlevel.h>
77 #include <fuse3/fuse_opt.h>
78 #endif
79 #endif
80 
81 #endif // CVMFS_DUPLEX_FUSE_H_
struct cvmcache_object_info __attribute__
Definition: atomic.h:24