@@ -912,8 +912,6 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
}
if (pca && pca->pca_dataset) {
- struct pcc_dataset *dataset = pca->pca_dataset;
-
lum = kzalloc(sizeof(*lum), GFP_NOFS);
if (!lum) {
retval = ERR_PTR(-ENOMEM);
@@ -924,22 +922,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
lum->lmm_pattern = LOV_PATTERN_F_RELEASED | LOV_PATTERN_RAID0;
op_data->op_data = lum;
op_data->op_data_size = sizeof(*lum);
- op_data->op_archive_id = dataset->pccd_rwid;
-
- rc = obd_fid_alloc(NULL, ll_i2mdexp(parent), &op_data->op_fid2,
- op_data);
- if (rc) {
- retval = ERR_PTR(rc);
- goto out;
- }
-
- rc = pcc_inode_create(parent->i_sb, dataset, &op_data->op_fid2,
- &pca->pca_dentry);
- if (rc) {
- retval = ERR_PTR(rc);
- goto out;
- }
-
+ op_data->op_archive_id = pca->pca_dataset->pccd_rwid;
it->it_flags |= MDS_OPEN_PCC;
}
@@ -980,6 +963,16 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
goto out;
}
+ if (pca && pca->pca_dataset) {
+ rc = pcc_inode_create(parent->i_sb, pca->pca_dataset,
+ &op_data->op_fid2,
+ &pca->pca_dentry);
+ if (rc) {
+ retval = ERR_PTR(rc);
+ goto out;
+ }
+ }
+
/* dir layout may change */
ll_unlock_md_op_lsm(op_data);
rc = ll_lookup_it_finish(req, it, parent, &dentry,
@@ -349,8 +349,7 @@ static int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
op_data->op_mds = tgt->ltd_index;
} else {
LASSERT(fid_is_sane(&op_data->op_fid1));
- LASSERT(it->it_flags & MDS_OPEN_PCC ||
- fid_is_zero(&op_data->op_fid2));
+ LASSERT(fid_is_zero(&op_data->op_fid2));
LASSERT(op_data->op_name);
tgt = lmv_locate_tgt(lmv, op_data);
@@ -361,8 +360,7 @@ static int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
/* If it is ready to open the file by FID, do not need
* allocate FID at all, otherwise it will confuse MDT
*/
- if ((it->it_op & IT_CREAT) && !(it->it_flags & MDS_OPEN_BY_FID ||
- it->it_flags & MDS_OPEN_PCC)) {
+ if ((it->it_op & IT_CREAT) && !(it->it_flags & MDS_OPEN_BY_FID)) {
/*
* For lookup(IT_CREATE) cases allocate new fid and setup FLD
* for it.