X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fofd%2Fofd_dlm.c;h=22effa043905bbc20acfe5c2861a998e46a0a58e;hp=34790c5f8c668f61d434e765b4710afe5a9d20db;hb=ae0d69437e35961c257f076da6dcc1842a55456d;hpb=113b7cfe87be903a2398550fb2cd32b77430bcda diff --git a/lustre/ofd/ofd_dlm.c b/lustre/ofd/ofd_dlm.c index 34790c5..22effa0 100644 --- a/lustre/ofd/ofd_dlm.c +++ b/lustre/ofd/ofd_dlm.c @@ -107,7 +107,8 @@ int ofd_intent_policy(struct ldlm_namespace *ns, struct ldlm_lock **lockp, [DLM_LOCKREPLY_OFF] = sizeof(*rep), [DLM_REPLY_REC_OFF] = sizeof(*reply_lvb) }; - + struct ldlm_glimpse_work gl_work; + CFS_LIST_HEAD(gl_list); ENTRY; policy = ldlm_get_processing_policy(res); @@ -226,8 +227,20 @@ int ofd_intent_policy(struct ldlm_namespace *ns, struct ldlm_lock **lockp, goto out; } - LASSERTF(l->l_glimpse_ast != NULL, "l == %p", l); - rc = l->l_glimpse_ast(l, NULL); /* this will update the LVB */ + /* Populate the gl_work structure. + * Grab additional reference on the lock which will be released in + * ldlm_work_gl_ast_lock() */ + gl_work.gl_lock = LDLM_LOCK_GET(l); + /* The glimpse callback is sent to one single extent lock. As a result, + * the gl_work list is just composed of one element */ + cfs_list_add_tail(&gl_work.gl_list, &gl_list); + /* the ldlm_glimpse_work structure is allocated on the stack */ + gl_work.gl_flags = LDLM_GL_WORK_NOFREE; + + rc = ldlm_glimpse_locks(res, &gl_list); /* this will update the LVB */ + + if (!cfs_list_empty(&gl_list)) + LDLM_LOCK_RELEASE(l); lock_res(res); *reply_lvb = *res_lvb;