* interpret routine to be called.
* lov_statfs_fini() must thus be called
* by the request interpret routine */
-
+#define OBD_STATFS_FOR_MDT0 0x0008 /* The statfs is only for retrieving
+ * information from MDT0. */
#define OBD_FL_PUNCH 0x00000001 /* To indicate it is punch operation */
/* OBD Device Declarations */
GOTO(out, err);
}
+ /* For mount, we only need fs info from MDT0, and also in DNE, it
+ * can make sure the client can be mounted as long as MDT0 is
+ * avaible */
err = obd_statfs(NULL, sbi->ll_md_exp, osfs,
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), 0);
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_FOR_MDT0);
if (err)
GOTO(out_md, err);
GOTO(out_md, err);
}
- LASSERT(osfs->os_bsize);
+ LASSERT(osfs->os_bsize);
sb->s_blocksize = osfs->os_bsize;
sb->s_blocksize_bits = log2(osfs->os_bsize);
sb->s_magic = LL_SUPER_MAGIC;
}
it->d.lustre.it_lock_handle = entry->se_handle;
- rc = md_revalidate_lock(ll_i2mdexp(dir), it, NULL, NULL);
+ rc = md_revalidate_lock(ll_i2mdexp(dir), it, ll_inode2fid(dir), NULL);
if (rc != 1)
GOTO(out, rc = -EAGAIN);
const struct lu_fid *fid,
mdsno_t *mds)
{
- int rc;
- ENTRY;
+ int rc;
+ ENTRY;
- LASSERT(fid_is_sane(fid));
+ LASSERTF(fid_is_sane(fid), DFID" is insane!\n", PFID(fid));
/* FIXME: Because ZFS still use LOCAL fid sequence for root,
* and root will always be in MDT0, for local fid, it will
rc = obd_iocontrol(cmd, lmv->tgts[0].ltd_exp, len, karg, uarg);
break;
}
+ case OBD_IOC_FID2PATH: {
+ struct getinfo_fid2path *gf;
+ struct lmv_tgt_desc *tgt;
+ gf = (struct getinfo_fid2path *)karg;
+ tgt = lmv_find_target(lmv, &gf->gf_fid);
+ if (IS_ERR(tgt))
+ RETURN(PTR_ERR(tgt));
+ rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
+ break;
+ }
default : {
for (i = 0; i < count; i++) {
int err;
rc);
GOTO(out_free_temp, rc);
}
- if (i == 0) {
- *osfs = *temp;
+
+ if (i == 0) {
+ *osfs = *temp;
+ /* If the statfs is from mount, it will needs
+ * retrieve necessary information from MDT0.
+ * i.e. mount does not need the merged osfs
+ * from all of MDT.
+ * And also clients can be mounted as long as
+ * MDT0 is in service*/
+ if (flags & OBD_STATFS_FOR_MDT0)
+ GOTO(out_free_temp, rc);
} else {
osfs->os_bavail += temp->os_bavail;
osfs->os_blocks += temp->os_blocks;