(void)ptlrpc_pinger_del_import(imp);
rc = ptlrpc_disconnect_import(imp, 0);
- if (rc)
+ if (rc && rc != -ETIMEDOUT)
CERROR("%s: can't disconnect: rc = %d\n",
d->opd_obd->obd_name, rc);
ENTRY;
- if (unlikely(d->opd_imp_active == 0)) {
- /*
- * in case of inactive OST we return nulls
- * so that caller can understand this device
- * is unusable for new objects
- *
- * XXX: shouldn't we take normal statfs and fill
- * just few specific fields with zeroes?
- */
- memset(sfs, 0, sizeof(*sfs));
- sfs->os_bsize = 4096;
- RETURN(0);
- }
+ if (unlikely(d->opd_imp_active == 0))
+ RETURN(-ENOTCONN);
/* return recently updated data */
*sfs = d->opd_statfs;
* how many objects are available for immediate creation
*/
cfs_spin_lock(&d->opd_pre_lock);
- sfs->os_ffree = d->opd_pre_last_created - d->opd_pre_next;
+ sfs->os_fprecreated = d->opd_pre_last_created - d->opd_pre_used_id;
+ sfs->os_fprecreated -= d->opd_pre_reserved;
cfs_spin_unlock(&d->opd_pre_lock);
+ LASSERT(sfs->os_fprecreated <= OST_MAX_PRECREATE);
+
CDEBUG(D_OTHER, "%s: "LPU64" blocks, "LPU64" free, "LPU64" avail, "
LPU64" files, "LPU64" free files\n", d->opd_obd->obd_name,
sfs->os_blocks, sfs->os_bfree, sfs->os_bavail,
OBD_CONNECT_SKIP_ORPHAN |
OBD_CONNECT_VERSION |
OBD_CONNECT_FID;
+
+ if (is_osp_on_ost(osp->opd_obd->obd_name))
+ ocd->ocd_connect_flags |= OBD_CONNECT_LIGHTWEIGHT;
+
ocd->ocd_version = LUSTRE_VERSION_CODE;
LASSERT(data->ocd_connect_flags & OBD_CONNECT_INDEX);
ocd->ocd_index = data->ocd_index;