/* Four stage 2 varieties: request_lock(), convert_lock(), unlock_lock(), cancel_lock()  */
static int request_lock(struct dlm_ls *ls, struct dlm_lkb *lkb, char *name, int len, struct dlm_args *args)
/* Four stage 2 varieties: request_lock(), convert_lock(), unlock_lock(), cancel_lock()  */
static int request_lock(struct dlm_ls *ls, struct dlm_lkb *lkb, char *name, int len, struct dlm_args *args)
{
	struct dlm_rsb *r;
	int error;
	error = validate_lock_args(ls, lkb, args);
	if (error)
		goto out;
	error = find_rsb(ls, name, len, R_CREATE, &r);
	if (error)
		goto out;
	lock_rsb(r);
	attach_lkb(r, lkb);
	lkb->lkb_lksb->sb_lkid = lkb->lkb_id;
	error = _request_lock(r, lkb);
	unlock_rsb(r);
	put_rsb(r);
 out:
	return error;
}