#define DEBUG_SUBSYSTEM S_MDS
+#include <linux/kthread.h>
+
+#include <lustre_obdo.h>
+
#include "osp_internal.h"
/*
*
* An interpretation callback called by ptlrpc for OST_STATFS RPC when it is
* replied by the target. It's used to maintain statfs cache for the target.
- * The function fills data from the reply if succesfull and schedules another
+ * The function fills data from the reply if successful and schedules another
* update.
*
* \param[in] env LU environment provided by the caller
d->opd_statfs_fresh_till = cfs_time_shift(obd_timeout * 1000);
d->opd_statfs_update_in_progress = 1;
- ptlrpcd_add_req(req, PDL_POLICY_ROUND, -1);
+ ptlrpcd_add_req(req);
RETURN(0);
}
*
* If cached statfs data claim no free space, but OSP has got a request to
* destroy an object (so release some space probably), then we may need to
- * refresh cached statfs data sooner then planned. The function checks there
+ * refresh cached statfs data sooner than planned. The function checks there
* is no statfs update going and schedules immediate update if so.
* XXX: there might be a case where removed object(s) do not add free space (empty
* object). If the number of such deletions is high, then we can start to update
/* don't consider new precreation till OST is healty and
* has free space */
- return ((window - d->opd_pre_reserved < d->opd_pre_grow_count / 2) &&
+ return ((window - d->opd_pre_reserved < d->opd_pre_create_count / 2) &&
(d->opd_pre_status == 0));
}
}
spin_lock(&d->opd_pre_lock);
- if (d->opd_pre_grow_count > d->opd_pre_max_grow_count / 2)
- d->opd_pre_grow_count = d->opd_pre_max_grow_count / 2;
- grow = d->opd_pre_grow_count;
+ if (d->opd_pre_create_count > d->opd_pre_max_create_count / 2)
+ d->opd_pre_create_count = d->opd_pre_max_create_count / 2;
+ grow = d->opd_pre_create_count;
spin_unlock(&d->opd_pre_lock);
body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
if (diff < grow) {
/* the OST has not managed to create all the
* objects we asked for */
- d->opd_pre_grow_count = max(diff, OST_MIN_PRECREATE);
- d->opd_pre_grow_slow = 1;
+ d->opd_pre_create_count = max(diff, OST_MIN_PRECREATE);
+ d->opd_pre_create_slow = 1;
} else {
/* the OST is able to keep up with the work,
- * we could consider increasing grow_count
+ * we could consider increasing create_count
* next time if needed */
- d->opd_pre_grow_slow = 0;
+ d->opd_pre_create_slow = 0;
}
body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
spin_lock(&d->opd_pre_lock);
diff = osp_fid_diff(&d->opd_last_used_fid, last_fid);
if (diff > 0) {
- d->opd_pre_grow_count = OST_MIN_PRECREATE + diff;
+ d->opd_pre_create_count = OST_MIN_PRECREATE + diff;
d->opd_pre_last_created_fid = d->opd_last_used_fid;
} else {
- d->opd_pre_grow_count = OST_MIN_PRECREATE;
+ d->opd_pre_create_count = OST_MIN_PRECREATE;
d->opd_pre_last_created_fid = *last_fid;
}
/*
LASSERT(fid_oid(&d->opd_pre_last_created_fid) <=
LUSTRE_DATA_SEQ_MAX_WIDTH);
d->opd_pre_used_fid = d->opd_pre_last_created_fid;
- d->opd_pre_grow_slow = 0;
+ d->opd_pre_create_slow = 0;
spin_unlock(&d->opd_pre_lock);
CDEBUG(D_HA, "%s: Got last_id "DFID" from OST, last_created "DFID
msfs->os_bfree, used, msfs->os_bavail,
d->opd_pre_status, rc);
CDEBUG(D_INFO,
- "non-commited changes: %lu, in progress: %u\n",
+ "non-committed changes: %lu, in progress: %u\n",
d->opd_syn_changes, d->opd_syn_rpc_in_progress);
} else if (old == -ENOSPC) {
d->opd_pre_status = 0;
spin_lock(&d->opd_pre_lock);
- d->opd_pre_grow_slow = 0;
- d->opd_pre_grow_count = OST_MIN_PRECREATE;
+ d->opd_pre_create_slow = 0;
+ d->opd_pre_create_count = OST_MIN_PRECREATE;
spin_unlock(&d->opd_pre_lock);
wake_up(&d->opd_pre_waitq);
CDEBUG(D_INFO, "%s: no space: "LPU64" blocks, "LPU64
* increase number of precreations
*/
precreated = osp_objs_precreated(env, d);
- if (d->opd_pre_grow_count < d->opd_pre_max_grow_count &&
- d->opd_pre_grow_slow == 0 &&
- precreated <= (d->opd_pre_grow_count / 4 + 1)) {
+ if (d->opd_pre_create_count < d->opd_pre_max_create_count &&
+ d->opd_pre_create_slow == 0 &&
+ precreated <= (d->opd_pre_create_count / 4 + 1)) {
spin_lock(&d->opd_pre_lock);
- d->opd_pre_grow_slow = 1;
- d->opd_pre_grow_count *= 2;
+ d->opd_pre_create_slow = 1;
+ d->opd_pre_create_count *= 2;
spin_unlock(&d->opd_pre_lock);
}
}
/*
- * Set size regular attribute on a object
+ * Set size regular attribute on an object
*
* When a striping is created late, it's possible that size is already
* initialized on the file. Then the new striping should inherit size
d->opd_pre_last_created_fid.f_oid = 1;
d->opd_pre_reserved = 0;
d->opd_got_disconnected = 1;
- d->opd_pre_grow_slow = 0;
- d->opd_pre_grow_count = OST_MIN_PRECREATE;
- d->opd_pre_min_grow_count = OST_MIN_PRECREATE;
- d->opd_pre_max_grow_count = OST_MAX_PRECREATE;
+ d->opd_pre_create_slow = 0;
+ d->opd_pre_create_count = OST_MIN_PRECREATE;
+ d->opd_pre_min_create_count = OST_MIN_PRECREATE;
+ d->opd_pre_max_create_count = OST_MAX_PRECREATE;
spin_lock_init(&d->opd_pre_lock);
init_waitqueue_head(&d->opd_pre_waitq);