diff options
Diffstat (limited to 'tests/basic/gfapi/upcall-cache-invalidate.c')
-rw-r--r-- | tests/basic/gfapi/upcall-cache-invalidate.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/basic/gfapi/upcall-cache-invalidate.c b/tests/basic/gfapi/upcall-cache-invalidate.c index ea1b5c4a88b..44e186955e7 100644 --- a/tests/basic/gfapi/upcall-cache-invalidate.c +++ b/tests/basic/gfapi/upcall-cache-invalidate.c @@ -43,8 +43,6 @@ main (int argc, char *argv[]) char *hostname = NULL; struct glfs_callback_inode_arg *in_arg = NULL; - cbk.reason = 0; - if (argc != 4) { fprintf (stderr, "Invalid argument\n"); exit(1); @@ -69,6 +67,13 @@ main (int argc, char *argv[]) ret = glfs_init (fs); LOG_ERR("glfs_init", ret); + /* This does not block, but enables caching of events. Real + * applications like NFS-Ganesha run this in a thread before activity + * on the fs (through this instance) happens. */ + ret = glfs_h_poll_upcall(fs_tmp, &cbk); + LOG_ERR ("glfs_h_poll_upcall", ret); + cbk.reason = 0; + fs2 = glfs_new (volname); if (!fs2) { fprintf (stderr, "glfs_new fs2: returned NULL\n"); |