objclass: require each class method to have a flag set

The osd depends on this to set the client op flags for class call ops.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
Josh Durgin 2012-09-28 16:28:24 -07:00
parent 135c85a46e
commit 13ba5ec528

View File

@ -49,6 +49,8 @@ int cls_register_method(cls_handle_t hclass, const char *method,
int flags, int flags,
cls_method_call_t class_call, cls_method_handle_t *handle) cls_method_call_t class_call, cls_method_handle_t *handle)
{ {
if (!(flags & (CLS_METHOD_RD | CLS_METHOD_WR)))
return -EINVAL;
ClassHandler::ClassData *cls = (ClassHandler::ClassData *)hclass; ClassHandler::ClassData *cls = (ClassHandler::ClassData *)hclass;
cls_method_handle_t hmethod =(cls_method_handle_t)cls->register_method(method, flags, class_call); cls_method_handle_t hmethod =(cls_method_handle_t)cls->register_method(method, flags, class_call);
if (handle) if (handle)