#include "common/ceph_argparse.h"
#include "common/ceph_context.h"
+#include "include/ceph_fuse.h"
#include "global/global_init.h"
#include "global/global_context.h"
extern "C" {
-static int rbdfs_getattr(const char *path, struct stat *stbuf)
+static int rbdfs_getattr(const char *path, struct stat *stbuf
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+ , struct fuse_file_info *fi
+#endif
+ )
{
int fd;
time_t now;
{
struct rbdfs_readdir_info *info = (struct rbdfs_readdir_info*) _info;
- info->filler(info->buf, name, NULL, 0);
+ filler_compat(info->filler, info->buf, name, NULL, 0);
}
static int rbdfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
- off_t offset, struct fuse_file_info *fi)
+ off_t offset, struct fuse_file_info *fi
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+ , enum fuse_readdir_flags
+#endif
+ )
{
struct rbdfs_readdir_info info = { buf, filler };
if (strcmp(path, "/") != 0)
return -ENOENT;
- filler(buf, ".", NULL, 0);
- filler(buf, "..", NULL, 0);
+ filler_compat(filler, buf, ".", NULL, 0);
+ filler_compat(filler, buf, "..", NULL, 0);
iter_images(&info, rbdfs_readdir_cb);
return 0;
}
void *
-rbdfs_init(struct fuse_conn_info *conn)
+rbdfs_init(struct fuse_conn_info *conn
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+ , struct fuse_config *cfg
+#endif
+ )
{
int ret;
ret = rados_ioctx_create(cluster, pool_name, &ioctx);
if (ret < 0)
exit(91);
-#if FUSE_VERSION >= FUSE_MAKE_VERSION(2, 8)
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(2, 8) && FUSE_VERSION < FUSE_MAKE_VERSION(3, 0)
conn->want |= FUSE_CAP_BIG_WRITES;
#endif
rados_ioctx_set_namespace(ioctx, nspace_name);
}
int
-rbdfs_rename(const char *path, const char *destname)
+rbdfs_rename(const char *path, const char *destname
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+ , unsigned int flags
+#endif
+ )
{
int r;
}
int
-rbdfs_utime(const char *path, struct utimbuf *utime)
+rbdfs_utimens(const char *path, const struct timespec tv[2]
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+ , struct fuse_file_info *fi
+#endif
+ )
{
// called on create; not relevant
return 0;
int
-rbdfs_truncate(const char *path, off_t size)
+rbdfs_truncate(const char *path, off_t size
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+ , struct fuse_file_info *fi
+#endif
+ )
{
int fd;
int r;
const static struct fuse_operations rbdfs_oper = {
getattr: rbdfs_getattr,
readlink: 0,
+#if FUSE_VERSION < FUSE_MAKE_VERSION(3, 0)
getdir: 0,
+#endif
mknod: 0,
mkdir: 0,
unlink: rbdfs_unlink,
chmod: 0,
chown: 0,
truncate: rbdfs_truncate,
- utime: rbdfs_utime,
+#if FUSE_VERSION < FUSE_MAKE_VERSION(3, 0)
+ utime: 0,
+#endif
open: rbdfs_open,
read: rbdfs_read,
write: rbdfs_write,
destroy: rbdfs_destroy,
access: 0,
create: rbdfs_create,
+#if FUSE_VERSION < FUSE_MAKE_VERSION(3, 0)
+ ftruncate: 0,
+ fgetattr: 0,
+#endif
+ lock: 0,
+ utimens: rbdfs_utimens,
/* skip unimplemented */
};