From: Michael Vrable Date: Tue, 2 Feb 2010 20:29:20 +0000 (-0800) Subject: Create a runtime option for sync/async frontend request handling. X-Git-Url: http://git.vrable.net/?p=bluesky.git;a=commitdiff_plain;h=e6ca13c07e0cb5dd05d48a12cd50a2cf6179ce1a Create a runtime option for sync/async frontend request handling. --- diff --git a/bluesky/bluesky.h b/bluesky/bluesky.h index 7f0ac85..7b8aad2 100644 --- a/bluesky/bluesky.h +++ b/bluesky/bluesky.h @@ -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; diff --git a/bluesky/init.c b/bluesky/init.c index 7a6efe1..6f8737b 100644 --- a/bluesky/init.c +++ b/bluesky/init.c @@ -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} }; diff --git a/nfs3/rpc.c b/nfs3/rpc.c index a807022..a01408f 100644 --- a/nfs3/rpc.c +++ b/nfs3/rpc.c @@ -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; }