*/
static void osc_lock_detach(const struct lu_env *env, struct osc_lock *olck)
{
- struct ldlm_lock *dlmlock;
+ struct ldlm_lock *dlmlock;
- cfs_spin_lock(&osc_ast_guard);
- dlmlock = olck->ols_lock;
- if (dlmlock == NULL) {
- cfs_spin_unlock(&osc_ast_guard);
+ spin_lock(&osc_ast_guard);
+ dlmlock = olck->ols_lock;
+ if (dlmlock == NULL) {
+ spin_unlock(&osc_ast_guard);
return;
}
* call to osc_lock_detach() */
dlmlock->l_ast_data = NULL;
olck->ols_handle.cookie = 0ULL;
- cfs_spin_unlock(&osc_ast_guard);
+ spin_unlock(&osc_ast_guard);
lock_res_and_lock(dlmlock);
if (dlmlock->l_granted_mode == dlmlock->l_req_mode) {
* Global spin-lock protecting consistency of ldlm_lock::l_ast_data
* pointers. Initialized in osc_init().
*/
-cfs_spinlock_t osc_ast_guard;
+spinlock_t osc_ast_guard;
static struct osc_lock *osc_ast_data_get(struct ldlm_lock *dlm_lock)
{
- struct osc_lock *olck;
+ struct osc_lock *olck;
- lock_res_and_lock(dlm_lock);
- cfs_spin_lock(&osc_ast_guard);
+ lock_res_and_lock(dlm_lock);
+ spin_lock(&osc_ast_guard);
olck = dlm_lock->l_ast_data;
if (olck != NULL) {
struct cl_lock *lock = olck->ols_cl.cls_lock;
} else
olck = NULL;
}
- cfs_spin_unlock(&osc_ast_guard);
- unlock_res_and_lock(dlm_lock);
- return olck;
+ spin_unlock(&osc_ast_guard);
+ unlock_res_and_lock(dlm_lock);
+ return olck;
}
static void osc_ast_data_put(const struct lu_env *env, struct osc_lock *olck)
LASSERT(dlmlock != NULL);
lock_res_and_lock(dlmlock);
- cfs_spin_lock(&osc_ast_guard);
- LASSERT(dlmlock->l_ast_data == olck);
- LASSERT(olck->ols_lock == NULL);
- olck->ols_lock = dlmlock;
- cfs_spin_unlock(&osc_ast_guard);
+ spin_lock(&osc_ast_guard);
+ LASSERT(dlmlock->l_ast_data == olck);
+ LASSERT(olck->ols_lock == NULL);
+ olck->ols_lock = dlmlock;
+ spin_unlock(&osc_ast_guard);
/*
* Lock might be not yet granted. In this case, completion ast
dlmlock = ldlm_handle2lock(&olck->ols_handle);
if (dlmlock != NULL) {
lock_res_and_lock(dlmlock);
- cfs_spin_lock(&osc_ast_guard);
- LASSERT(olck->ols_lock == NULL);
- dlmlock->l_ast_data = NULL;
- olck->ols_handle.cookie = 0ULL;
- cfs_spin_unlock(&osc_ast_guard);
+ spin_lock(&osc_ast_guard);
+ LASSERT(olck->ols_lock == NULL);
+ dlmlock->l_ast_data = NULL;
+ olck->ols_handle.cookie = 0ULL;
+ spin_unlock(&osc_ast_guard);
ldlm_lock_fail_match_locked(dlmlock);
unlock_res_and_lock(dlmlock);
LDLM_LOCK_PUT(dlmlock);
obj = lock->cll_descr.cld_obj;
result = cl_object_glimpse(env, obj, lvb);
}
+ if (!exp_connect_lvb_type(req->rq_export))
+ req_capsule_shrink(&req->rq_pill,
+ &RMF_DLM_LVB,
+ sizeof(struct ost_lvb_v1),
+ RCL_SERVER);
osc_ast_data_put(env, olck);
} else {
/*
if (olck->ols_glimpse)
return 0;
- cfs_spin_lock(&hdr->coh_lock_guard);
+ spin_lock(&hdr->coh_lock_guard);
cfs_list_for_each_entry(scan, &hdr->coh_locks, cll_linkage) {
struct cl_lock_descr *cld = &scan->cll_descr;
const struct osc_lock *scan_ols;
conflict = scan;
break;
}
- cfs_spin_unlock(&hdr->coh_lock_guard);
+ spin_unlock(&hdr->coh_lock_guard);
if (conflict) {
if (lock->cll_descr.cld_mode == CLM_GROUP) {
result = osc_cache_writeback_range(env, obj,
descr->cld_start, descr->cld_end,
1, discard);
- CDEBUG(D_DLMTRACE, "write out %d pages for lock %p.\n",
- result, lock);
+ LDLM_DEBUG(ols->ols_lock,
+ "lock %p: %d pages were %s.\n", lock, result,
+ discard ? "discarded" : "written");
if (result > 0)
result = 0;
}
lock = olck->ols_cl.cls_lock;
descr = &lock->cll_descr;
- cfs_mutex_lock(&oob->oo_debug_mutex);
+ mutex_lock(&oob->oo_debug_mutex);
io->ci_obj = cl_object_top(obj);
io->ci_ignore_layout = 1;
cfs_cond_resched();
} while (result != CLP_GANG_OKAY);
cl_io_fini(env, io);
- cfs_mutex_unlock(&oob->oo_debug_mutex);
+ mutex_unlock(&oob->oo_debug_mutex);
cl_env_nested_put(&nest, env);
return (result == CLP_GANG_ABORT);
if (clk->ols_locklessable && !(enqflags & CEF_DISCARD_DATA))
clk->ols_flags |= LDLM_FL_DENY_ON_CONTENTION;
+ LDLM_DEBUG_NOLOCK("lock %p, osc lock %p, flags %llx\n",
+ lock, clk, clk->ols_flags);
+
result = 0;
} else
result = -ENOMEM;
int osc_dlm_lock_pageref(struct ldlm_lock *dlm)
{
- struct osc_lock *olock;
- int rc = 0;
+ struct osc_lock *olock;
+ int rc = 0;
- cfs_spin_lock(&osc_ast_guard);
+ spin_lock(&osc_ast_guard);
olock = dlm->l_ast_data;
/*
* there's a very rare race with osc_page_addref_lock(), but that
cfs_atomic_sub(_PAGEREF_MAGIC, &olock->ols_pageref);
rc = 1;
}
- cfs_spin_unlock(&osc_ast_guard);
- return rc;
+ spin_unlock(&osc_ast_guard);
+ return rc;
}
/** @} osc */