objclass: add cls_get_features

Expose cls methods to the current OSDMap features set.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-05-16 05:37:56 -04:00
parent 5290133107
commit eef9cfaada
3 changed files with 11 additions and 0 deletions

View File

@ -677,6 +677,12 @@ int cls_current_subop_num(cls_method_context_t hctx)
return ctx->current_osd_subop_num;
}
uint64_t cls_get_features(cls_method_context_t hctx)
{
ReplicatedPG::OpContext *ctx = *(ReplicatedPG::OpContext **)hctx;
return ctx->pg->get_osdmap()->get_up_osd_features();
}
void cls_cxx_subop_version(cls_method_context_t hctx, string *s)
{
if (!s)

View File

@ -193,6 +193,7 @@ extern int cls_gen_rand_base64(char *dest, int size); /* size should be the requ
/* environment */
extern uint64_t cls_current_version(cls_method_context_t hctx);
extern int cls_current_subop_num(cls_method_context_t hctx);
extern uint64_t cls_get_features(cls_method_context_t hctx);
/* helpers */
extern void cls_cxx_subop_version(cls_method_context_t hctx, string *s);

View File

@ -1183,6 +1183,10 @@ int cls_cxx_list_watchers(cls_method_context_t hctx,
return 0;
}
uint64_t cls_get_features(cls_method_context_t hctx) {
return CEPH_FEATURES_DEFAULT_SUPPORTED;
}
int cls_log(int level, const char *format, ...) {
int size = 256;
va_list ap;