off_t is 32-bit on 32-bit archs when compiled without _FILE_OFFSET_BITS=64.
Avoid any such ambiguity in the library interface.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
* buffer. If len == -1, we'll call malloc() and set *buf.
* Returns 0 on success, error code otherwise. Returns ENAMETOOLONG if the
* buffer is too short. */
-int rados_conf_get(rados_t cluster, const char *option, char *buf, int len);
+int rados_conf_get(rados_t cluster, const char *option, char *buf, size_t len);
/* pools */
* as much as we can.
* Returns the length of the buffer we would need to list all pools.
*/
-int rados_pool_list(rados_t cluster, char *buf, int len);
+int rados_pool_list(rados_t cluster, char *buf, size_t len);
int rados_ioctx_create(rados_t cluster, const char *pool_name, rados_ioctx_t *ioctx);
void rados_ioctx_destroy(rados_ioctx_t io);
/* sync io */
uint64_t rados_get_last_version(rados_ioctx_t io);
-int rados_write(rados_ioctx_t io, const char *oid, const char *buf, size_t len, off_t off);
-int rados_write_full(rados_ioctx_t io, const char *oid, const char *buf, size_t len, off_t off);
-int rados_read(rados_ioctx_t io, const char *oid, char *buf, size_t len, off_t off);
+int rados_write(rados_ioctx_t io, const char *oid, const char *buf, size_t len, uint64_t off);
+int rados_write_full(rados_ioctx_t io, const char *oid, const char *buf, size_t len, uint64_t off);
+int rados_read(rados_ioctx_t io, const char *oid, char *buf, size_t len, uint64_t off);
int rados_remove(rados_ioctx_t io, const char *oid);
int rados_trunc(rados_ioctx_t io, const char *oid, size_t size);
void rados_aio_release(rados_completion_t c);
int rados_aio_write(rados_ioctx_t io, const char *oid,
rados_completion_t completion,
- const char *buf, size_t len, off_t off);
+ const char *buf, size_t len, uint64_t off);
int rados_aio_write_full(rados_ioctx_t io, const char *oid,
rados_completion_t completion,
const char *buf, size_t len);
int rados_aio_read(rados_ioctx_t io, const char *oid,
rados_completion_t completion,
- char *buf, size_t len, off_t off);
+ char *buf, size_t len, uint64_t off);
/* watch/notify */
typedef void (*rados_watchcb_t)(uint8_t opcode, uint64_t ver, void *arg);
// create an object
int create(const std::string& oid, bool exclusive);
- int write(const std::string& oid, bufferlist& bl, size_t len, off_t off);
+ int write(const std::string& oid, bufferlist& bl, size_t len, uint64_t off);
int write_full(const std::string& oid, bufferlist& bl);
- int read(const std::string& oid, bufferlist& bl, size_t len, off_t off);
+ int read(const std::string& oid, bufferlist& bl, size_t len, uint64_t off);
int remove(const std::string& oid);
int trunc(const std::string& oid, size_t size);
- int mapext(const std::string& o, off_t off, size_t len, std::map<off_t, size_t>& m);
- int sparse_read(const std::string& o, std::map<off_t, size_t>& m, bufferlist& bl, size_t len, off_t off);
+ int mapext(const std::string& o, uint64_t off, size_t len, std::map<uint64_t, size_t>& m);
+ int sparse_read(const std::string& o, std::map<uint64_t, size_t>& m, bufferlist& bl, size_t len, uint64_t off);
int getxattr(const std::string& oid, const char *name, bufferlist& bl);
int getxattrs(const std::string& oid, std::map<std::string, bufferlist>& attrset);
int setxattr(const std::string& oid, const char *name, bufferlist& bl);
uint64_t get_last_version();
int aio_read(const std::string& oid, AioCompletion *c,
- bufferlist *pbl, size_t len, off_t off);
+ bufferlist *pbl, size_t len, uint64_t off);
int aio_sparse_read(const std::string& oid, AioCompletion *c,
- std::map<off_t,size_t> *m, bufferlist *data_bl,
- size_t len, off_t off);
+ std::map<uint64_t,size_t> *m, bufferlist *data_bl,
+ size_t len, uint64_t off);
int aio_write(const std::string& oid, AioCompletion *c, const bufferlist& bl,
- size_t len, off_t off);
+ size_t len, uint64_t off);
int aio_write_full(const std::string& oid, AioCompletion *c, const bufferlist& bl);
// watch/notify
/* I/O */
typedef void *rbd_completion_t;
typedef void (*rbd_callback_t)(rbd_completion_t cb, void *arg);
-int rbd_read(rbd_image_t image, off_t ofs, size_t len, char *buf);
-int rbd_read_iterate(rbd_image_t image, off_t ofs, size_t len,
- int (*cb)(off_t, size_t, const char *, void *), void *arg);
-int rbd_write(rbd_image_t image, off_t ofs, size_t len, const char *buf);
-int rbd_aio_write(rbd_image_t image, off_t off, size_t len, const char *buf, rbd_completion_t c);
-int rbd_aio_read(rbd_image_t image, off_t off, size_t len, char *buf, rbd_completion_t c);
+int rbd_read(rbd_image_t image, uint64_t ofs, size_t len, char *buf);
+int rbd_read_iterate(rbd_image_t image, uint64_t ofs, size_t len,
+ int (*cb)(uint64_t, size_t, const char *, void *), void *arg);
+int rbd_write(rbd_image_t image, uint64_t ofs, size_t len, const char *buf);
+int rbd_aio_write(rbd_image_t image, uint64_t off, size_t len, const char *buf, rbd_completion_t c);
+int rbd_aio_read(rbd_image_t image, uint64_t off, size_t len, char *buf, rbd_completion_t c);
int rbd_aio_create_completion(void *cb_arg, rbd_callback_t complete_cb, rbd_completion_t *c);
int rbd_aio_wait_for_complete(rbd_completion_t c);
int rbd_aio_get_return_value(rbd_completion_t c);
int snap_set(const char *snap_name);
/* I/O */
- int read(off_t ofs, size_t len, ceph::bufferlist& bl);
- int read_iterate(off_t ofs, size_t len,
- int (*cb)(off_t, size_t, const char *, void *), void *arg);
- int write(off_t ofs, size_t len, ceph::bufferlist& bl);
+ int read(uint64_t ofs, size_t len, ceph::bufferlist& bl);
+ int read_iterate(uint64_t ofs, size_t len,
+ int (*cb)(uint64_t, size_t, const char *, void *), void *arg);
+ int write(uint64_t ofs, size_t len, ceph::bufferlist& bl);
- int aio_write(off_t off, size_t len, ceph::bufferlist& bl, RBD::AioCompletion *c);
- int aio_read(off_t off, size_t len, ceph::bufferlist& bl, RBD::AioCompletion *c);
+ int aio_write(uint64_t off, size_t len, ceph::bufferlist& bl, RBD::AioCompletion *c);
+ int aio_read(uint64_t off, size_t len, ceph::bufferlist& bl, RBD::AioCompletion *c);
private:
friend class RBD;
// io
int create(IoCtxImpl& io, const object_t& oid, bool exclusive);
- int write(IoCtxImpl& io, const object_t& oid, bufferlist& bl, size_t len, off_t off);
+ int write(IoCtxImpl& io, const object_t& oid, bufferlist& bl, size_t len, uint64_t off);
int write_full(IoCtxImpl& io, const object_t& oid, bufferlist& bl);
- int read(IoCtxImpl& io, const object_t& oid, bufferlist& bl, size_t len, off_t off);
- int mapext(IoCtxImpl& io, const object_t& oid, off_t off, size_t len, std::map<off_t,size_t>& m);
- int sparse_read(IoCtxImpl& io, const object_t& oid, std::map<off_t,size_t>& m, bufferlist& bl,
- size_t len, off_t off);
+ int read(IoCtxImpl& io, const object_t& oid, bufferlist& bl, size_t len, uint64_t off);
+ int mapext(IoCtxImpl& io, const object_t& oid, uint64_t off, size_t len, std::map<uint64_t,size_t>& m);
+ int sparse_read(IoCtxImpl& io, const object_t& oid, std::map<uint64_t,size_t>& m, bufferlist& bl,
+ size_t len, uint64_t off);
int remove(IoCtxImpl& io, const object_t& oid);
int stat(IoCtxImpl& io, const object_t& oid, uint64_t *psize, time_t *pmtime);
int trunc(IoCtxImpl& io, const object_t& oid, size_t size);
struct C_aio_sparse_read_Ack : public Context {
AioCompletionImpl *c;
bufferlist *data_bl;
- std::map<off_t,size_t> *m;
+ std::map<uint64_t,size_t> *m;
void finish(int r) {
c->lock.Lock();
};
int aio_read(IoCtxImpl& io, const object_t oid, AioCompletionImpl *c,
- bufferlist *pbl, size_t len, off_t off);
+ bufferlist *pbl, size_t len, uint64_t off);
int aio_read(IoCtxImpl& io, object_t oid, AioCompletionImpl *c,
- char *buf, size_t len, off_t off);
+ char *buf, size_t len, uint64_t off);
int aio_sparse_read(IoCtxImpl& io, const object_t oid,
- AioCompletionImpl *c, std::map<off_t,size_t> *m,
- bufferlist *data_bl, size_t len, off_t off);
+ AioCompletionImpl *c, std::map<uint64_t,size_t> *m,
+ bufferlist *data_bl, size_t len, uint64_t off);
int aio_write(IoCtxImpl& io, const object_t &oid, AioCompletionImpl *c,
- const bufferlist& bl, size_t len, off_t off);
+ const bufferlist& bl, size_t len, uint64_t off);
int aio_write_full(IoCtxImpl& io, const object_t &oid, AioCompletionImpl *c,
const bufferlist& bl);
}
int librados::RadosClient::
-write(IoCtxImpl& io, const object_t& oid, bufferlist& bl, size_t len, off_t off)
+write(IoCtxImpl& io, const object_t& oid, bufferlist& bl, size_t len, uint64_t off)
{
utime_t ut = g_clock.now();
int librados::RadosClient::
aio_read(IoCtxImpl& io, const object_t oid, AioCompletionImpl *c,
- bufferlist *pbl, size_t len, off_t off)
+ bufferlist *pbl, size_t len, uint64_t off)
{
Context *onack = new C_aio_Ack(c);
int librados::RadosClient::
aio_read(IoCtxImpl& io, const object_t oid, AioCompletionImpl *c,
- char *buf, size_t len, off_t off)
+ char *buf, size_t len, uint64_t off)
{
Context *onack = new C_aio_Ack(c);
int librados::RadosClient::
aio_sparse_read(IoCtxImpl& io, const object_t oid,
- AioCompletionImpl *c, std::map<off_t,size_t> *m,
- bufferlist *data_bl, size_t len, off_t off)
+ AioCompletionImpl *c, std::map<uint64_t,size_t> *m,
+ bufferlist *data_bl, size_t len, uint64_t off)
{
C_aio_sparse_read_Ack *onack = new C_aio_sparse_read_Ack(c);
int librados::RadosClient::
aio_write(IoCtxImpl& io, const object_t &oid, AioCompletionImpl *c,
- const bufferlist& bl, size_t len, off_t off)
+ const bufferlist& bl, size_t len, uint64_t off)
{
utime_t ut = g_clock.now();
int librados::
RadosClient::read(IoCtxImpl& io, const object_t& oid,
- bufferlist& bl, size_t len, off_t off)
+ bufferlist& bl, size_t len, uint64_t off)
{
Mutex mylock("RadosClient::read::mylock");
Cond cond;
}
int librados::RadosClient::
-mapext(IoCtxImpl& io, const object_t& oid, off_t off, size_t len, std::map<off_t,size_t>& m)
+mapext(IoCtxImpl& io, const object_t& oid, uint64_t off, size_t len, std::map<uint64_t,size_t>& m)
{
bufferlist bl;
int librados::RadosClient::
sparse_read(IoCtxImpl& io, const object_t& oid,
- std::map<off_t,size_t>& m, bufferlist& data_bl, size_t len, off_t off)
+ std::map<uint64_t,size_t>& m, bufferlist& data_bl, size_t len, uint64_t off)
{
bufferlist bl;
}
int librados::IoCtx::
-write(const std::string& oid, bufferlist& bl, size_t len, off_t off)
+write(const std::string& oid, bufferlist& bl, size_t len, uint64_t off)
{
object_t obj(oid);
return io_ctx_impl->client->write(*io_ctx_impl, obj, bl, len, off);
}
int librados::IoCtx::
-read(const std::string& oid, bufferlist& bl, size_t len, off_t off)
+read(const std::string& oid, bufferlist& bl, size_t len, uint64_t off)
{
object_t obj(oid);
return io_ctx_impl->client->read(*io_ctx_impl, obj, bl, len, off);
}
int librados::IoCtx::
-mapext(const std::string& oid, off_t off, size_t len, std::map<off_t, size_t>& m)
+mapext(const std::string& oid, uint64_t off, size_t len, std::map<uint64_t, size_t>& m)
{
object_t obj(oid);
return io_ctx_impl->client->mapext(*io_ctx_impl, oid, off, len, m);
}
int librados::IoCtx::
-sparse_read(const std::string& oid, std::map<off_t, size_t>& m,
- bufferlist& bl, size_t len, off_t off)
+sparse_read(const std::string& oid, std::map<uint64_t, size_t>& m,
+ bufferlist& bl, size_t len, uint64_t off)
{
object_t obj(oid);
return io_ctx_impl->client->sparse_read(*io_ctx_impl, oid, m, bl, len, off);
int librados::IoCtx::
aio_read(const std::string& oid, librados::AioCompletion *c,
- bufferlist *pbl, size_t len, off_t off)
+ bufferlist *pbl, size_t len, uint64_t off)
{
return io_ctx_impl->client->aio_read(*io_ctx_impl, oid, c->pc, pbl, len, off);
}
int librados::IoCtx::
aio_sparse_read(const std::string& oid, librados::AioCompletion *c,
- std::map<off_t,size_t> *m, bufferlist *data_bl,
- size_t len, off_t off)
+ std::map<uint64_t,size_t> *m, bufferlist *data_bl,
+ size_t len, uint64_t off)
{
return io_ctx_impl->client->aio_sparse_read(*io_ctx_impl, oid, c->pc,
m, data_bl, len, off);
int librados::IoCtx::
aio_write(const std::string& oid, librados::AioCompletion *c, const bufferlist& bl,
- size_t len, off_t off)
+ size_t len, uint64_t off)
{
return io_ctx_impl->client->aio_write(*io_ctx_impl, oid, c->pc, bl, len, off );
}
sighup_handler(SIGHUP);
}
-extern "C" int rados_conf_get(rados_t cluster, const char *option, char *buf, int len)
+extern "C" int rados_conf_get(rados_t cluster, const char *option, char *buf, size_t len)
{
char *tmp = buf;
- if (len <= 0)
- return -EINVAL;
return g_conf.get_val(option, &tmp, len);
}
return radosp->lookup_pool(name);
}
-extern "C" int rados_pool_list(rados_t cluster, char *buf, int len)
+extern "C" int rados_pool_list(rados_t cluster, char *buf, size_t len)
{
librados::RadosClient *client = (librados::RadosClient *)cluster;
std::list<std::string> pools;
return ctx->set_snap_write_context((snapid_t)seq, snv);
}
-extern "C" int rados_write(rados_ioctx_t io, const char *o, const char *buf, size_t len, off_t off)
+extern "C" int rados_write(rados_ioctx_t io, const char *o, const char *buf, size_t len, uint64_t off)
{
librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
object_t oid(o);
return ctx->client->remove(*ctx, oid);
}
-extern "C" int rados_read(rados_ioctx_t io, const char *o, char *buf, size_t len, off_t off)
+extern "C" int rados_read(rados_ioctx_t io, const char *o, char *buf, size_t len, uint64_t off)
{
librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
int ret;
extern "C" int rados_aio_read(rados_ioctx_t io, const char *o,
rados_completion_t completion,
- char *buf, size_t len, off_t off)
+ char *buf, size_t len, uint64_t off)
{
librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
object_t oid(o);
extern "C" int rados_aio_write(rados_ioctx_t io, const char *o,
rados_completion_t completion,
- const char *buf, size_t len, off_t off)
+ const char *buf, size_t len, uint64_t off)
{
librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
object_t oid(o);
off_t ofs;
size_t len;
char *buf;
- map<off_t, size_t> m;
+ map<uint64_t, size_t> m;
bufferlist data_bl;
AioBlockCompletion(AioCompletion *aio_completion, off_t _ofs, size_t _len, char *_buf) :
bufferlist bl;
string oid = get_block_oid(&header, i);
string dest_oid = get_block_oid(&dest_header, i);
- map<off_t, size_t> m;
- map<off_t, size_t>::iterator iter;
+ map<uint64_t, size_t> m;
+ map<uint64_t, size_t>::iterator iter;
r = src_data_ctx.sparse_read(oid, m, bl, block_size, 0);
if (r < 0 && r == -ENOENT)
r = 0;
for (iter = m.begin(); iter != m.end(); ++iter) {
- off_t extent_ofs = iter->first;
+ uint64_t extent_ofs = iter->first;
size_t extent_len = iter->second;
bufferlist wrbl;
if (extent_ofs + extent_len > bl.length()) {
ictx = NULL;
}
-int read_iterate(ImageCtx *ictx, off_t off, size_t len,
- int (*cb)(off_t, size_t, const char *, void *),
+int read_iterate(ImageCtx *ictx, uint64_t off, size_t len,
+ int (*cb)(uint64_t, size_t, const char *, void *),
void *arg)
{
int r = ictx_check(ictx);
uint64_t block_ofs = get_block_ofs(&ictx->header, off + total_read);
uint64_t read_len = min(block_size - block_ofs, left);
- map<off_t, size_t> m;
- map<off_t, size_t>::iterator iter;
- off_t bl_ofs = 0, buf_bl_pos = 0;
+ map<uint64_t, size_t> m;
+ map<uint64_t, size_t>::iterator iter;
+ uint64_t bl_ofs = 0, buf_bl_pos = 0;
r = ictx->data_ctx.sparse_read(oid, m, bl, read_len, block_ofs);
if (r < 0 && r == -ENOENT)
r = 0;
goto done;
}
for (iter = m.begin(); iter != m.end(); ++iter) {
- off_t extent_ofs = iter->first;
+ uint64_t extent_ofs = iter->first;
size_t extent_len = iter->second;
/* a hole? */
if (extent_ofs - block_ofs) {
return ret;
}
-static int simple_read_cb(off_t ofs, size_t len, const char *buf, void *arg)
+static int simple_read_cb(uint64_t ofs, size_t len, const char *buf, void *arg)
{
char *dest_buf = (char *)arg;
if (buf)
}
-int read(ImageCtx *ictx, off_t ofs, size_t len, char *buf)
+int read(ImageCtx *ictx, uint64_t ofs, size_t len, char *buf)
{
return read_iterate(ictx, ofs, len, simple_read_cb, buf);
}
-int write(ImageCtx *ictx, off_t off, size_t len, const char *buf)
+int write(ImageCtx *ictx, uint64_t off, size_t len, const char *buf)
{
if (!len)
return 0;
{
dout(10) << "AioBlockCompletion::complete()" << dendl;
if ((r >= 0 || r == -ENOENT) && buf) { // this was a sparse_read operation
- map<off_t, size_t>::iterator iter;
- off_t bl_ofs = 0, buf_bl_pos = 0;
+ map<uint64_t, size_t>::iterator iter;
+ uint64_t bl_ofs = 0, buf_bl_pos = 0;
dout(10) << "ofs=" << ofs << " len=" << len << dendl;
for (iter = m.begin(); iter != m.end(); ++iter) {
- off_t extent_ofs = iter->first;
+ uint64_t extent_ofs = iter->first;
size_t extent_len = iter->second;
dout(10) << "extent_ofs=" << extent_ofs << " extent_len=" << extent_len << dendl;
block_completion->complete(rados_aio_get_return_value(c));
}
-int aio_write(ImageCtx *ictx, off_t off, size_t len, const char *buf,
+int aio_write(ImageCtx *ictx, uint64_t off, size_t len, const char *buf,
AioCompletion *c)
{
if (!len)
block_completion->complete(rados_aio_get_return_value(c));
}
-int aio_read(ImageCtx *ictx, off_t off, size_t len,
+int aio_read(ImageCtx *ictx, uint64_t off, size_t len,
char *buf,
AioCompletion *c)
{
uint64_t block_ofs = get_block_ofs(&ictx->header, off + total_read);
uint64_t read_len = min(block_size - block_ofs, left);
- map<off_t, size_t> m;
- map<off_t, size_t>::iterator iter;
+ map<uint64_t, size_t> m;
+ map<uint64_t, size_t>::iterator iter;
AioBlockCompletion *block_completion = new AioBlockCompletion(c, block_ofs, read_len, buf + total_read);
c->add_block_completion(block_completion);
return librbd::snap_set(ictx, snap_name);
}
-int Image::read(off_t ofs, size_t len, bufferlist& bl)
+int Image::read(uint64_t ofs, size_t len, bufferlist& bl)
{
ImageCtx *ictx = (ImageCtx *)ctx;
bufferptr ptr(len);
return librbd::read(ictx, ofs, len, bl.c_str());
}
-int Image::read_iterate(off_t ofs, size_t len,
- int (*cb)(off_t, size_t, const char *, void *), void *arg)
+int Image::read_iterate(uint64_t ofs, size_t len,
+ int (*cb)(uint64_t, size_t, const char *, void *), void *arg)
{
ImageCtx *ictx = (ImageCtx *)ctx;
return librbd::read_iterate(ictx, ofs, len, cb, arg);
}
-int Image::write(off_t ofs, size_t len, bufferlist& bl)
+int Image::write(uint64_t ofs, size_t len, bufferlist& bl)
{
ImageCtx *ictx = (ImageCtx *)ctx;
if (bl.length() < len)
return librbd::write(ictx, ofs, len, bl.c_str());
}
-int Image::aio_write(off_t off, size_t len, bufferlist& bl, RBD::AioCompletion *c)
+int Image::aio_write(uint64_t off, size_t len, bufferlist& bl, RBD::AioCompletion *c)
{
ImageCtx *ictx = (ImageCtx *)ctx;
if (bl.length() < len)
return librbd::aio_write(ictx, off, len, bl.c_str(), (librbd::AioCompletion *)c->pc);
}
-int Image::aio_read(off_t off, size_t len, bufferlist& bl, RBD::AioCompletion *c)
+int Image::aio_read(uint64_t off, size_t len, bufferlist& bl, RBD::AioCompletion *c)
{
ImageCtx *ictx = (ImageCtx *)ctx;
bufferptr ptr(len);
}
/* I/O */
-extern "C" int rbd_read(rbd_image_t image, off_t ofs, size_t len, char *buf)
+extern "C" int rbd_read(rbd_image_t image, uint64_t ofs, size_t len, char *buf)
{
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
return librbd::read(ictx, ofs, len, buf);
}
-extern "C" int rbd_read_iterate(rbd_image_t image, off_t ofs, size_t len,
- int (*cb)(off_t, size_t, const char *, void *), void *arg)
+extern "C" int rbd_read_iterate(rbd_image_t image, uint64_t ofs, size_t len,
+ int (*cb)(uint64_t, size_t, const char *, void *), void *arg)
{
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
return librbd::read_iterate(ictx, ofs, len, cb, arg);
}
-extern "C" int rbd_write(rbd_image_t image, off_t ofs, size_t len, const char *buf)
+extern "C" int rbd_write(rbd_image_t image, uint64_t ofs, size_t len, const char *buf)
{
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
return librbd::write(ictx, ofs, len, buf);
return 0;
}
-extern "C" int rbd_aio_write(rbd_image_t image, off_t off, size_t len, const char *buf, rbd_completion_t c)
+extern "C" int rbd_aio_write(rbd_image_t image, uint64_t off, size_t len, const char *buf, rbd_completion_t c)
{
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
librbd::RBD::AioCompletion *comp = (librbd::RBD::AioCompletion *)c;
return librbd::aio_write(ictx, off, len, buf, (librbd::AioCompletion *)comp->pc);
}
-extern "C" int rbd_aio_read(rbd_image_t image, off_t off, size_t len, char *buf, rbd_completion_t c)
+extern "C" int rbd_aio_read(rbd_image_t image, uint64_t off, size_t len, char *buf, rbd_completion_t c)
{
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
librbd::RBD::AioCompletion *comp = (librbd::RBD::AioCompletion *)c;
if (!pool_name || nargs.size() < 2)
usage();
string oid(nargs[1]);
- std::map<off_t, size_t> m;
+ std::map<uint64_t, size_t> m;
ret = io_ctx.mapext(oid, 0, -1, m);
if (ret < 0) {
cerr << "mapext error on " << pool_name << "/" << oid << ": " << strerror_r(-ret, buf, sizeof(buf)) << std::endl;
return 1;
}
- std::map<off_t, size_t>::iterator iter;
+ std::map<uint64_t, size_t>::iterator iter;
for (iter = m.begin(); iter != m.end(); ++iter) {
cout << hex << iter->first << "\t" << iter->second << dec << std::endl;
}
return 0;
}
-static int export_read_cb(off_t ofs, size_t len, const char *buf, void *arg)
+static int export_read_cb(uint64_t ofs, size_t len, const char *buf, void *arg)
{
int ret;
int fd = *(int *)arg;