struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct ll_fid *fid,
struct vfsmount **mnt, int lock_mode,
struct lustre_handle *lockh,
- char *name, int namelen, __u64 lockpart);
+ __u64 lockpart);
struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
struct vfsmount **mnt);
int mds_update_server_data(struct obd_device *, int force_sync);
/* mdc/mdc_request.c */
int mdc_init_ea_size(struct obd_export *mdc_exp, struct obd_export *lov_exp);
-int mdc_req2lustre_md(struct ptlrpc_request *req, int offset,
+int mdc_req2lustre_md(struct ptlrpc_request *req, int offset,
struct obd_export *exp, struct lustre_md *md);
void mdc_free_lustre_md(struct obd_export *exp, struct lustre_md *md);
struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct ll_fid *fid,
struct vfsmount **mnt, int lock_mode,
struct lustre_handle *lockh,
- char *name, int namelen, __u64 lockpart)
+ __u64 lockpart)
{
struct mds_obd *mds = &obd->u.mds;
struct dentry *de = mds_fid2dentry(mds, fid, mnt), *retval = de;
/* For revalidate by fid we always take UPDATE lock */
dchild = mds_fid2locked_dentry(obd, &body->fid2, NULL,
LCK_CR, child_lockh,
- NULL, 0,
MDS_INODELOCK_UPDATE);
LASSERT(dchild);
if (IS_ERR(dchild))
static int mds_create_objects(struct ptlrpc_request *req, int offset,
struct mds_update_record *rec,
struct mds_obd *mds, struct obd_device *obd,
- struct dentry *dchild, void **handle,
+ struct dentry *dchild, void **handle,
obd_id **ids)
{
struct inode *inode = dchild->d_inode;
lmm_buf = lustre_msg_buf(req->rq_repmsg, offset, lmm_size);
if (!lmm_buf) {
if (!rc) rc = -ENOMEM;
- } else {
+ } else {
memcpy(lmm_buf, lmm, lmm_size);
}
if (rc)
lmm_buf = lustre_msg_buf(req->rq_repmsg, offset, lmm_size);
if (!lmm_buf) {
if (!rc) rc = -ENOMEM;
- } else {
+ } else {
memcpy(lmm_buf, lmm, lmm_size);
}
obd_free_diskmd(mds->mds_osc_exp, &lmm);
* Now that exp_outstanding_reply is a list, it's just using mfd != NULL
* to detect a re-open */
if (mfd == NULL) {
- if (rec->ur_flags & MDS_OPEN_JOIN_FILE) {
- rc = mds_join_file(rec, req, dchild, NULL);
- if (rc)
- GOTO(out_dput, rc);
- }
+ if (rec->ur_flags & MDS_OPEN_JOIN_FILE) {
+ rc = mds_join_file(rec, req, dchild, NULL);
+ if (rc)
+ GOTO(out_dput, rc);
+ }
mntget(mds->mds_vfsmnt);
CERROR("Re-opened file \n");
mfd = mds_dentry_open(dchild, mds->mds_vfsmnt,
up(&dchild->d_inode->i_sem);
RETURN(-EEXIST);
}
- if (rec->ur_flags & MDS_OPEN_JOIN_FILE) {
+ if (rec->ur_flags & MDS_OPEN_JOIN_FILE) {
up(&dchild->d_inode->i_sem);
- rc = mds_join_file(rec, req, dchild, lockh);
+ rc = mds_join_file(rec, req, dchild, lockh);
if (rc)
RETURN(rc);
down(&dchild->d_inode->i_sem);
- }
- if (!(body->valid & OBD_MD_FLEASIZE) &&
+ }
+ if (!(body->valid & OBD_MD_FLEASIZE) &&
!(body->valid & OBD_MD_FLMODEASIZE)) {
/* no EA: create objects */
rc = mds_create_objects(req, 2, rec, mds, obd,
if (rec->ur_flags & (MDS_OPEN_CREAT | MDS_OPEN_JOIN_FILE))
parent_mode = LCK_EX;
dparent = mds_fid2locked_dentry(obd, rec->ur_fid1, NULL, parent_mode,
- &parent_lockh, rec->ur_name,
- rec->ur_namelen - 1,
- MDS_INODELOCK_UPDATE);
+ &parent_lockh, MDS_INODELOCK_UPDATE);
if (IS_ERR(dparent)) {
rc = PTR_ERR(dparent);
if (rc != -ENOENT) {
CDEBUG(D_HA, "cancelling %d cookies\n",
(int)(mlcd->mlcd_cookielen / sizeof(*mlcd->mlcd_cookies)));
- rc = obd_unpackmd(obd->u.mds.mds_osc_exp, &lsm, mlcd->mlcd_lmm,
+ rc = obd_unpackmd(obd->u.mds.mds_osc_exp, &lsm, mlcd->mlcd_lmm,
mlcd->mlcd_eadatalen);
if (rc < 0) {
CERROR("bad LSM cancelling %d log cookies: rc %d\n",
lockpart |= MDS_INODELOCK_LOOKUP;
de = mds_fid2locked_dentry(obd, rec->ur_fid1, NULL, LCK_EX,
- &lockh, NULL, 0, lockpart);
+ &lockh, lockpart);
if (IS_ERR(de))
GOTO(cleanup, rc = PTR_ERR(de));
locked = 1;
rc = fsfilt_setattr(obd, de, handle, &rec->ur_iattr, 0);
/* journal chown/chgrp in llog, just like unlink */
if (rc == 0 && lmm_size){
- cookie_size = mds_get_cookie_size(obd, lmm);
+ cookie_size = mds_get_cookie_size(obd, lmm);
OBD_ALLOC(logcookies, cookie_size);
if (logcookies == NULL)
GOTO(cleanup, rc = -ENOMEM);
GOTO(cleanup, rc = -ESTALE);
dparent = mds_fid2locked_dentry(obd, rec->ur_fid1, NULL, LCK_EX, &lockh,
- rec->ur_name, rec->ur_namelen - 1,
MDS_INODELOCK_UPDATE);
if (IS_ERR(dparent)) {
rc = PTR_ERR(dparent);
int enqueue_4ordered_locks(struct obd_device *obd,struct ldlm_res_id *p1_res_id,
struct lustre_handle *p1_lockh, int p1_lock_mode,
- ldlm_policy_data_t *p1_policy,
+ ldlm_policy_data_t *p1_policy,
struct ldlm_res_id *p2_res_id,
struct lustre_handle *p2_lockh, int p2_lock_mode,
- ldlm_policy_data_t *p2_policy,
+ ldlm_policy_data_t *p2_policy,
struct ldlm_res_id *c1_res_id,
struct lustre_handle *c1_lockh, int c1_lock_mode,
- ldlm_policy_data_t *c1_policy,
+ ldlm_policy_data_t *c1_policy,
struct ldlm_res_id *c2_res_id,
struct lustre_handle *c2_lockh, int c2_lock_mode,
ldlm_policy_data_t *c2_policy)
int mds_get_cookie_size(struct obd_device *obd, struct lov_mds_md *lmm)
{
int count = le32_to_cpu(lmm->lmm_stripe_count);
- int real_csize = count * sizeof(struct llog_cookie);
+ int real_csize = count * sizeof(struct llog_cookie);
return real_csize;
}
CDEBUG(D_INFO, "Shrink to md_size %d cookie_size %d \n", md_size,
cookie_size);
-
+
lustre_shrink_reply(req, 1, md_size, 1);
-
- lustre_shrink_reply(req, md_size? 2:1, cookie_size, 0);
+
+ lustre_shrink_reply(req, md_size? 2:1, cookie_size, 0);
}
static int mds_reint_unlink(struct mds_update_record *rec, int offset,
rc = mds_get_parent_child_locked(obd, mds, rec->ur_fid1,
&parent_lockh, &dparent, LCK_EX,
- MDS_INODELOCK_UPDATE,
+ MDS_INODELOCK_UPDATE,
rec->ur_name, rec->ur_namelen,
- &child_lockh, &dchild, LCK_EX,
+ &child_lockh, &dchild, LCK_EX,
MDS_INODELOCK_FULL);
if (rc)
GOTO(cleanup, rc);
lockpart = MDS_INODELOCK_UPDATE;
de = mds_fid2locked_dentry(obd, &body->fid1, NULL, LCK_EX,
- &lockh, NULL, 0, lockpart);
+ &lockh, lockpart);
if (IS_ERR(de))
GOTO(out, rc = PTR_ERR(de));