int (*m_clear_open_replay_data)(struct obd_export *,
struct obd_client_handle *);
- int (*m_set_lock_data)(struct obd_export *, __u64 *, void *, __u64 *);
+ int (*m_set_lock_data)(struct obd_export *,
+ const struct lustre_handle *, void *, __u64 *);
enum ldlm_mode (*m_lock_match)(struct obd_export *, __u64,
const struct lu_fid *, enum ldlm_type,
}
static inline int md_set_lock_data(struct obd_export *exp,
- __u64 *lockh, void *data, __u64 *bits)
+ const struct lustre_handle *lockh,
+ void *data, __u64 *bits)
{
ENTRY;
EXP_CHECK_MD_OP(exp, set_lock_data);
PFID(&lli->lli_fid), inode);
/* in case this is a caching lock and reinstate with new inode */
- md_set_lock_data(sbi->ll_md_exp, &lockh->cookie, inode, NULL);
+ md_set_lock_data(sbi->ll_md_exp, lockh, inode, NULL);
lock_res_and_lock(lock);
lvb_ready = ldlm_is_lvb_ready(lock);
"(%p) for remote lock "LPX64"\n",
PFID(ll_inode2fid(inode)), inode,
handle.cookie);
- md_set_lock_data(exp, &handle.cookie, inode, NULL);
+ md_set_lock_data(exp, &handle, inode, NULL);
}
handle.cookie = it->it_lock_handle;
" for lock "LPX64"\n",
PFID(ll_inode2fid(inode)), inode, handle.cookie);
- md_set_lock_data(exp, &handle.cookie, inode,
- &it->it_lock_bits);
+ md_set_lock_data(exp, &handle, inode, &it->it_lock_bits);
it->it_lock_set = 1;
}
LTIME_S(inode->i_mtime) = body->mbo_mtime;
}
- md_set_lock_data(tgt->ltd_exp, &lockh->cookie, inode, NULL);
+ md_set_lock_data(tgt->ltd_exp, lockh, inode, NULL);
if (it.it_lock_mode != 0 && lockh != NULL) {
ldlm_lock_decref(lockh, it.it_lock_mode);
it.it_lock_mode = 0;
RETURN(rc);
}
-int lmv_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
- __u64 *bits)
+static int lmv_set_lock_data(struct obd_export *exp,
+ const struct lustre_handle *lockh,
+ void *data, __u64 *bits)
{
struct lmv_obd *lmv = &exp->exp_obd->u.lmv;
struct lmv_tgt_desc *tgt = lmv->tgts[0];
/* mdc/mdc_locks.c */
int mdc_set_lock_data(struct obd_export *exp,
- __u64 *lockh, void *data, __u64 *bits);
+ const struct lustre_handle *lockh,
+ void *data, __u64 *bits);
int mdc_null_inode(struct obd_export *exp, const struct lu_fid *fid);
EXPORT_SYMBOL(it_open_error);
/* this must be called on a lockh that is known to have a referenced lock */
-int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
- __u64 *bits)
+int mdc_set_lock_data(struct obd_export *exp, const struct lustre_handle *lockh,
+ void *data, __u64 *bits)
{
struct ldlm_lock *lock;
struct inode *new_inode = data;
if(bits)
*bits = 0;
- if (!*lockh)
- RETURN(0);
+ if (!lustre_handle_is_used(lockh))
+ RETURN(0);
- lock = ldlm_handle2lock((struct lustre_handle *)lockh);
+ lock = ldlm_handle2lock(lockh);
LASSERT(lock != NULL);
lock_res_and_lock(lock);
}
rc = 0;
- mdc_set_lock_data(exp, &it.it_lock_handle, dir, NULL);
+ lockh.cookie = it.it_lock_handle;
+ mdc_set_lock_data(exp, &lockh, dir, NULL);
rp_param.rp_off = hash_offset;
rp_param.rp_hash64 = op_data->op_cli_flags & CLI_HASH64;
}
*ppage = page;
out_unlock:
- lockh.cookie = it.it_lock_handle;
ldlm_lock_decref(&lockh, it.it_lock_mode);
- it.it_lock_handle = 0;
return rc;
fail:
kunmap(page);