}
int ofd_intent_policy(struct ldlm_namespace *ns, struct ldlm_lock **lockp,
- void *req_cookie, ldlm_mode_t mode, int flags,
+ void *req_cookie, ldlm_mode_t mode, __u64 flags,
void *data)
{
struct ptlrpc_request *req = req_cookie;
struct ost_lvb *res_lvb, *reply_lvb;
struct ldlm_reply *rep;
ldlm_error_t err;
- int idx, rc;
- int tmpflags = 0, only_liblustre = 1;
+ int idx, rc, only_liblustre = 1;
+ __u64 tmpflags = 0;
struct ldlm_interval_tree *tree;
struct ofd_intent_args arg;
__u32 repsize[3] = {
[DLM_LOCKREPLY_OFF] = sizeof(*rep),
[DLM_REPLY_REC_OFF] = sizeof(*reply_lvb)
};
-
+ struct ldlm_glimpse_work gl_work;
+ CFS_LIST_HEAD(gl_list);
ENTRY;
+ lock->l_lvb_type = LVB_T_OST;
policy = ldlm_get_processing_policy(res);
LASSERT(policy != NULL);
LASSERT(req != NULL);
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);
+ /* There is actually no need for a glimpse descriptor when glimpsing
+ * extent locks */
+ gl_work.gl_desc = NULL;
+ /* 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;