X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fpack_generic.c;h=03515ca79929d7822a0777a3990a7158ae59bc0f;hb=1ae726743b5a051bb4daa731d93496a3e7f7a93c;hp=dd0a2535ea489db7743527c4fb47378d50f79032;hpb=8abb5a19e4375f194f3f7d304ad46ec7120e733f;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index dd0a253..03515ca 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -261,20 +261,21 @@ int lustre_pack_request(struct ptlrpc_request *req, __u32 magic, int count, EXPORT_SYMBOL(lustre_pack_request); #if RS_DEBUG -CFS_LIST_HEAD(ptlrpc_rs_debug_lru); +struct list_head ptlrpc_rs_debug_lru = + LIST_HEAD_INIT(ptlrpc_rs_debug_lru); spinlock_t ptlrpc_rs_debug_lock; #define PTLRPC_RS_DEBUG_LRU_ADD(rs) \ do { \ spin_lock(&ptlrpc_rs_debug_lock); \ - cfs_list_add_tail(&(rs)->rs_debug_list, &ptlrpc_rs_debug_lru); \ + list_add_tail(&(rs)->rs_debug_list, &ptlrpc_rs_debug_lru); \ spin_unlock(&ptlrpc_rs_debug_lock); \ } while (0) #define PTLRPC_RS_DEBUG_LRU_DEL(rs) \ do { \ spin_lock(&ptlrpc_rs_debug_lock); \ - cfs_list_del(&(rs)->rs_debug_list); \ + list_del(&(rs)->rs_debug_list); \ spin_unlock(&ptlrpc_rs_debug_lock); \ } while (0) #else @@ -290,7 +291,7 @@ lustre_get_emerg_rs(struct ptlrpc_service_part *svcpt) spin_lock(&svcpt->scp_rep_lock); /* See if we have anything in a pool, and wait if nothing */ - while (cfs_list_empty(&svcpt->scp_rep_idle)) { + while (list_empty(&svcpt->scp_rep_idle)) { struct l_wait_info lwi; int rc; @@ -299,15 +300,15 @@ lustre_get_emerg_rs(struct ptlrpc_service_part *svcpt) * bail out instead of waiting infinitely */ lwi = LWI_TIMEOUT(cfs_time_seconds(10), NULL, NULL); rc = l_wait_event(svcpt->scp_rep_waitq, - !cfs_list_empty(&svcpt->scp_rep_idle), &lwi); + !list_empty(&svcpt->scp_rep_idle), &lwi); if (rc != 0) goto out; spin_lock(&svcpt->scp_rep_lock); } - rs = cfs_list_entry(svcpt->scp_rep_idle.next, + rs = list_entry(svcpt->scp_rep_idle.next, struct ptlrpc_reply_state, rs_list); - cfs_list_del(&rs->rs_list); + list_del(&rs->rs_list); spin_unlock(&svcpt->scp_rep_lock); @@ -324,7 +325,7 @@ void lustre_put_emerg_rs(struct ptlrpc_reply_state *rs) struct ptlrpc_service_part *svcpt = rs->rs_svcpt; spin_lock(&svcpt->scp_rep_lock); - cfs_list_add(&rs->rs_list, &svcpt->scp_rep_idle); + list_add(&rs->rs_list, &svcpt->scp_rep_idle); spin_unlock(&svcpt->scp_rep_lock); wake_up(&svcpt->scp_rep_waitq); } @@ -349,14 +350,14 @@ int lustre_pack_reply_v2(struct ptlrpc_request *req, int count, if (rc) RETURN(rc); - rs = req->rq_reply_state; - cfs_atomic_set(&rs->rs_refcount, 1); /* 1 ref for rq_reply_state */ - rs->rs_cb_id.cbid_fn = reply_out_callback; - rs->rs_cb_id.cbid_arg = rs; + rs = req->rq_reply_state; + atomic_set(&rs->rs_refcount, 1); /* 1 ref for rq_reply_state */ + rs->rs_cb_id.cbid_fn = reply_out_callback; + rs->rs_cb_id.cbid_arg = rs; rs->rs_svcpt = req->rq_rqbd->rqbd_svcpt; - CFS_INIT_LIST_HEAD(&rs->rs_exp_list); - CFS_INIT_LIST_HEAD(&rs->rs_obd_list); - CFS_INIT_LIST_HEAD(&rs->rs_list); + INIT_LIST_HEAD(&rs->rs_exp_list); + INIT_LIST_HEAD(&rs->rs_obd_list); + INIT_LIST_HEAD(&rs->rs_list); spin_lock_init(&rs->rs_lock); req->rq_replen = msg_len; @@ -511,18 +512,18 @@ EXPORT_SYMBOL(lustre_shrink_msg); void lustre_free_reply_state(struct ptlrpc_reply_state *rs) { - PTLRPC_RS_DEBUG_LRU_DEL(rs); + PTLRPC_RS_DEBUG_LRU_DEL(rs); - LASSERT (cfs_atomic_read(&rs->rs_refcount) == 0); - LASSERT (!rs->rs_difficult || rs->rs_handled); - LASSERT (!rs->rs_on_net); - LASSERT (!rs->rs_scheduled); - LASSERT (rs->rs_export == NULL); - LASSERT (rs->rs_nlocks == 0); - LASSERT (cfs_list_empty(&rs->rs_exp_list)); - LASSERT (cfs_list_empty(&rs->rs_obd_list)); + LASSERT(atomic_read(&rs->rs_refcount) == 0); + LASSERT(!rs->rs_difficult || rs->rs_handled); + LASSERT(!rs->rs_on_net); + LASSERT(!rs->rs_scheduled); + LASSERT(rs->rs_export == NULL); + LASSERT(rs->rs_nlocks == 0); + LASSERT(list_empty(&rs->rs_exp_list)); + LASSERT(list_empty(&rs->rs_obd_list)); - sptlrpc_svc_free_rs(rs); + sptlrpc_svc_free_rs(rs); } EXPORT_SYMBOL(lustre_free_reply_state); @@ -1798,11 +1799,11 @@ void lustre_swab_obd_ioobj(struct obd_ioobj *ioo) } EXPORT_SYMBOL(lustre_swab_obd_ioobj); -void lustre_swab_niobuf_remote (struct niobuf_remote *nbr) +void lustre_swab_niobuf_remote(struct niobuf_remote *nbr) { - __swab64s (&nbr->offset); - __swab32s (&nbr->len); - __swab32s (&nbr->flags); + __swab64s(&nbr->rnb_offset); + __swab32s(&nbr->rnb_len); + __swab32s(&nbr->rnb_flags); } EXPORT_SYMBOL(lustre_swab_niobuf_remote); @@ -1871,35 +1872,35 @@ EXPORT_SYMBOL(lustre_swab_lquota_lvb); void lustre_swab_mdt_body (struct mdt_body *b) { - lustre_swab_lu_fid(&b->fid1); - lustre_swab_lu_fid(&b->fid2); + lustre_swab_lu_fid(&b->mbo_fid1); + lustre_swab_lu_fid(&b->mbo_fid2); /* handle is opaque */ - __swab64s(&b->valid); - __swab64s(&b->size); - __swab64s(&b->mtime); - __swab64s(&b->atime); - __swab64s(&b->ctime); - __swab64s(&b->blocks); - __swab64s(&b->ioepoch); - __swab64s(&b->t_state); - __swab32s(&b->fsuid); - __swab32s(&b->fsgid); - __swab32s(&b->capability); - __swab32s(&b->mode); - __swab32s(&b->uid); - __swab32s(&b->gid); - __swab32s(&b->flags); - __swab32s(&b->rdev); - __swab32s(&b->nlink); - CLASSERT(offsetof(typeof(*b), unused2) != 0); - __swab32s(&b->suppgid); - __swab32s(&b->eadatasize); - __swab32s(&b->aclsize); - __swab32s(&b->max_mdsize); - __swab32s(&b->max_cookiesize); - __swab32s(&b->uid_h); - __swab32s(&b->gid_h); - CLASSERT(offsetof(typeof(*b), padding_5) != 0); + __swab64s(&b->mbo_valid); + __swab64s(&b->mbo_size); + __swab64s(&b->mbo_mtime); + __swab64s(&b->mbo_atime); + __swab64s(&b->mbo_ctime); + __swab64s(&b->mbo_blocks); + __swab64s(&b->mbo_ioepoch); + __swab64s(&b->mbo_t_state); + __swab32s(&b->mbo_fsuid); + __swab32s(&b->mbo_fsgid); + __swab32s(&b->mbo_capability); + __swab32s(&b->mbo_mode); + __swab32s(&b->mbo_uid); + __swab32s(&b->mbo_gid); + __swab32s(&b->mbo_flags); + __swab32s(&b->mbo_rdev); + __swab32s(&b->mbo_nlink); + CLASSERT(offsetof(typeof(*b), mbo_unused2) != 0); + __swab32s(&b->mbo_suppgid); + __swab32s(&b->mbo_eadatasize); + __swab32s(&b->mbo_aclsize); + __swab32s(&b->mbo_max_mdsize); + __swab32s(&b->mbo_max_cookiesize); + __swab32s(&b->mbo_uid_h); + __swab32s(&b->mbo_gid_h); + CLASSERT(offsetof(typeof(*b), mbo_padding_5) != 0); } EXPORT_SYMBOL(lustre_swab_mdt_body); @@ -2145,22 +2146,16 @@ void lustre_swab_lmv_mds_md(union lmv_mds_md *lmm) break; } } +EXPORT_SYMBOL(lustre_swab_lmv_mds_md); void lustre_swab_lmv_user_md(struct lmv_user_md *lum) { - int i; - __swab32s(&lum->lum_magic); __swab32s(&lum->lum_stripe_count); __swab32s(&lum->lum_stripe_offset); __swab32s(&lum->lum_hash_type); __swab32s(&lum->lum_type); CLASSERT(offsetof(typeof(*lum), lum_padding1) != 0); - for (i = 0; i < lum->lum_stripe_count; i++) { - __swab32s(&lum->lum_objects[i].lum_mds); - lustre_swab_lu_fid(&lum->lum_objects[i].lum_fid); - } - } EXPORT_SYMBOL(lustre_swab_lmv_user_md); @@ -2330,8 +2325,8 @@ EXPORT_SYMBOL(dump_ioo); void dump_rniobuf(struct niobuf_remote *nb) { - CDEBUG(D_RPCTRACE, "niobuf_remote: offset="LPU64", len=%d, flags=%x\n", - nb->offset, nb->len, nb->flags); + CDEBUG(D_RPCTRACE, "niobuf_remote: offset="LPU64", len=%d, flags=%x\n", + nb->rnb_offset, nb->rnb_len, nb->rnb_flags); } EXPORT_SYMBOL(dump_rniobuf); @@ -2457,30 +2452,30 @@ void _debug_req(struct ptlrpc_request *req, else if (req->rq_export && req->rq_export->exp_connection) nid = req->rq_export->exp_connection->c_peer.nid; - va_start(args, fmt); - libcfs_debug_vmsg2(msgdata, fmt, args, - " req@%p x"LPU64"/t"LPD64"("LPD64") o%d->%s@%s:%d/%d" - " lens %d/%d e %d to %d dl "CFS_TIME_T" ref %d " - "fl "REQ_FLAGS_FMT"/%x/%x rc %d/%d\n", - req, req->rq_xid, req->rq_transno, - req_ok ? lustre_msg_get_transno(req->rq_reqmsg) : 0, - req_ok ? lustre_msg_get_opc(req->rq_reqmsg) : -1, - req->rq_import ? - req->rq_import->imp_obd->obd_name : - req->rq_export ? - req->rq_export->exp_client_uuid.uuid : - "", - libcfs_nid2str(nid), - req->rq_request_portal, req->rq_reply_portal, - req->rq_reqlen, req->rq_replen, - req->rq_early_count, req->rq_timedout, - req->rq_deadline, - cfs_atomic_read(&req->rq_refcount), - DEBUG_REQ_FLAGS(req), - req_ok ? lustre_msg_get_flags(req->rq_reqmsg) : -1, - rep_ok ? lustre_msg_get_flags(req->rq_repmsg) : -1, - req->rq_status, - rep_ok ? lustre_msg_get_status(req->rq_repmsg) : -1); + va_start(args, fmt); + libcfs_debug_vmsg2(msgdata, fmt, args, + " req@%p x"LPU64"/t"LPD64"("LPD64") o%d->%s@%s:%d/%d" + " lens %d/%d e %d to %d dl "CFS_TIME_T" ref %d " + "fl "REQ_FLAGS_FMT"/%x/%x rc %d/%d\n", + req, req->rq_xid, req->rq_transno, + req_ok ? lustre_msg_get_transno(req->rq_reqmsg) : 0, + req_ok ? lustre_msg_get_opc(req->rq_reqmsg) : -1, + req->rq_import ? + req->rq_import->imp_obd->obd_name : + req->rq_export ? + req->rq_export->exp_client_uuid.uuid : + "", + libcfs_nid2str(nid), + req->rq_request_portal, req->rq_reply_portal, + req->rq_reqlen, req->rq_replen, + req->rq_early_count, req->rq_timedout, + req->rq_deadline, + atomic_read(&req->rq_refcount), + DEBUG_REQ_FLAGS(req), + req_ok ? lustre_msg_get_flags(req->rq_reqmsg) : -1, + rep_ok ? lustre_msg_get_flags(req->rq_repmsg) : -1, + req->rq_status, + rep_ok ? lustre_msg_get_status(req->rq_repmsg) : -1); va_end(args); } EXPORT_SYMBOL(_debug_req); @@ -2666,6 +2661,8 @@ void lustre_swab_lfsck_request(struct lfsck_request *lr) __swab16s(&lr->lr_async_windows); CLASSERT(offsetof(typeof(*lr), lr_padding_1) != 0); lustre_swab_lu_fid(&lr->lr_fid); + lustre_swab_lu_fid(&lr->lr_fid2); + lustre_swab_lu_fid(&lr->lr_fid3); CLASSERT(offsetof(typeof(*lr), lr_padding_2) != 0); CLASSERT(offsetof(typeof(*lr), lr_padding_3) != 0); }