b=15981
i=adilger
i=rread
#else
char debug_file_path[1024] = "/tmp/lustre-log";
#endif
#else
char debug_file_path[1024] = "/tmp/lustre-log";
#endif
-CFS_MODULE_PARM(debug_file_path, "s", charp, 0644,
+char *debug_file_path_p = &debug_file_path[0];
+
+CFS_MODULE_PARM(debug_file_path_p, "s", charp, 0644,
"Path for dumping debug logs, "
"set 'NONE' to prevent log dumping");
"Path for dumping debug logs, "
"set 'NONE' to prevent log dumping");
#define OST_MAXREQSIZE (5 * 1024)
#define OST_MAXREPSIZE (9 * 1024)
#define OST_MAXREQSIZE (5 * 1024)
#define OST_MAXREPSIZE (9 * 1024)
+/* Macro to hide a typecast. */
+#define ptlrpc_req_async_args(req) ((void *)&req->rq_async_args)
+
struct ptlrpc_connection {
struct list_head c_link;
struct hlist_node c_hash;
struct ptlrpc_connection {
struct list_head c_link;
struct hlist_node c_hash;
atomic_inc(&req->rq_import->imp_replay_inflight);
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
atomic_inc(&req->rq_import->imp_replay_inflight);
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
- aa = (struct ldlm_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
aa->lock_handle = body->lock_handle[0];
req->rq_interpret_reply = replay_lock_interpret;
ptlrpcd_add_req(req);
aa->lock_handle = body->lock_handle[0];
req->rq_interpret_reply = replay_lock_interpret;
ptlrpcd_add_req(req);
- obd_free_memmd(exp, (struct lov_stripe_md **)&md.mea);
+ /* XXX LOV STACKING */
+ obd_free_memmd(exp, (void *)&md.mea);
struct lmv_obd *lmv = &obd->u.lmv;
ENTRY;
struct lmv_obd *lmv = &obd->u.lmv;
ENTRY;
+
+ /* XXX LOV STACKING */
- obd_free_memmd(exp, (struct lov_stripe_md**)&md->mea);
+ obd_free_memmd(exp, (void *)&md->mea);
RETURN(md_free_lustre_md(lmv->tgts[0].ltd_exp, md));
}
RETURN(md_free_lustre_md(lmv->tgts[0].ltd_exp, md));
}
PFID(fid));
GOTO(cleanup, obj = ERR_PTR(-ENOMEM));
}
PFID(fid));
GOTO(cleanup, obj = ERR_PTR(-ENOMEM));
}
+
+ /* XXX LOV STACKING */
- obd_free_memmd(exp, (struct lov_stripe_md **)&md.mea);
+ obd_free_memmd(exp, (void *)&md.mea);
LDLM_LOCK_PUT(lock);
rc = 0;
} else {
LDLM_LOCK_PUT(lock);
rc = 0;
} else {
- struct md_attr *ma = &info->mti_attr;
+ ma = &info->mti_attr;
+
mdt_lock_handle_init(lhc);
mdt_lock_reg_init(lhc, LCK_PR);
mdt_lock_handle_init(lhc);
mdt_lock_reg_init(lhc, LCK_PR);
lock = ldlm_handle2lock(&lhc->mlh_reg_lh);
if (lock) {
struct mdt_body *repbody;
lock = ldlm_handle2lock(&lhc->mlh_reg_lh);
if (lock) {
struct mdt_body *repbody;
/* Debugging code. */
res_id = &lock->l_resource->lr_name;
/* Debugging code. */
res_id = &lock->l_resource->lr_name;
*/
repbody = req_capsule_server_get(info->mti_pill,
&RMF_MDT_BODY);
*/
repbody = req_capsule_server_get(info->mti_pill,
&RMF_MDT_BODY);
- ma = &info->mti_attr.ma_attr;
if (lock->l_policy_data.l_inodebits.bits &
MDS_INODELOCK_UPDATE)
mdt_pack_size2body(info, child);
if (lock->l_policy_data.l_inodebits.bits &
MDS_INODELOCK_UPDATE)
mdt_pack_size2body(info, child);
#else
static int mea_hash_segment(int count, char *name, int namelen)
{
#else
static int mea_hash_segment(int count, char *name, int namelen)
{
-#warning "fix for liblustre"
req->rq_interpret_reply = osc_getattr_interpret;
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
req->rq_interpret_reply = osc_getattr_interpret;
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
- aa = (struct osc_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
aa->aa_oi = oinfo;
ptlrpc_set_add_req(set, req);
aa->aa_oi = oinfo;
ptlrpc_set_add_req(set, req);
req->rq_interpret_reply = osc_setattr_interpret;
CLASSERT (sizeof(*aa) <= sizeof(req->rq_async_args));
req->rq_interpret_reply = osc_setattr_interpret;
CLASSERT (sizeof(*aa) <= sizeof(req->rq_async_args));
- aa = (struct osc_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
aa->aa_oi = oinfo;
ptlrpc_set_add_req(rqset, req);
aa->aa_oi = oinfo;
ptlrpc_set_add_req(rqset, req);
req->rq_interpret_reply = osc_punch_interpret;
CLASSERT (sizeof(*aa) <= sizeof(req->rq_async_args));
req->rq_interpret_reply = osc_punch_interpret;
CLASSERT (sizeof(*aa) <= sizeof(req->rq_async_args));
- aa = (struct osc_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
aa->aa_oi = oinfo;
ptlrpc_set_add_req(rqset, req);
aa->aa_oi = oinfo;
ptlrpc_set_add_req(rqset, req);
ptlrpc_request_set_replen(req);
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
ptlrpc_request_set_replen(req);
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
- aa = (struct osc_brw_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
aa->aa_oa = oa;
aa->aa_requested_nob = requested_nob;
aa->aa_nio_count = niocount;
aa->aa_oa = oa;
aa->aa_requested_nob = requested_nob;
aa->aa_nio_count = niocount;
new_req->rq_async_args = request->rq_async_args;
new_req->rq_sent = cfs_time_current_sec() + aa->aa_resends;
new_req->rq_async_args = request->rq_async_args;
new_req->rq_sent = cfs_time_current_sec() + aa->aa_resends;
- new_aa = (struct osc_brw_async_args *)&new_req->rq_async_args;
+ new_aa = ptlrpc_req_async_args(new_req);
CFS_INIT_LIST_HEAD(&new_aa->aa_oaps);
list_splice(&aa->aa_oaps, &new_aa->aa_oaps);
CFS_INIT_LIST_HEAD(&new_aa->aa_oaps);
list_splice(&aa->aa_oaps, &new_aa->aa_oaps);
rc = osc_brw_prep_request(cmd, cli, oa, lsm, page_count, pga,
&req, ocapa);
rc = osc_brw_prep_request(cmd, cli, oa, lsm, page_count, pga,
&req, ocapa);
- aa = (struct osc_brw_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
if (cmd == OBD_BRW_READ) {
lprocfs_oh_tally_log2(&cli->cl_read_page_hist, page_count);
lprocfs_oh_tally(&cli->cl_read_rpc_hist, cli->cl_r_in_flight);
if (cmd == OBD_BRW_READ) {
lprocfs_oh_tally_log2(&cli->cl_read_page_hist, page_count);
lprocfs_oh_tally(&cli->cl_read_rpc_hist, cli->cl_r_in_flight);
OBD_MD_FLMTIME | OBD_MD_FLCTIME | OBD_MD_FLATIME);
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
OBD_MD_FLMTIME | OBD_MD_FLCTIME | OBD_MD_FLATIME);
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
- aa = (struct osc_brw_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
CFS_INIT_LIST_HEAD(&aa->aa_oaps);
list_splice(rpc_list, &aa->aa_oaps);
CFS_INIT_LIST_HEAD(rpc_list);
CFS_INIT_LIST_HEAD(&aa->aa_oaps);
list_splice(rpc_list, &aa->aa_oaps);
CFS_INIT_LIST_HEAD(rpc_list);
- aa = (struct osc_brw_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
if (cmd == OBD_BRW_READ) {
lprocfs_oh_tally_log2(&cli->cl_read_page_hist, page_count);
if (cmd == OBD_BRW_READ) {
lprocfs_oh_tally_log2(&cli->cl_read_page_hist, page_count);
if (!rc) {
struct osc_enqueue_args *aa;
CLASSERT (sizeof(*aa) <= sizeof(req->rq_async_args));
if (!rc) {
struct osc_enqueue_args *aa;
CLASSERT (sizeof(*aa) <= sizeof(req->rq_async_args));
- aa = (struct osc_enqueue_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
aa->oa_oi = oinfo;
aa->oa_ei = einfo;
aa->oa_exp = exp;
aa->oa_oi = oinfo;
aa->oa_ei = einfo;
aa->oa_exp = exp;
req->rq_interpret_reply = osc_statfs_interpret;
CLASSERT (sizeof(*aa) <= sizeof(req->rq_async_args));
req->rq_interpret_reply = osc_statfs_interpret;
CLASSERT (sizeof(*aa) <= sizeof(req->rq_async_args));
- aa = (struct osc_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
aa->aa_oi = oinfo;
ptlrpc_set_add_req(rqset, req);
aa->aa_oi = oinfo;
ptlrpc_set_add_req(rqset, req);
LASSERT(req->rq_bulk == NULL);
LASSERT (sizeof (*aa) <= sizeof (req->rq_async_args));
LASSERT(req->rq_bulk == NULL);
LASSERT (sizeof (*aa) <= sizeof (req->rq_async_args));
- aa = (struct ptlrpc_replay_async_args *)&req->rq_async_args;
+ aa = ptlrpc_req_async_args(req);
memset(aa, 0, sizeof *aa);
/* Prepare request to be resent with ptlrpcd */
memset(aa, 0, sizeof *aa);
/* Prepare request to be resent with ptlrpcd */
request->rq_interpret_reply = ptlrpc_connect_interpret;
CLASSERT(sizeof (*aa) <= sizeof (request->rq_async_args));
request->rq_interpret_reply = ptlrpc_connect_interpret;
CLASSERT(sizeof (*aa) <= sizeof (request->rq_async_args));
- aa = (struct ptlrpc_connect_async_args *)&request->rq_async_args;
+ aa = ptlrpc_req_async_args(request);
memset(aa, 0, sizeof *aa);
aa->pcaa_peer_committed = committed_before_reconnect;
memset(aa, 0, sizeof *aa);
aa->pcaa_peer_committed = committed_before_reconnect;