}
/* indicate the features supported by this client */
- data->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_IBITS |
- OBD_CONNECT_JOIN | OBD_CONNECT_ATTRFID | OBD_CONNECT_NODEVOH |
- OBD_CONNECT_CANCELSET | OBD_CONNECT_AT;
+ data->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_IBITS |
+ OBD_CONNECT_JOIN | OBD_CONNECT_ATTRFID |
+ OBD_CONNECT_NODEVOH | OBD_CONNECT_CANCELSET |
+ OBD_CONNECT_AT | OBD_CONNECT_FID;
#ifdef HAVE_LRU_RESIZE_SUPPORT
if (sbi->ll_flags & LL_SBI_LRU_RESIZE)
data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
GOTO(out, err);
}
sbi->ll_mdc_exp = class_conn2export(&mdc_conn);
+ err = obd_fid_init(sbi->ll_mdc_exp);
+ if (err)
+ GOTO(out_mdc, err);
err = obd_statfs(obd, &osfs, cfs_time_current_64() - HZ, 0);
if (err)
GOTO(out_mdc, err = -ENODEV);
}
- data->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_GRANT |
- OBD_CONNECT_REQPORTAL | OBD_CONNECT_BRW_SIZE |
- OBD_CONNECT_SRVLOCK | OBD_CONNECT_CANCELSET | OBD_CONNECT_AT |
- OBD_CONNECT_TRUNCLOCK;
+ data->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_GRANT |
+ OBD_CONNECT_REQPORTAL | OBD_CONNECT_BRW_SIZE |
+ OBD_CONNECT_SRVLOCK | OBD_CONNECT_CANCELSET|
+ OBD_CONNECT_AT | OBD_CONNECT_FID |
+ OBD_CONNECT_TRUNCLOCK;
if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) {
/* OBD_CONNECT_CKSUM should always be set, even if checksums are
CERROR("cannot mds_connect: rc = %d\n", err);
GOTO(out_lock_cn_cb, err);
}
- CDEBUG(D_SUPER, "rootfid "LPU64"\n", rootfid.id);
+ CDEBUG(D_SUPER, "rootfid "LPU64":"DFID"\n", rootfid.id,
+ PFID((struct lu_fid*)&rootfid));
sbi->ll_rootino = rootfid.id;
sb->s_op = &lustre_super_operations;
}
LASSERT(sbi->ll_rootino != 0);
- root = ll_iget(sb, sbi->ll_rootino, &md);
+ root = ll_iget(sb, ll_fid_build_ino(sbi, &rootfid), &md);
ptlrpc_req_finished(request);
obd_disconnect(sbi->ll_osc_exp);
sbi->ll_osc_exp = NULL;
out_mdc:
+ obd_fid_fini(sbi->ll_mdc_exp);
obd_disconnect(sbi->ll_mdc_exp);
sbi->ll_mdc_exp = NULL;
out:
obd_disconnect(sbi->ll_osc_exp);
sbi->ll_osc_exp = NULL;
+ obd_fid_fini(sbi->ll_mdc_exp);
obd_disconnect(sbi->ll_mdc_exp);
sbi->ll_mdc_exp = NULL;
int ll_fill_super(struct super_block *sb)
{
- struct lustre_profile *lprof;
+ struct lustre_profile *lprof = NULL;
struct lustre_sb_info *lsi = s2lsi(sb);
struct ll_sb_info *sbi;
char *osc = NULL, *mdc = NULL;
struct config_llog_instance cfg = {0, };
char ll_instance[sizeof(sb) * 2 + 1];
int err;
+ char *save = NULL;
+ char pseudo[32] = { 0 };
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb);
"exist?\n", profilenm);
GOTO(out_free, err = -EINVAL);
}
+
+ /*
+ * The configuration for 1.8 client and 2.0 client are different.
+ * 2.0 introduces lmv, but 1.8 directly uses mdc.
+ * Here, we will hack to use proper name for mdc if needed.
+ */
+ {
+ char *fsname_end;
+ int namelen;
+
+ save = lprof->lp_mdc;
+ fsname_end = strrchr(save, '-');
+ if (fsname_end) {
+ namelen = fsname_end - save;
+ if (strcmp(fsname_end, "-clilmv") == 0) {
+ strncpy(pseudo, save, namelen);
+ strcat(pseudo, "-MDT0000-mdc");
+ lprof->lp_mdc = pseudo;
+ CDEBUG(D_INFO, "1.8.x connecting to 2.0: lmv=%s"
+ " new mdc=%s\n", save, pseudo);
+ }
+ }
+ }
+
CDEBUG(D_CONFIG, "Found profile %s: mdc=%s osc=%s\n", profilenm,
lprof->lp_mdc, lprof->lp_osc);
err = client_common_fill_super(sb, mdc, osc);
out_free:
+ if (save && lprof)
+ lprof->lp_mdc = save;
if (mdc)
OBD_FREE(mdc, strlen(mdc) + 1);
if (osc)
struct lov_stripe_md *lsm = lli->lli_smd;
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct ptlrpc_request *request = NULL;
- struct mdc_op_data op_data;
+ struct mdc_op_data op_data = { { 0 } };
struct lustre_md md;
int ia_valid = attr->ia_valid;
int rc = 0;
if (oa) {
oa->o_id = lsm->lsm_object_id;
- oa->o_valid = OBD_MD_FLID;
+ oa->o_gr = lsm->lsm_object_gr;
+ oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
flags = OBD_MD_FLTYPE | OBD_MD_FLATIME |
OBD_MD_FLMTIME | OBD_MD_FLCTIME |
struct ll_inode_info *lli = ll_i2info(inode);
struct mds_body *body = md->body;
struct lov_stripe_md *lsm = md->lsm;
+ struct ll_sb_info *sbi = ll_i2sbi(inode);
+ ENTRY;
+
+ CDEBUG(D_INODE, "body->valid = "LPX64"\n", body->valid);
LASSERT ((lsm != NULL) == ((body->valid & OBD_MD_FLEASIZE) != 0));
if (lsm != NULL) {
}
#endif
- if (body->valid & OBD_MD_FLID)
- inode->i_ino = body->ino;
+ inode->i_ino = ll_fid_build_ino(sbi, &body->fid1);
+ if (body->valid & OBD_MD_FLGENER)
+ inode->i_generation = body->generation;
+
if (body->valid & OBD_MD_FLATIME &&
body->atime > LTIME_S(inode->i_atime))
LTIME_S(inode->i_atime) = body->atime;
inode->i_flags = ll_ext_to_inode_flags(body->flags);
if (body->valid & OBD_MD_FLNLINK)
inode->i_nlink = body->nlink;
- if (body->valid & OBD_MD_FLGENER)
- inode->i_generation = body->generation;
+
if (body->valid & OBD_MD_FLRDEV)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
inode->i_rdev = body->rdev;
if (body->valid & OBD_MD_FLSIZE)
set_bit(LLI_F_HAVE_MDS_SIZE_LOCK, &lli->lli_flags);
+ EXIT;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
/* We want to return EXT3_*_FL flags to the caller via this
* ioctl. An older MDS may be sending S_* flags, fix it up. */
flags = ll_inode_to_ext_flags(body->flags,
- body->flags &MDS_BFLAG_EXT_FLAGS);
+ MDS_BFLAG_EXT_FLAGS);
ptlrpc_req_finished (req);
RETURN(put_user(flags, (int *)arg));
}
case EXT3_IOC_SETFLAGS: {
- struct mdc_op_data op_data;
+ struct mdc_op_data op_data = { { 0 } };
struct ll_iattr_struct attr;
struct obd_info oinfo = { { { 0 } } };
struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd;
}
oinfo.oi_oa->o_id = lsm->lsm_object_id;
+ oinfo.oi_oa->o_gr = lsm->lsm_object_gr;
oinfo.oi_oa->o_flags = flags;
- oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS;
+ oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP |
+ OBD_MD_FLFLAGS;
obdo_from_inode(oinfo.oi_oa, inode,
OBD_MD_FLFID | OBD_MD_FLGENER);
ll_update_inode(*inode, &md);
} else {
LASSERT(sb);
- *inode = ll_iget(sb, md.body->ino, &md);
+ /** hashing VFS inode by FIDs.
+ * IGIF will be used for for compatibility if needed.
+ */
+ *inode =ll_iget(sb, ll_fid_build_ino(sbi, &md.body->fid1), &md);
if (*inode == NULL || is_bad_inode(*inode)) {
mdc_free_lustre_md(exp, &md);
rc = -ENOMEM;