* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
struct osc_async_cbargs *args = a;
args->opc_rc = rc;
- cfs_complete(&args->opc_sync);
+ complete(&args->opc_sync);
return 0;
}
oinfo.oi_oa = oa;
oinfo.oi_capa = io->u.ci_setattr.sa_capa;
- cfs_init_completion(&cbargs->opc_sync);
+ init_completion(&cbargs->opc_sync);
if (ia_valid & ATTR_SIZE)
result = osc_punch_base(osc_export(cl2osc(obj)),
&oinfo, NULL,
osc_async_upcall,
cbargs, PTLRPCD_SET);
+ cbargs->opc_rpc_sent = result == 0;
}
return result;
}
struct osc_io *oio = cl2osc_io(env, slice);
struct cl_object *obj = slice->cis_obj;
struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
- int result;
-
- cfs_wait_for_completion(&cbargs->opc_sync);
+ int result = 0;
- result = io->ci_result = cbargs->opc_rc;
+ if (cbargs->opc_rpc_sent) {
+ wait_for_completion(&cbargs->opc_sync);
+ result = io->ci_result = cbargs->opc_rc;
+ }
if (result == 0) {
if (oio->oi_lockless) {
/* lockless truncate */
memset(oinfo, 0, sizeof(*oinfo));
oinfo->oi_oa = oa;
oinfo->oi_capa = fio->fi_capa;
- cfs_init_completion(&cbargs->opc_sync);
+ init_completion(&cbargs->opc_sync);
rc = osc_sync_base(osc_export(obj), oinfo, osc_async_upcall, cbargs,
PTLRPCD_SET);
struct osc_io *oio = cl2osc_io(env, slice);
struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
- cfs_wait_for_completion(&cbargs->opc_sync);
+ wait_for_completion(&cbargs->opc_sync);
if (result == 0)
result = cbargs->opc_rc;
}