* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
{
struct lov_oinfo *loi;
int i;
+ __u64 stripe_maxbytes = OBD_OBJECT_EOF;
lsm_unpackmd_common(lsm, lmm);
for (i = 0; i < lsm->lsm_stripe_count; i++) {
+ struct obd_import *imp;
+
/* XXX LOV STACKING call down to osc_unpackmd() */
loi = lsm->lsm_oinfo[i];
loi->loi_id = le64_to_cpu(lmm->lmm_objects[i].l_object_id);
lov_dump_lmm_v1(D_WARNING, lmm);
return -EINVAL;
}
+ /* calculate the minimum stripe max bytes */
+ imp = lov->lov_tgts[loi->loi_ost_idx]->ltd_obd->u.cli.cl_import;
+ if (imp != NULL) {
+ if (!(imp->imp_connect_data.ocd_connect_flags &
+ OBD_CONNECT_MAXBYTES)) {
+ imp->imp_connect_data.ocd_maxbytes =
+ LUSTRE_STRIPE_MAXBYTES;
+ }
+ if (stripe_maxbytes>imp->imp_connect_data.ocd_maxbytes){
+ stripe_maxbytes =
+ imp->imp_connect_data.ocd_maxbytes;
+ }
+ }
}
+ /* no ost connected yet */
+ if (stripe_maxbytes == OBD_OBJECT_EOF)
+ stripe_maxbytes = LUSTRE_STRIPE_MAXBYTES;
+ lsm->lsm_maxbytes = stripe_maxbytes * lsm->lsm_stripe_count;
+
return 0;
}
struct lov_mds_md_v3 *lmm;
struct lov_oinfo *loi;
int i;
+ __u64 stripe_maxbytes = OBD_OBJECT_EOF;
lmm = (struct lov_mds_md_v3 *)lmmv1;
strncpy(lsm->lsm_pool_name, lmm->lmm_pool_name, LOV_MAXPOOLNAME);
for (i = 0; i < lsm->lsm_stripe_count; i++) {
+ struct obd_import *imp;
+
/* XXX LOV STACKING call down to osc_unpackmd() */
loi = lsm->lsm_oinfo[i];
loi->loi_id = le64_to_cpu(lmm->lmm_objects[i].l_object_id);
lov_dump_lmm_v3(D_WARNING, lmm);
return -EINVAL;
}
+ /* calculate the minimum stripe max bytes */
+ imp = lov->lov_tgts[loi->loi_ost_idx]->ltd_obd->u.cli.cl_import;
+ if (imp != NULL) {
+ if (!(imp->imp_connect_data.ocd_connect_flags &
+ OBD_CONNECT_MAXBYTES)) {
+ imp->imp_connect_data.ocd_maxbytes =
+ LUSTRE_STRIPE_MAXBYTES;
+ }
+ if (stripe_maxbytes>imp->imp_connect_data.ocd_maxbytes){
+ stripe_maxbytes =
+ imp->imp_connect_data.ocd_maxbytes;
+ }
+ }
}
+ /* no ost connected yet */
+ if (stripe_maxbytes == OBD_OBJECT_EOF)
+ stripe_maxbytes = LUSTRE_STRIPE_MAXBYTES;
+ lsm->lsm_maxbytes = stripe_maxbytes * lsm->lsm_stripe_count;
+
return 0;
}