* \retval negative negated errno on error
*/
static int osp_statfs_interpret(const struct lu_env *env,
- struct ptlrpc_request *req,
- union ptlrpc_async_args *aa, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
+ union ptlrpc_async_args *aa = args;
struct obd_import *imp = req->rq_import;
struct obd_statfs *msfs;
struct osp_device *d;
req->rq_request_portal = OST_CREATE_PORTAL;
ptlrpc_at_set_req_timeout(req);
- req->rq_interpret_reply = (ptlrpc_interpterer_t)osp_statfs_interpret;
+ req->rq_interpret_reply = osp_statfs_interpret;
aa = ptlrpc_req_async_args(req);
aa->pointer_arg[0] = d;
struct lu_buf *lb_oid = &oti->osi_lb;
struct lu_buf *lb_oseq = &oti->osi_lb2;
loff_t oid_off;
+ u64 oid;
loff_t oseq_off;
struct thandle *th;
int rc;
/* Note: through f_oid is only 32 bits, it will also write 64 bits
* for oid to keep compatibility with the previous version. */
- lb_oid->lb_buf = &fid->f_oid;
- lb_oid->lb_len = sizeof(u64);
- oid_off = sizeof(u64) * osp->opd_index;
+ oid = fid->f_oid;
+ osp_objid_buf_prep(lb_oid, &oid_off,
+ &oid, osp->opd_index);
- lb_oseq->lb_buf = &fid->f_seq;
- lb_oseq->lb_len = sizeof(u64);
- oseq_off = sizeof(u64) * osp->opd_index;
+ osp_objseq_buf_prep(lb_oseq, &oseq_off,
+ &fid->f_seq, osp->opd_index);
th = dt_trans_create(env, osp->opd_storage);
if (IS_ERR(th))
/* Update last_xxx to the new seq */
spin_lock(&osp->opd_pre_lock);
osp->opd_last_used_fid = *fid;
+ osp_fid_to_obdid(fid, &osp->opd_last_id);
osp->opd_gap_start_fid = *fid;
osp->opd_pre_used_fid = *fid;
osp->opd_pre_last_created_fid = *fid;
*fid = d->opd_pre_last_created_fid;
rc = osp_precreate_fids(env, d, fid, &grow);
- if (rc == 1) {
+ if (rc == 1)
/* Current seq has been used up*/
- if (!osp_is_fid_client(d)) {
- osp_pre_update_status(d, -ENOSPC);
- rc = -ENOSPC;
- }
- wake_up(&d->opd_pre_waitq);
- GOTO(out_req, rc);
- }
+ GOTO(out_req, rc = -ENOSPC);
if (!osp_is_fid_client(d)) {
/* Non-FID client will always send seq 0 because of
ready:
if (osp_fid_diff(fid, &d->opd_pre_used_fid) <= 0) {
- CERROR("%s: precreate fid "DFID" < local used fid "DFID
+ CERROR("%s: precreate fid "DFID" <= local used fid "DFID
": rc = %d\n", d->opd_obd->obd_name,
PFID(fid), PFID(&d->opd_pre_used_fid), -ESTALE);
GOTO(out_req, rc = -ESTALE);
else if (msfs->os_ffree > 64)
msfs->os_state &= ~OS_STATE_ENOINO;
+ CDEBUG(D_INFO, "%s: status: %llu blocks, %llu "
+ "free, %llu avail, %llu MB avail, %u "
+ "hwm -> %d: rc = %d\n",
+ d->opd_obd->obd_name, msfs->os_blocks,
+ msfs->os_bfree, msfs->os_bavail,
+ available, d->opd_reserved_mb_high,
+ d->opd_pre_status, rc);
if (available < d->opd_reserved_mb_low)
msfs->os_state |= OS_STATE_ENOSPC;
else if (available > d->opd_reserved_mb_high)
*/
rc = osp_precreate_cleanup_orphans(&env, d);
if (rc != 0) {
- schedule_timeout_interruptible(
- msecs_to_jiffies(MSEC_PER_SEC));
+ schedule_timeout_interruptible(cfs_time_seconds(1));
continue;
}
}
if (atomic_read(&d->opd_sync_changes) && synced == 0) {
/* force local commit to release space */
dt_commit_async(env, d->opd_storage);
- osp_sync_force(env, d);
+ osp_sync_check_for_work(d);
synced = 1;
}
if (atomic_read(&d->opd_sync_rpcs_in_progress)) {
if (req == NULL)
RETURN(-ENOMEM);
- /* XXX: capa support? */
- /* osc_set_capa_size(req, &RMF_CAPA1, capa); */
rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_PUNCH);
if (rc) {
ptlrpc_request_free(req);
d->opd_pre_used_fid.f_oid = 1;
fid_zero(&d->opd_pre_last_created_fid);
d->opd_pre_last_created_fid.f_oid = 1;
+ d->opd_last_id = 0;
d->opd_pre_reserved = 0;
d->opd_got_disconnected = 1;
d->opd_pre_create_slow = 0;