support RHEL6. closes #29

This commit is contained in:
Antonio SJ Musumeci 2014-11-04 13:42:20 -05:00
parent 9245a2295e
commit f2798aab5a
8 changed files with 75 additions and 27 deletions

View file

@ -22,6 +22,8 @@
THE SOFTWARE.
*/
#if FALLOCATE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
@ -82,3 +84,5 @@ namespace mergerfs
}
}
}
#endif

View file

@ -33,7 +33,9 @@ namespace mergerfs
void *
init(struct fuse_conn_info *conn)
{
#ifdef FUSE_CAP_IOCTL_DIR
conn->want |= FUSE_CAP_IOCTL_DIR;
#endif
return &config::get_writable();
}

View file

@ -80,6 +80,7 @@ _ioctl(const int fd,
return ((rv == -1) ? -errno : rv);
}
#ifdef FUSE_IOCTL_DIR
static
int
_ioctl_dir_base(const fs::SearchFunc searchFunc,
@ -130,6 +131,7 @@ _ioctl_dir(const string fusepath,
flags,
data);
}
#endif
namespace mergerfs
{
@ -145,12 +147,14 @@ namespace mergerfs
{
const FileInfo *fileinfo = (FileInfo*)ffi->fh;
#ifdef FUSE_IOCTL_DIR
if(flags & FUSE_IOCTL_DIR)
return _ioctl_dir(fusepath,
cmd,
arg,
flags,
data);
#endif
return _ioctl(fileinfo->fd,
cmd,

View file

@ -76,9 +76,11 @@ static
struct fuse_operations
get_fuse_operations()
{
struct fuse_operations ops = {};
struct fuse_operations ops = {0};
#if FLAG_NOPATH
ops.flag_nopath = false;
#endif
ops.flag_nullpath_ok = false;
ops.access = mergerfs::access::access;
@ -87,9 +89,13 @@ get_fuse_operations()
ops.chown = mergerfs::chown::chown;
ops.create = mergerfs::create::create;
ops.destroy = mergerfs::destroy::destroy;
#if FALLOCATE
ops.fallocate = mergerfs::fallocate::fallocate;
#endif
ops.fgetattr = mergerfs::fgetattr::fgetattr;
#if FLOCK
ops.flock = NULL;
#endif
ops.flush = mergerfs::flush::flush;
ops.fsync = mergerfs::fsync::fsync;
ops.fsyncdir = NULL;
@ -108,7 +114,9 @@ get_fuse_operations()
ops.opendir = mergerfs::opendir::opendir;
ops.poll = NULL;
ops.read = mergerfs::read::read;
#if READ_BUF
ops.read_buf = mergerfs::read_buf::read_buf;
#endif
ops.readdir = mergerfs::readdir::readdir;
ops.readlink = mergerfs::readlink::readlink;
ops.release = mergerfs::release::release;
@ -124,7 +132,9 @@ get_fuse_operations()
ops.utime = NULL; /* deprecated; use utimens() */
ops.utimens = mergerfs::utimens::utimens;
ops.write = mergerfs::write::write;
#if WRITE_BUF
ops.write_buf = mergerfs::write_buf::write_buf;
#endif
return ops;
}

View file

@ -22,6 +22,8 @@
THE SOFTWARE.
*/
#if READ_BUF
#include <fuse.h>
#include <stdlib.h>
@ -72,3 +74,5 @@ namespace mergerfs
}
}
}
#endif

View file

@ -22,6 +22,8 @@
THE SOFTWARE.
*/
#if WRITE_BUF
#include <fuse.h>
#include <stdlib.h>
@ -63,3 +65,5 @@ namespace mergerfs
}
}
}
#endif