static int accumulate_inode_metadata(cls_method_context_t hctx,
bufferlist *in, bufferlist *out)
{
- assert(in != NULL);
- assert(out != NULL);
+ ceph_assert(in != NULL);
+ ceph_assert(out != NULL);
int r = 0;
*/
-#include "cls_cephfs_client.h"
+
#include "include/rados/librados.hpp"
#include "mds/CInode.h"
+#include "cls_cephfs_client.h"
+
#define XATTR_CEILING "scan_ceiling"
#define XATTR_MAX_MTIME "scan_max_mtime"
#define XATTR_MAX_SIZE "scan_max_size"
file_layout_t *layout,
AccumulateResult *result)
{
- assert(backtrace != NULL);
- assert(result != NULL);
+ ceph_assert(backtrace != NULL);
+ ceph_assert(result != NULL);
librados::ObjectReadOperation op;
const std::string &scrub_tag,
bufferlist *out_bl)
{
- assert(out_bl != NULL);
+ ceph_assert(out_bl != NULL);
// Leading part of bl is un-versioned string naming the filter
encode(std::string("cephfs.inode_tag"), *out_bl);
librados::AioCompletion *rados_completion =
librados::Rados::aio_create_completion(this, rados_callback, NULL);
int r = ioctx.aio_operate(oid, rados_completion, &op, &outbl);
- assert(r == 0);
+ ceph_assert(r == 0);
rados_completion->release();
}
librados::AioCompletion *rados_completion =
librados::Rados::aio_create_completion(this, rados_callback, NULL);
int r = ioctx.aio_operate(oid, rados_completion, &op, &outbl);
- assert(r == 0);
+ ceph_assert(r == 0);
rados_completion->release();
}
librados::AioCompletion *rados_completion =
librados::Rados::aio_create_completion(this, rados_callback, NULL);
int r = ioctx.aio_operate(oid, rados_completion, &op, &outbl);
- assert(r == 0);
+ ceph_assert(r == 0);
rados_completion->release();
}
entity_inst_t inst;
r = cls_get_request_origin(hctx, &inst);
id.locker = inst.name;
- assert(r == 0);
+ ceph_assert(r == 0);
/* check this early, before we check fail_if_exists, otherwise we might
* remove the locker entry and not check it later */
entity_inst_t inst;
int r = cls_get_request_origin(hctx, &inst);
- assert(r == 0);
+ ceph_assert(r == 0);
return remove_lock(hctx, op.name, inst.name, op.cookie);
}
entity_inst_t inst;
r = cls_get_request_origin(hctx, &inst);
- assert(r == 0);
+ ceph_assert(r == 0);
locker_id_t id;
id.cookie = op.cookie;
entity_inst_t inst;
r = cls_get_request_origin(hctx, &inst);
- assert(r == 0);
+ ceph_assert(r == 0);
locker_id_t id;
id.cookie = op.cookie;
lua_gettable(L, LUA_REGISTRYINDEX);
/* check cls_lua assumptions */
- assert(!lua_isnil(L, -1));
- assert(lua_type(L, -1) == LUA_TLIGHTUSERDATA);
+ ceph_assert(!lua_isnil(L, -1));
+ ceph_assert(lua_type(L, -1) == LUA_TLIGHTUSERDATA);
/* cast and cleanup stack */
clslua_hctx *hctx = (struct clslua_hctx *)lua_touserdata(L, -1);
lua_insert(L, 1);
lua_call(L, nargs, LUA_MULTRET);
struct clslua_err *err = clslua_checkerr(L);
- assert(err);
+ ceph_assert(err);
if (err->error) {
err->error = false;
lua_pushinteger(L, err->ret);
/* get table of registered handlers */
lua_pushlightuserdata(L, &clslua_registered_handle_reg_key);
lua_gettable(L, LUA_REGISTRYINDEX);
- assert(lua_type(L, -1) == LUA_TTABLE);
+ ceph_assert(lua_type(L, -1) == LUA_TTABLE);
/* lookup function argument */
lua_pushvalue(L, 1);
/* get table of registered handlers */
lua_pushlightuserdata(L, &clslua_registered_handle_reg_key);
lua_gettable(L, LUA_REGISTRYINDEX);
- assert(lua_type(L, -1) == LUA_TTABLE);
+ ceph_assert(lua_type(L, -1) == LUA_TTABLE);
/* lookup function argument */
lua_pushvalue(L, -2);
{
struct clslua_err *err = clslua_checkerr(L);
- assert(err);
+ ceph_assert(err);
if (err->error) {
CLS_ERR("error: cls_lua state machine: unexpected error");
ceph_abort();
static int bl_gc(lua_State *L)
{
struct bufferlist_wrap *blw = to_blwrap(L);
- assert(blw);
- assert(blw->bl);
+ ceph_assert(blw);
+ ceph_assert(blw->bl);
if (blw->gc)
delete blw->bl;
return 0;
return -EINVAL;
header = (struct rbd_obj_header_ondisk *)bl.c_str();
- assert(header);
+ ceph_assert(header);
if ((snap_count != header->snap_count) ||
(snap_names_len != header->snap_names_len)) {
ondisk_status.last_update = ceph_clock_now();
int r = cls_get_request_origin(hctx, &ondisk_status.origin);
- assert(r == 0);
+ ceph_assert(r == 0);
bufferlist bl;
encode(ondisk_status, bl, cls_get_features(hctx));
rados::cls::lock::locker_info_t> *lockers,
bool *exclusive_lock, std::string *lock_tag,
::SnapContext *snapc, ParentInfo *parent) {
- assert(size);
- assert(features);
- assert(incompatible_features);
- assert(lockers);
- assert(exclusive_lock);
- assert(snapc);
- assert(parent);
+ ceph_assert(size);
+ ceph_assert(features);
+ ceph_assert(incompatible_features);
+ ceph_assert(lockers);
+ ceph_assert(exclusive_lock);
+ ceph_assert(snapc);
+ ceph_assert(parent);
try {
uint8_t order;
int get_stripe_unit_count_finish(bufferlist::const_iterator *it,
uint64_t *stripe_unit,
uint64_t *stripe_count) {
- assert(stripe_unit);
- assert(stripe_count);
+ ceph_assert(stripe_unit);
+ ceph_assert(stripe_count);
try {
decode(*stripe_unit, *it);
int get_create_timestamp_finish(bufferlist::const_iterator *it,
utime_t *timestamp) {
- assert(timestamp);
+ ceph_assert(timestamp);
try {
decode(*timestamp, *it);
int get_access_timestamp_finish(bufferlist::const_iterator *it,
utime_t *timestamp) {
- assert(timestamp);
+ ceph_assert(timestamp);
try {
decode(*timestamp, *it);
int get_modify_timestamp_finish(bufferlist::const_iterator *it,
utime_t *timestamp) {
- assert(timestamp);
+ ceph_assert(timestamp);
try {
decode(*timestamp, *it);
int metadata_list_finish(bufferlist::const_iterator *it,
std::map<std::string, bufferlist> *pairs)
{
- assert(pairs);
+ ceph_assert(pairs);
try {
decode(*pairs, *it);
} catch (const buffer::error &err) {
int metadata_get(librados::IoCtx *ioctx, const std::string &oid,
const std::string &key, string *s)
{
- assert(s);
+ ceph_assert(s);
bufferlist in, out;
encode(key, in);
int r = ioctx->exec(oid, "rbd", "metadata_get", in, out);
int trash_list_finish(bufferlist::const_iterator *it,
map<string, cls::rbd::TrashImageSpec> *entries)
{
- assert(entries);
+ ceph_assert(entries);
try {
decode(*entries, *it);
int trash_get_finish(bufferlist::const_iterator *it,
cls::rbd::TrashImageSpec *trash_spec) {
- assert(trash_spec);
+ ceph_assert(trash_spec);
try {
decode(*trash_spec, *it);
} catch (const buffer::error &err) {
int namespace_list_finish(bufferlist::const_iterator *it,
std::list<std::string> *entries)
{
- assert(entries);
+ ceph_assert(entries);
try {
decode(*entries, *it);
string user_key;
bool truncated_status = false;
- assert(truncated != nullptr);
+ ceph_assert(truncated != nullptr);
if (!by_user) {
usage_record_prefix_by_time(end, end_key);
T *data;
int *ret_code;
public:
- ClsBucketIndexOpCtx(T* _data, int *_ret_code) : data(_data), ret_code(_ret_code) { assert(data); }
+ ClsBucketIndexOpCtx(T* _data, int *_ret_code) : data(_data), ret_code(_ret_code) { ceph_assert(data); }
~ClsBucketIndexOpCtx() override {}
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
Mutex::Locker l(lock);
map<int, librados::AioCompletion*>::iterator iter = pendings.find(id);
- assert(iter != pendings.end());
+ ceph_assert(iter != pendings.end());
completions[id] = iter->second;
pendings.erase(iter);