]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: expose ceph_ll_register_callbacks via libcephfs
authorJeff Layton <jlayton@redhat.com>
Thu, 16 Apr 2020 16:19:59 +0000 (12:19 -0400)
committerVicente Cheng <freeze.bilsted@gmail.com>
Wed, 20 May 2020 08:42:12 +0000 (08:42 +0000)
Allow applications based on libcephfs to register callbacks, like we
do for ceph-fuse.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit adcf12d6c329a3bd534e089bc0c8b42dfd3e4515)

src/include/cephfs/libcephfs.h
src/libcephfs.cc

index ae771f07fe8d7e301f7ced5f2e632aca8f8af9fa..725fe3cf96de4c6ac3749990bcc7d773d58c7a6d 100644 (file)
@@ -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
index 0e5d9e6e365748090821fdc05e9deaf839d3b33f..b69a0b2b7b2c63f16a2b21f0cde59426b5af9cd8 100644 (file)
@@ -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);
+}