struct osc_object *osc = cl2osc(ios->cis_obj);
struct client_obd *cli = osc_cli(osc);
unsigned long c;
- unsigned int npages;
- unsigned int max_pages;
+ unsigned long npages;
+ unsigned long max_pages;
ENTRY;
if (cl_io_is_append(io))
if (npages > max_pages)
npages = max_pages;
- c = atomic_read(cli->cl_lru_left);
+ c = atomic_long_read(cli->cl_lru_left);
if (c < npages && osc_lru_reclaim(cli) > 0)
- c = atomic_read(cli->cl_lru_left);
+ c = atomic_long_read(cli->cl_lru_left);
while (c >= npages) {
- if (c == atomic_cmpxchg(cli->cl_lru_left, c, c - npages)) {
+ if (c == atomic_long_cmpxchg(cli->cl_lru_left, c, c - npages)) {
oio->oi_lru_reserved = npages;
break;
}
- c = atomic_read(cli->cl_lru_left);
+ c = atomic_long_read(cli->cl_lru_left);
}
RETURN(0);
struct client_obd *cli = osc_cli(osc);
if (oio->oi_lru_reserved > 0) {
- atomic_add(oio->oi_lru_reserved, cli->cl_lru_left);
+ atomic_long_add(oio->oi_lru_reserved, cli->cl_lru_left);
oio->oi_lru_reserved = 0;
}
}
return 0;
}
-#if defined(__KERNEL__)
/**
* Checks that there are no pages being written in the extent being truncated.
*/
CL_PAGE_DEBUG(D_ERROR, env, page, "exists " LPU64 "/%s.\n",
start, current->comm);
-#ifdef __linux__
if (PageLocked(page->cp_vmpage))
CDEBUG(D_CACHE, "page %p index %lu locked for %d.\n",
ops, osc_index(ops), oap->oap_cmd & OBD_BRW_RWMASK);
-#endif
return CLP_GANG_OKAY;
}
start + partial, CL_PAGE_EOF,
trunc_check_cb, (void *)&size);
}
-#else /* __KERNEL__ */
-static void osc_trunc_check(const struct lu_env *env, struct cl_io *io,
- struct osc_io *oio, __u64 size)
-{
- return;
-}
-#endif
static int osc_io_setattr_start(const struct lu_env *env,
const struct cl_io_slice *slice)
int result = 0;
if (cbargs->opc_rpc_sent) {
- result = wait_for_completion_killable(&cbargs->opc_sync);
- if (result == 0)
- result = cbargs->opc_rc;
- io->ci_result = result;
+ wait_for_completion(&cbargs->opc_sync);
+ result = io->ci_result = cbargs->opc_rc;
}
if (result == 0) {
if (oio->oi_lockless) {
struct osc_io *oio = cl2osc_io(env, slice);
struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
- result = wait_for_completion_killable(&cbargs->opc_sync);
+ wait_for_completion(&cbargs->opc_sync);
if (result == 0)
result = cbargs->opc_rc;
}