diff options
author | Sage Weil <sage@newdream.net> | 2011-12-30 07:42:20 -0800 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-12-30 07:42:20 -0800 |
commit | 47d022718719dcb1f5432b5e9253f6c4409fdec3 (patch) | |
tree | 9843975928a4dbf8dba223d196b72c168b96d7a5 /src/librados.cc | |
parent | df84594f205bb37d3b062b5b3b9cfd224e6c57d2 (diff) | |
parent | 97dd28c0cec7d0cb3265a8565f0e073d0b80d0e0 (diff) | |
download | ceph-47d022718719dcb1f5432b5e9253f6c4409fdec3.tar.gz |
Merge remote branch 'gh/wip-cleanup'
Diffstat (limited to 'src/librados.cc')
-rw-r--r-- | src/librados.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/librados.cc b/src/librados.cc index 6e402abd7d9..b937e8f1940 100644 --- a/src/librados.cc +++ b/src/librados.cc @@ -1711,7 +1711,7 @@ int librados::RadosClient::operate(IoCtxImpl& io, const object_t& oid, /* can't write to a snapshot */ if (io.snap_seq != CEPH_NOSNAP) - return -EINVAL; + return -EROFS; if (!o->size()) return 0; @@ -1743,10 +1743,6 @@ int librados::RadosClient::operate(IoCtxImpl& io, const object_t& oid, int librados::RadosClient::operate_read(IoCtxImpl& io, const object_t& oid, ::ObjectOperation *o, bufferlist *pbl) { - /* can't write to a snapshot */ - if (io.snap_seq != CEPH_NOSNAP) - return -EINVAL; - if (!o->size()) return 0; @@ -1780,7 +1776,7 @@ int librados::RadosClient::aio_operate(IoCtxImpl& io, const object_t& oid, utime_t ut = ceph_clock_now(cct); /* can't write to a snapshot */ if (io.snap_seq != CEPH_NOSNAP) - return -EINVAL; + return -EROFS; Context *onack = new C_aio_Ack(c); Context *oncommit = new C_aio_Safe(c); @@ -3862,7 +3858,7 @@ extern "C" int rados_getxattrs(rados_ioctx_t io, const char *oid, { RadosXattrsIter *it = new RadosXattrsIter(); if (!it) - return ENOMEM; + return -ENOMEM; librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io; object_t obj(oid); int ret = ctx->client->getxattrs(*ctx, obj, it->attrset); @@ -3895,7 +3891,7 @@ extern "C" int rados_getxattrs_next(rados_xattrs_iter_t iter, size_t bl_len = bl.length(); it->val = (char*)malloc(bl_len); if (!it->val) - return ENOMEM; + return -ENOMEM; memcpy(it->val, bl.c_str(), bl_len); *val = it->val; *len = bl_len; |