diff options
author | Soumya Koduri <skoduri@redhat.com> | 2017-09-22 16:43:39 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2017-10-31 07:53:50 +0000 |
commit | c0e77f643930499966554cd849a40580e4ff68f9 (patch) | |
tree | 5baf2c5b33da77b4567fd23a77d526ca890519b0 /api/src/glfs-internal.h | |
parent | 4216869c724cf19c12d63c0580de88e9427e6467 (diff) |
gfapi: Register/Unregister Upcall events' callback
Polling continuously for upcall events is not optimal.
Hence new APIs have been added to allow applications to
register and unregister upcall events it is interested in
along with callback function to be invoked in case of any
such upcalls sent by backend server.
@TODO: Make changes in upcall xlator so that events are
sent to only those clients which either registered callbacks
or started polling. Shall be addressed in separate patch.
Updates: #315
Change-Id: I40473fd5cf689172ff2d7bb2869756b7fd5bc761
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'api/src/glfs-internal.h')
-rw-r--r-- | api/src/glfs-internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h index 757bc18eb1d..76b0e34f1bd 100644 --- a/api/src/glfs-internal.h +++ b/api/src/glfs-internal.h @@ -194,6 +194,12 @@ struct glfs { uint32_t pin_refcnt; uint32_t pthread_flags; /* GLFS_INIT_* # defines set this flag */ + + uint32_t upcall_events; /* Mask of upcall events application + * is interested in */ + glfs_upcall_cbk up_cbk; /* upcall cbk function to be registered */ + void *up_data; /* Opaque data provided by application + * during upcall registration */ }; /* This enum is used to maintain the state of glfd. In case of async fops @@ -604,4 +610,5 @@ gf_dirent_to_dirent (gf_dirent_t *gf_dirent, struct dirent *dirent); int glfs_ipc (glfs_fd_t *fd, int cmd, void *xd_in, void **xd_out) __THROW GFAPI_PRIVATE(glfs_ipc, 3.12.0); +void glfs_release_upcall (void *ptr); #endif /* !_GLFS_INTERNAL_H */ |