From b114ba6e47b8e36ee568afa95e3463da1af12cf4 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Thu, 4 Feb 2010 14:19:10 -0800 Subject: [PATCH 1/1] Allow NFS lookup requests to better proceed in parallel. After doing a directory lookup, drop the directory lock before fetching the file inode. --- nfs3/nfs3.c | 9 +++++---- nfs3/synclient.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) 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); -- 2.20.1