uint64_t snapid; //should be snapid_t but prefer not to exposure it
};
+struct ceph_ll_io_info {
+ void (*callback) (struct ceph_ll_io_info *cb_info);
+ void *priv; // private for caller
+ struct Fh *fh;
+ const struct iovec *iov;
+ int iovcnt;
+ int64_t off;
+ int64_t result;
+ bool write;
+};
+
/* setattr mask bits (up to an int in size) */
#ifndef CEPH_SETATTR_MODE
#define CEPH_SETATTR_MODE (1 << 0)
const struct iovec *iov, int iovcnt, int64_t off);
int64_t ceph_ll_writev(struct ceph_mount_info *cmount, struct Fh *fh,
const struct iovec *iov, int iovcnt, int64_t off);
+int64_t ceph_ll_nonblocking_readv_writev(struct ceph_mount_info *cmount,
+ struct ceph_ll_io_info *io_info);
int ceph_ll_close(struct ceph_mount_info *cmount, struct Fh* filehandle);
int ceph_ll_iclose(struct ceph_mount_info *cmount, struct Inode *in, int mode);
/**
#include <string.h>
#include <string>
+#include "include/Context.h"
#include "auth/Crypto.h"
#include "client/Client.h"
#include "client/Inode.h"
return (cmount->get_client()->ll_writev(fh, iov, iovcnt, off));
}
+class LL_Onfinish : public Context {
+public:
+ LL_Onfinish(struct ceph_ll_io_info *io_info)
+ : io_info(io_info) {}
+ bufferlist bl;
+private:
+ struct ceph_ll_io_info *io_info;
+ void finish(int r) override {
+ if (!io_info->write && r > 0) {
+ copy_bufferlist_to_iovec(io_info->iov, io_info->iovcnt, &bl, r);
+ }
+ io_info->result = r;
+ io_info->callback(io_info);
+ }
+};
+
+extern "C" int64_t ceph_ll_nonblocking_readv_writev(class ceph_mount_info *cmount,
+ struct ceph_ll_io_info *io_info)
+{
+ LL_Onfinish *onfinish = new LL_Onfinish(io_info);
+
+ return (cmount->get_client()->ll_preadv_pwritev(
+ io_info->fh, io_info->iov, io_info->iovcnt,
+ io_info->off, io_info->write, onfinish, &onfinish->bl));
+}
+
extern "C" int ceph_ll_close(class ceph_mount_info *cmount, Fh* fh)
{
return (cmount->get_client()->ll_release(fh));