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: v14.2.10~7^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c9ae988f3ab4c72866955cbe89f66f1e11912d3e;p=ceph.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 (cherry picked from commit adcf12d6c329a3bd534e089bc0c8b42dfd3e4515) --- diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h index a1fc0a7e30ae..c1668769f3fc 100755 --- a/src/include/cephfs/libcephfs.h +++ b/src/include/cephfs/libcephfs.h @@ -1852,6 +1852,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 160ff47a99b6..66c066436d2e 100755 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -1993,3 +1993,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); +}