From: Michael Vrable Date: Thu, 4 Feb 2010 22:19:10 +0000 (-0800) Subject: Allow NFS lookup requests to better proceed in parallel. X-Git-Url: http://git.vrable.net/?a=commitdiff_plain;h=b114ba6e47b8e36ee568afa95e3463da1af12cf4;hp=aa3638792c059633e2b84d42c2d41bdf17555381;p=bluesky.git Allow NFS lookup requests to better proceed in parallel. After doing a directory lookup, drop the directory lock before fetching the file inode. --- diff --git a/nfs3/nfs3.c b/nfs3/nfs3.c index 42ac46c..2895e5b 100644 --- a/nfs3/nfs3.c +++ b/nfs3/nfs3.c @@ -243,10 +243,14 @@ void nfsproc3_lookup_3_svc(diropargs3 *argp, RPCRequest *req) async_rpc_send_reply(req, &result); return; } + + result.lookup3res_u.resok.dir_attributes.present = TRUE; + encode_fattr3(&result.lookup3res_u.resok.dir_attributes.post_op_attr_u.attributes, dir); + g_mutex_unlock(dir->lock); + BlueSkyInode *inode = bluesky_get_inode(fs, inum); if (inode == NULL) { result.status = NFS3ERR_NOENT; - g_mutex_unlock(dir->lock); async_rpc_send_reply(req, &result); return; } @@ -254,8 +258,6 @@ void nfsproc3_lookup_3_svc(diropargs3 *argp, RPCRequest *req) schedule_inode_unref(req, inode); result.status = NFS3_OK; - result.lookup3res_u.resok.dir_attributes.present = TRUE; - encode_fattr3(&result.lookup3res_u.resok.dir_attributes.post_op_attr_u.attributes, dir); result.lookup3res_u.resok.obj_attributes.present = TRUE; encode_fattr3(&result.lookup3res_u.resok.obj_attributes.post_op_attr_u.attributes, inode); @@ -265,7 +267,6 @@ void nfsproc3_lookup_3_svc(diropargs3 *argp, RPCRequest *req) result.lookup3res_u.resok.object.data.data_val = (char *)&fh_bytes; g_mutex_unlock(inode->lock); - g_mutex_unlock(dir->lock); async_rpc_send_reply(req, &result); } diff --git a/nfs3/synclient.c b/nfs3/synclient.c index d96ae13..fc33146 100644 --- a/nfs3/synclient.c +++ b/nfs3/synclient.c @@ -266,7 +266,7 @@ static gboolean idle_handler(gpointer data) int i; g_print("Sending requests...\n"); - for (i = 0; i < 8; i++) { + for (i = 0; i < 64; i++) { char buf[64]; struct diropargs3 lookup; uint64_t rootfh = GUINT64_TO_BE(1);