summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-handleops.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs-handleops.c')
-rw-r--r--api/src/glfs-handleops.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index c010f0c9a0f..f458cb4bd58 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1881,6 +1881,18 @@ pub_glfs_h_poll_upcall (struct glfs *fs, struct callback_arg *up_arg)
__GLFS_ENTRY_VALIDATE_FS (fs, err);
+ /* check if upcalls are enabled */
+ if (!fs->upcall_features) {
+ errno = ENOTSUP;
+ goto restore;
+ }
+
+ /* check if GF_UPCALL_CACHE_INVALIDATION is supported */
+ if (!(fs->upcall_features & (1 << GF_UPCALL_CACHE_INVALIDATION))) {
+ errno = ENOTSUP;
+ goto restore;
+ }
+
/* get the active volume */
subvol = glfs_active_subvol (fs);