Create a runtime option for sync/async frontend request handling.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 2 Feb 2010 20:29:20 +0000 (12:29 -0800)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 2 Feb 2010 20:29:20 +0000 (12:29 -0800)
bluesky/bluesky.h
bluesky/init.c
nfs3/rpc.c

index 7f0ac85..7b8aad2 100644 (file)
@@ -29,6 +29,10 @@ typedef struct {
      * created in a pending state, and not unlocked until the data is actually
      * available.) */
     int sync_inode_fetches;
+
+    /* Should frontends handle requests serially or allow operations to proceed
+     * in parallel? */
+    int sync_frontends;
 } BlueSkyOptions;
 
 extern BlueSkyOptions bluesky_options;
index 7a6efe1..6f8737b 100644 (file)
@@ -23,6 +23,7 @@ static struct {
     {"BLUESKY_OPT_SYNC_STORES", &bluesky_options.synchronous_stores},
     {"BLUESKY_OPT_WRITETHROUGH", &bluesky_options.writethrough_cache},
     {"BLUESKY_OPT_SYNC_INODE_FETCH", &bluesky_options.sync_inode_fetches},
+    {"BLUESKY_OPT_SYNC_FRONTENDS", &bluesky_options.sync_frontends},
     {NULL, NULL}
 };
 
index a807022..a01408f 100644 (file)
@@ -646,7 +646,11 @@ static gboolean async_rpc_dispatch(RPCConnection *rpc)
     req->req_proc = ntohl(header->proc);
     rpc->msgbuf = g_string_new("");
 
-    g_thread_pool_push(rpc_thread_pool, req, NULL);
+    if (bluesky_options.sync_frontends) {
+        nfs_program_3(req);
+    } else {
+        g_thread_pool_push(rpc_thread_pool, req, NULL);
+    }
 
     return TRUE;
 }