From: Jeff Layton Date: Thu, 16 Apr 2020 16:19:59 +0000 (-0400) Subject: client: expose ceph_ll_register_callbacks via libcephfs X-Git-Tag: wip-pdonnell-testing-20200918.022351~1242^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=adcf12d6c329a3bd534e089bc0c8b42dfd3e4515;p=ceph-ci.git client: expose ceph_ll_register_callbacks via libcephfs Allow applications based on libcephfs to register callbacks, like we do for ceph-fuse. Signed-off-by: Jeff Layton --- diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h index ae771f07fe8..725fe3cf96d 100644 --- a/src/include/cephfs/libcephfs.h +++ b/src/include/cephfs/libcephfs.h @@ -1872,6 +1872,16 @@ int ceph_start_reclaim(struct ceph_mount_info *cmount, */ void ceph_finish_reclaim(struct ceph_mount_info *cmount); +/** + * Register a set of callbacks to be used with this cmount + * @param cmount the ceph mount handle on which the cb's should be registerd + * @param args callback arguments to register with the cmount + * + * Any fields set to NULL will be ignored. There currently is no way to + * unregister these callbacks, so this is a one-way change. + */ +void ceph_ll_register_callbacks(struct ceph_mount_info *cmount, + struct ceph_client_callback_args *args); #ifdef __cplusplus } #endif diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 0e5d9e6e365..b69a0b2b7b2 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -2007,3 +2007,9 @@ extern "C" void ceph_finish_reclaim(class ceph_mount_info *cmount) { cmount->get_client()->finish_reclaim(); } + +extern "C" void ceph_ll_register_callbacks(class ceph_mount_info *cmount, + struct ceph_client_callback_args *args) +{ + cmount->get_client()->ll_register_callbacks(args); +}