@@ -1033,7 +1033,7 @@ struct md_ops {
int (*free_lustre_md)(struct obd_export *, struct lustre_md *);
- int (*merge_attr)(struct obd_export *, const struct lu_fid *fid,
+ int (*merge_attr)(struct obd_export *exp,
const struct lmv_stripe_md *lsm,
struct cl_attr *attr, ldlm_blocking_callback);
@@ -1460,7 +1460,6 @@ static inline int md_free_lustre_md(struct obd_export *exp,
}
static inline int md_merge_attr(struct obd_export *exp,
- const struct lu_fid *fid,
const struct lmv_stripe_md *lsm,
struct cl_attr *attr,
ldlm_blocking_callback cb)
@@ -1471,7 +1470,7 @@ static inline int md_merge_attr(struct obd_export *exp,
if (rc)
return rc;
- return MDP(exp->exp_obd, merge_attr)(exp, fid, lsm, attr, cb);
+ return MDP(exp->exp_obd, merge_attr)(exp, lsm, attr, cb);
}
static inline int md_setxattr(struct obd_export *exp, const struct lu_fid *fid,
@@ -4708,8 +4708,8 @@ static int ll_merge_md_attr(struct inode *inode)
return 0;
down_read(&lli->lli_lsm_sem);
- rc = md_merge_attr(ll_i2mdexp(inode), &lli->lli_fid, lli->lli_lsm_md,
- &attr, ll_md_blocking_ast);
+ rc = md_merge_attr(ll_i2mdexp(inode), lli->lli_lsm_md, &attr,
+ ll_md_blocking_ast);
up_read(&lli->lli_lsm_sem);
if (rc)
return rc;
@@ -1521,8 +1521,8 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md)
}
/* validate the lsm */
- rc = md_merge_attr(ll_i2mdexp(inode), &lli->lli_fid, lli->lli_lsm_md,
- attr, ll_md_blocking_ast);
+ rc = md_merge_attr(ll_i2mdexp(inode), lli->lli_lsm_md, attr,
+ ll_md_blocking_ast);
if (!rc) {
if (md->body->mbo_valid & OBD_MD_FLNLINK)
md->body->mbo_nlink = attr->cat_nlink;
@@ -153,7 +153,6 @@ static int lmv_intent_remote(struct obd_export *exp, struct lookup_intent *it,
}
int lmv_revalidate_slaves(struct obd_export *exp,
- const struct lu_fid *pfid,
const struct lmv_stripe_md *lsm,
ldlm_blocking_callback cb_blocking,
int extra_lock_flags)
@@ -197,11 +196,14 @@ int lmv_revalidate_slaves(struct obd_export *exp,
* which is not needed here.
*/
memset(op_data, 0, sizeof(*op_data));
- if (exp_connect_flags2(exp) & OBD_CONNECT2_GETATTR_PFID)
- op_data->op_fid1 = *pfid;
- else
- op_data->op_fid1 = fid;
+ op_data->op_fid1 = fid;
op_data->op_fid2 = fid;
+ /* shard revalidate only needs to fetch attributes and UPDATE
+ * lock, which is similar to the bottom half of remote object
+ * getattr, set this flag so that MDT skips checking whether
+ * it's remote object.
+ */
+ op_data->op_bias = MDS_CROSS_REF;
tgt = lmv_tgt(lmv, lsm->lsm_md_oinfo[i].lmo_mds);
if (!tgt) {
@@ -495,8 +497,7 @@ static int lmv_intent_lookup(struct obd_export *exp,
* during update_inode process (see ll_update_lsm_md)
*/
if (lmv_dir_striped(op_data->op_mea2)) {
- rc = lmv_revalidate_slaves(exp, &op_data->op_fid2,
- op_data->op_mea2,
+ rc = lmv_revalidate_slaves(exp, op_data->op_mea2,
cb_blocking,
extra_lock_flags);
if (rc != 0)
@@ -53,7 +53,6 @@ int lmv_fid_alloc(const struct lu_env *env, struct obd_export *exp,
struct lu_fid *fid, struct md_op_data *op_data);
int lmv_revalidate_slaves(struct obd_export *exp,
- const struct lu_fid *pfid,
const struct lmv_stripe_md *lsm,
ldlm_blocking_callback cb_blocking,
int extra_lock_flags);
@@ -3482,7 +3482,6 @@ static int lmv_quotactl(struct obd_device *unused, struct obd_export *exp,
}
static int lmv_merge_attr(struct obd_export *exp,
- const struct lu_fid *fid,
const struct lmv_stripe_md *lsm,
struct cl_attr *attr,
ldlm_blocking_callback cb_blocking)
@@ -3492,7 +3491,7 @@ static int lmv_merge_attr(struct obd_export *exp,
if (!lmv_dir_striped(lsm))
return 0;
- rc = lmv_revalidate_slaves(exp, fid, lsm, cb_blocking, 0);
+ rc = lmv_revalidate_slaves(exp, lsm, cb_blocking, 0);
if (rc < 0)
return rc;
@@ -1705,6 +1705,13 @@ struct mdt_rec_setattr {
enum mds_op_bias {
/* MDS_CHECK_SPLIT = 1 << 0, obsolete before 2.3.58 */
+ /* used for remote object getattr/open by name: in the original
+ * getattr/open request, MDT found the object against name is on another
+ * MDT, then packed FID and LOOKUP lock in reply and returned -EREMOTE,
+ * and client knew it's a remote object, then set this flag in
+ * getattr/open request and sent to the corresponding MDT to finish
+ * getattr/open, which fetched attributes and UPDATE lock/opened file.
+ */
MDS_CROSS_REF = 1 << 1,
/* MDS_VTX_BYPASS = 1 << 2, obsolete since 2.3.54 */
MDS_PERM_BYPASS = 1 << 3,