Whamcloud - gitweb
LU-9859 libcfs: deprecate libcfs_debug_vmsg2 24/35224/4
authorNeilBrown <neilb@suse.com>
Fri, 14 Jun 2019 01:56:34 +0000 (21:56 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Jun 2019 01:55:44 +0000 (01:55 +0000)
Since 2.6.36, Linux' vsprintf has supported %pV
which supports "recursive sprintf" - exactly the task
that libcfs_debug_vmsg2 aims to provide.

Instead of calling libcfs_debug_vmsg2(), we can put the fmt and
args in a 'struct va_format', and pass the address of that structure
to the "%pV" format.

So do this to remove all users of libcfs_debug_vmsg2().

Linux-commit: 0fe922e1eca8e2850f0e6c535a14ba7414ca73c2

Change-Id: I6952ca8fdb619423639734aab1a30f4635b089cc
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-on: https://review.whamcloud.com/35224
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
contrib/scripts/spelling.txt
lnet/klnds/gnilnd/gnilnd_debug.c
lustre/ldlm/ldlm_lock.c
lustre/ptlrpc/pack_generic.c
lustre/quota/lquota_entry.c
lustre/quota/lquota_internal.h
lustre/quota/qmt_entry.c
lustre/quota/qsd_entry.c

index 6e07a89..9d9da6c 100644 (file)
@@ -1,6 +1,7 @@
 # The format of each line is:
 # mistake||correction
 #
+libcfs_debug_vmsg2|libcfs_debug_msg
 alloca||malloc
 cfs_atomic_add||atomic_add
 cfs_atomic_add_return||atomic_add_return
index effa86c..00f3c0f 100644 (file)
@@ -25,16 +25,20 @@ void
 _kgnilnd_debug_msg(kgn_msg_t *msg, struct libcfs_debug_msg_data *msgdata,
                   const char *fmt, ...)
 {
+       struct va_format vaf;
        va_list args;
 
        va_start(args, fmt);
+       vaf.fmt = fmt;
+       vaf.va = &args;
+
        /* XXX Nic TBD: add handling of gnm_u ? */
-       libcfs_debug_vmsg2(msgdata, fmt, args,
-                          " msg@0x%p m/v/ty/ck/pck/pl %08x/%d/%d/%x/%x/%d x%d:%s\n",
-                          msg, msg->gnm_magic, msg->gnm_version, msg->gnm_type,
-                          msg->gnm_cksum, msg->gnm_payload_cksum,
-                          msg->gnm_payload_len, msg->gnm_seq,
-                          kgnilnd_msgtype2str(msg->gnm_type));
+       libcfs_debug_msg(msgdata,
+                        "%pV msg@0x%p m/v/ty/ck/pck/pl %08x/%d/%d/%x/%x/%d x%d:%s\n",
+                        &vaf, msg, msg->gnm_magic, msg->gnm_version,
+                        msg->gnm_type, msg->gnm_cksum, msg->gnm_payload_cksum,
+                        msg->gnm_payload_len, msg->gnm_seq,
+                        kgnilnd_msgtype2str(msg->gnm_type));
        va_end(args);
 }
 
@@ -42,30 +46,31 @@ void
 _kgnilnd_debug_conn(kgn_conn_t *conn, struct libcfs_debug_msg_data *msgdata,
                    const char *fmt, ...)
 {
+       struct va_format vaf;
        va_list args;
 
        va_start(args, fmt);
-       libcfs_debug_vmsg2(msgdata, fmt, args,
-               " conn@0x%p->%s:%s cq %u, to %ds, "
-               " RX %d @ %lu/%lus; TX %d @ %lus/%lus; "
-               " NOOP %lus/%lu/%lus; sched %lus/%lus/%lus ago \n",
-               conn, conn->gnc_peer ? libcfs_nid2str(conn->gnc_peer->gnp_nid) :
-               "<?>", kgnilnd_conn_state2str(conn),
-               conn->gnc_cqid, conn->gnc_timeout,
-               atomic_read(&conn->gnc_rx_seq),
-               cfs_duration_sec(jiffies - conn->gnc_last_rx),
-               cfs_duration_sec(jiffies - conn->gnc_last_rx_cq),
-               atomic_read(&conn->gnc_tx_seq),
-               cfs_duration_sec(jiffies - conn->gnc_last_tx),
-               cfs_duration_sec(jiffies - conn->gnc_last_tx_cq),
-               cfs_duration_sec(jiffies - conn->gnc_last_noop_want),
-               cfs_duration_sec(jiffies - conn->gnc_last_noop_sent),
-               cfs_duration_sec(jiffies - conn->gnc_last_noop_cq),
-               cfs_duration_sec(jiffies - conn->gnc_last_sched_ask),
-               cfs_duration_sec(jiffies - conn->gnc_last_sched_do),
-               cfs_duration_sec(jiffies - conn->gnc_device->gnd_sched_alive));
-
+       vaf.fmt = fmt;
+       vaf.va = &args;
 
+       libcfs_debug_msg(msgdata,
+                        "%pV conn@0x%p->%s:%s cq %u, to %ds,  RX %d @ %lu/%lus; TX %d @ %lus/%lus;  NOOP %lus/%lu/%lus; sched %lus/%lus/%lus ago \n",
+                        &vaf, conn,
+                        conn->gnc_peer ? libcfs_nid2str(conn->gnc_peer->gnp_nid) :
+                        "<?>", kgnilnd_conn_state2str(conn),
+                        conn->gnc_cqid, conn->gnc_timeout,
+                        atomic_read(&conn->gnc_rx_seq),
+                        cfs_duration_sec(jiffies - conn->gnc_last_rx),
+                        cfs_duration_sec(jiffies - conn->gnc_last_rx_cq),
+                        atomic_read(&conn->gnc_tx_seq),
+                        cfs_duration_sec(jiffies - conn->gnc_last_tx),
+                        cfs_duration_sec(jiffies - conn->gnc_last_tx_cq),
+                        cfs_duration_sec(jiffies - conn->gnc_last_noop_want),
+                        cfs_duration_sec(jiffies - conn->gnc_last_noop_sent),
+                        cfs_duration_sec(jiffies - conn->gnc_last_noop_cq),
+                        cfs_duration_sec(jiffies - conn->gnc_last_sched_ask),
+                        cfs_duration_sec(jiffies - conn->gnc_last_sched_do),
+                        cfs_duration_sec(jiffies - conn->gnc_device->gnd_sched_alive));
        va_end(args);
 }
 
@@ -75,6 +80,7 @@ _kgnilnd_debug_tx(kgn_tx_t *tx, struct libcfs_debug_msg_data *msgdata,
 {
        kgn_tx_ev_id_t  *id   = &tx->tx_id;
        char            *nid = "<?>";
+       struct va_format vaf;
        va_list          args;
 
        if (tx->tx_conn && tx->tx_conn->gnc_peer) {
@@ -82,16 +88,18 @@ _kgnilnd_debug_tx(kgn_tx_t *tx, struct libcfs_debug_msg_data *msgdata,
        }
 
        va_start(args, fmt);
-       libcfs_debug_vmsg2(msgdata, fmt, args,
-               " tx@0x%p->%s id %#llx"
-               "/%u/%d:%d msg %x/%s/%d x%d q %s@%lds->0x%p f %x re %d\n",
-               tx, nid, id->txe_cookie, id->txe_smsg_id, id->txe_cqid,
-               id->txe_idx, tx->tx_msg.gnm_type,
-               kgnilnd_msgtype2str(tx->tx_msg.gnm_type), tx->tx_buftype,
-               tx->tx_msg.gnm_seq,
-               kgnilnd_tx_state2str(tx->tx_list_state),
-               cfs_duration_sec((long)jiffies - tx->tx_qtime), tx->tx_list_p,
-               tx->tx_state, tx->tx_retrans);
+       vaf.fmt = fmt;
+       vaf.va = &args;
+
+       libcfs_debug_msg(msgdata,
+                        "%pV tx@0x%p->%s id %#llx/%u/%d:%d msg %x/%s/%d x%d q %s@%lds->0x%p f %x re %d\n",
+                        &vaf, tx, nid, id->txe_cookie, id->txe_smsg_id, id->txe_cqid,
+                        id->txe_idx, tx->tx_msg.gnm_type,
+                        kgnilnd_msgtype2str(tx->tx_msg.gnm_type), tx->tx_buftype,
+                        tx->tx_msg.gnm_seq,
+                        kgnilnd_tx_state2str(tx->tx_list_state),
+                        cfs_duration_sec((long)jiffies - tx->tx_qtime), tx->tx_list_p,
+                        tx->tx_state, tx->tx_retrans);
        va_end(args);
 }
 
@@ -99,12 +107,16 @@ void
 _kgnilnd_api_rc_lbug(const char* rcstr, int rc, struct libcfs_debug_msg_data *msgdata,
                        const char *fmt, ...)
 {
+       struct va_format vaf;
        va_list args;
 
        va_start(args, fmt);
-       libcfs_debug_vmsg2(msgdata, fmt, args,
-                          " GNI API violated? Unexpected rc %s(%d)!\n",
-                          rcstr, rc);
+       vaf.fmt = fmt;
+       vaf.va = &args;
+
+       libcfs_debug_msg(msgdata,
+                        "%pV GNI API violated? Unexpected rc %s(%d)!\n",
+                        &vaf, rcstr, rc);
        va_end(args);
        LBUG();
 }
index 3d587a5..da90fb1 100644 (file)
@@ -2699,6 +2699,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
         va_list args;
         struct obd_export *exp = lock->l_export;
        struct ldlm_resource *resource = NULL;
+       struct va_format vaf;
         char *nid = "local";
 
        /* on server-side resource of lock doesn't change */
@@ -2712,6 +2713,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
        }
 
         va_start(args, fmt);
+       vaf.fmt = fmt;
+       vaf.va = &args;
 
         if (exp && exp->exp_connection) {
                nid = obd_export_nid2str(exp);
@@ -2721,111 +2724,110 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
         }
 
         if (resource == NULL) {
-                libcfs_debug_vmsg2(msgdata, fmt, args,
-                      " ns: \?\? lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
-                      "res: \?\? rrc=\?\? type: \?\?\? flags: %#llx nid: %s "
-                      "remote: %#llx expref: %d pid: %u timeout: %lld "
-                      "lvb_type: %d\n",
-                       lock,
-                      lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
-                       lock->l_readers, lock->l_writers,
-                       ldlm_lockname[lock->l_granted_mode],
-                       ldlm_lockname[lock->l_req_mode],
-                       lock->l_flags, nid, lock->l_remote_handle.cookie,
-                      exp ? atomic_read(&exp->exp_refcount) : -99,
-                       lock->l_pid, lock->l_callback_timeout, lock->l_lvb_type);
+               libcfs_debug_msg(msgdata,
+                                "%pV ns: \?\? lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: \?\? rrc=\?\? type: \?\?\? flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lld lvb_type: %d\n",
+                                &vaf,
+                                lock,
+                                lock->l_handle.h_cookie,
+                                atomic_read(&lock->l_refc),
+                                lock->l_readers, lock->l_writers,
+                                ldlm_lockname[lock->l_granted_mode],
+                                ldlm_lockname[lock->l_req_mode],
+                                lock->l_flags, nid,
+                                lock->l_remote_handle.cookie,
+                                exp ? atomic_read(&exp->exp_refcount) : -99,
+                                lock->l_pid, lock->l_callback_timeout,
+                                lock->l_lvb_type);
                 va_end(args);
                 return;
         }
 
        switch (resource->lr_type) {
        case LDLM_EXTENT:
-               libcfs_debug_vmsg2(msgdata, fmt, args,
-                       " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
-                       "res: "DLDLMRES" rrc: %d type: %s [%llu->%llu] "
-                       "(req %llu->%llu) flags: %#llx nid: %s remote: "
-                       "%#llx expref: %d pid: %u timeout: %lld lvb_type: %d\n",
-                       ldlm_lock_to_ns_name(lock), lock,
-                       lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
-                       lock->l_readers, lock->l_writers,
-                       ldlm_lockname[lock->l_granted_mode],
-                       ldlm_lockname[lock->l_req_mode],
-                       PLDLMRES(resource),
-                       atomic_read(&resource->lr_refcount),
-                       ldlm_typename[resource->lr_type],
-                       lock->l_policy_data.l_extent.start,
-                       lock->l_policy_data.l_extent.end,
-                       lock->l_req_extent.start, lock->l_req_extent.end,
-                       lock->l_flags, nid, lock->l_remote_handle.cookie,
-                       exp ? atomic_read(&exp->exp_refcount) : -99,
-                       lock->l_pid, lock->l_callback_timeout,
-                       lock->l_lvb_type);
+               libcfs_debug_msg(msgdata,
+                                "%pV ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s [%llu->%llu] (req %llu->%llu) flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lld lvb_type: %d\n",
+                                &vaf,
+                                ldlm_lock_to_ns_name(lock), lock,
+                                lock->l_handle.h_cookie,
+                                atomic_read(&lock->l_refc),
+                                lock->l_readers, lock->l_writers,
+                                ldlm_lockname[lock->l_granted_mode],
+                                ldlm_lockname[lock->l_req_mode],
+                                PLDLMRES(resource),
+                                atomic_read(&resource->lr_refcount),
+                                ldlm_typename[resource->lr_type],
+                                lock->l_policy_data.l_extent.start,
+                                lock->l_policy_data.l_extent.end,
+                                lock->l_req_extent.start, lock->l_req_extent.end,
+                                lock->l_flags, nid,
+                                lock->l_remote_handle.cookie,
+                                exp ? atomic_read(&exp->exp_refcount) : -99,
+                                lock->l_pid, lock->l_callback_timeout,
+                                lock->l_lvb_type);
                break;
 
        case LDLM_FLOCK:
-               libcfs_debug_vmsg2(msgdata, fmt, args,
-                       " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
-                       "res: "DLDLMRES" rrc: %d type: %s pid: %d "
-                       "[%llu->%llu] flags: %#llx nid: %s "
-                       "remote: %#llx expref: %d pid: %u timeout: %lld\n",
-                       ldlm_lock_to_ns_name(lock), lock,
-                       lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
-                       lock->l_readers, lock->l_writers,
-                       ldlm_lockname[lock->l_granted_mode],
-                       ldlm_lockname[lock->l_req_mode],
-                       PLDLMRES(resource),
-                       atomic_read(&resource->lr_refcount),
-                       ldlm_typename[resource->lr_type],
-                       lock->l_policy_data.l_flock.pid,
-                       lock->l_policy_data.l_flock.start,
-                       lock->l_policy_data.l_flock.end,
-                       lock->l_flags, nid, lock->l_remote_handle.cookie,
-                       exp ? atomic_read(&exp->exp_refcount) : -99,
-                       lock->l_pid, lock->l_callback_timeout);
+               libcfs_debug_msg(msgdata,
+                                "%pV ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s pid: %d [%llu->%llu] flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lld\n",
+                                &vaf,
+                                ldlm_lock_to_ns_name(lock), lock,
+                                lock->l_handle.h_cookie,
+                                atomic_read(&lock->l_refc),
+                                lock->l_readers, lock->l_writers,
+                                ldlm_lockname[lock->l_granted_mode],
+                                ldlm_lockname[lock->l_req_mode],
+                                PLDLMRES(resource),
+                                atomic_read(&resource->lr_refcount),
+                                ldlm_typename[resource->lr_type],
+                                lock->l_policy_data.l_flock.pid,
+                                lock->l_policy_data.l_flock.start,
+                                lock->l_policy_data.l_flock.end,
+                                lock->l_flags, nid,
+                                lock->l_remote_handle.cookie,
+                                exp ? atomic_read(&exp->exp_refcount) : -99,
+                                lock->l_pid, lock->l_callback_timeout);
                break;
 
        case LDLM_IBITS:
-               libcfs_debug_vmsg2(msgdata, fmt, args,
-                       " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
-                       "res: "DLDLMRES" bits %#llx/%#llx rrc: %d type: %s "
-                       "flags: %#llx nid: %s remote: %#llx expref: %d "
-                       "pid: %u timeout: %lld lvb_type: %d\n",
-                       ldlm_lock_to_ns_name(lock),
-                       lock, lock->l_handle.h_cookie,
-                       atomic_read(&lock->l_refc),
-                       lock->l_readers, lock->l_writers,
-                       ldlm_lockname[lock->l_granted_mode],
-                       ldlm_lockname[lock->l_req_mode],
-                       PLDLMRES(resource),
-                       lock->l_policy_data.l_inodebits.bits,
-                       lock->l_policy_data.l_inodebits.try_bits,
-                       atomic_read(&resource->lr_refcount),
-                       ldlm_typename[resource->lr_type],
-                       lock->l_flags, nid, lock->l_remote_handle.cookie,
-                       exp ? atomic_read(&exp->exp_refcount) : -99,
-                       lock->l_pid, lock->l_callback_timeout,
-                       lock->l_lvb_type);
+               libcfs_debug_msg(msgdata,
+                                "%pV ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " bits %#llx/%#llx rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lld lvb_type: %d\n",
+                                &vaf,
+                                ldlm_lock_to_ns_name(lock),
+                                lock, lock->l_handle.h_cookie,
+                                atomic_read(&lock->l_refc),
+                                lock->l_readers, lock->l_writers,
+                                ldlm_lockname[lock->l_granted_mode],
+                                ldlm_lockname[lock->l_req_mode],
+                                PLDLMRES(resource),
+                                lock->l_policy_data.l_inodebits.bits,
+                                lock->l_policy_data.l_inodebits.try_bits,
+                                atomic_read(&resource->lr_refcount),
+                                ldlm_typename[resource->lr_type],
+                                lock->l_flags, nid,
+                                lock->l_remote_handle.cookie,
+                                exp ? atomic_read(&exp->exp_refcount) : -99,
+                                lock->l_pid, lock->l_callback_timeout,
+                                lock->l_lvb_type);
                break;
 
        default:
-               libcfs_debug_vmsg2(msgdata, fmt, args,
-                       " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s "
-                       "res: "DLDLMRES" rrc: %d type: %s flags: %#llx "
-                       "nid: %s remote: %#llx expref: %d pid: %u "
-                       "timeout: %lld lvb_type: %d\n",
-                       ldlm_lock_to_ns_name(lock),
-                       lock, lock->l_handle.h_cookie,
-                       atomic_read(&lock->l_refc),
-                       lock->l_readers, lock->l_writers,
-                       ldlm_lockname[lock->l_granted_mode],
-                       ldlm_lockname[lock->l_req_mode],
-                       PLDLMRES(resource),
-                       atomic_read(&resource->lr_refcount),
-                       ldlm_typename[resource->lr_type],
-                       lock->l_flags, nid, lock->l_remote_handle.cookie,
-                       exp ? atomic_read(&exp->exp_refcount) : -99,
-                       lock->l_pid, lock->l_callback_timeout,
-                       lock->l_lvb_type);
+               libcfs_debug_msg(msgdata,
+                                "%pV ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lld lvb_type: %d\n",
+                                &vaf,
+                                ldlm_lock_to_ns_name(lock),
+                                lock, lock->l_handle.h_cookie,
+                                atomic_read(&lock->l_refc),
+                                lock->l_readers, lock->l_writers,
+                                ldlm_lockname[lock->l_granted_mode],
+                                ldlm_lockname[lock->l_req_mode],
+                                PLDLMRES(resource),
+                                atomic_read(&resource->lr_refcount),
+                                ldlm_typename[resource->lr_type],
+                                lock->l_flags, nid,
+                                lock->l_remote_handle.cookie,
+                                exp ? atomic_read(&exp->exp_refcount) : -99,
+                                lock->l_pid, lock->l_callback_timeout,
+                                lock->l_lvb_type);
                break;
        }
        va_end(args);
index b5ec17f..ecb6bc0 100644 (file)
@@ -2566,6 +2566,7 @@ void _debug_req(struct ptlrpc_request *req,
        bool req_ok = req->rq_reqmsg != NULL;
        bool rep_ok = false;
        lnet_nid_t nid = LNET_NID_ANY;
+       struct va_format vaf;
        va_list args;
        int rep_flags = -1;
        int rep_status = -1;
@@ -2591,25 +2592,28 @@ void _debug_req(struct ptlrpc_request *req,
                nid = req->rq_export->exp_connection->c_peer.nid;
 
        va_start(args, fmt);
-       libcfs_debug_vmsg2(msgdata, fmt, args,
-                          " req@%p x%llu/t%lld(%lld) o%d->%s@%s:%d/%d lens %d/%d e %d to %lld dl %lld 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, (s64)req->rq_timedout,
-                          (s64)req->rq_deadline,
-                          atomic_read(&req->rq_refcount),
-                          DEBUG_REQ_FLAGS(req),
-                          req_ok ? lustre_msg_get_flags(req->rq_reqmsg) : -1,
-                          rep_flags, req->rq_status, rep_status);
+       vaf.fmt = fmt;
+       vaf.va = &args;
+       libcfs_debug_msg(msgdata,
+                        "%pV req@%p x%llu/t%lld(%lld) o%d->%s@%s:%d/%d lens %d/%d e %d to %lld dl %lld ref %d fl " REQ_FLAGS_FMT "/%x/%x rc %d/%d\n",
+                        &vaf,
+                        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, (s64)req->rq_timedout,
+                        (s64)req->rq_deadline,
+                        atomic_read(&req->rq_refcount),
+                        DEBUG_REQ_FLAGS(req),
+                        req_ok ? lustre_msg_get_flags(req->rq_reqmsg) : -1,
+                        rep_flags, req->rq_status, rep_status);
        va_end(args);
 }
 EXPORT_SYMBOL(_debug_req);
index 3194bfc..3cc8fb2 100644 (file)
@@ -100,12 +100,15 @@ void lquota_lqe_debug0(struct lquota_entry *lqe,
                       const char *fmt, ...)
 {
        struct lquota_site *site = lqe->lqe_site;
+       struct va_format vaf;
        va_list args;
 
        LASSERT(site->lqs_ops->lqe_debug != NULL);
 
        va_start(args, fmt);
-       site->lqs_ops->lqe_debug(lqe, site->lqs_parent, msgdata, fmt, args);
+       vaf.fmt = fmt;
+       vaf.va = &args;
+       site->lqs_ops->lqe_debug(lqe, site->lqs_parent, msgdata, &vaf);
        va_end(args);
 }
 
index ab1eab0..1f7626b 100644 (file)
@@ -80,8 +80,8 @@ struct lquota_entry_operations {
 
        /* Print debug information about a given lquota entry */
        void (*lqe_debug)(struct lquota_entry *, void *,
-                         struct libcfs_debug_msg_data *, const char *,
-                         va_list);
+                         struct libcfs_debug_msg_data *,
+                         struct va_format *vaf);
 };
 
 /* Per-ID information specific to the quota master target */
index c6bd58f..1abc6e0 100644 (file)
@@ -160,23 +160,21 @@ static int qmt_lqe_read(const struct lu_env *env, struct lquota_entry *lqe,
  */
 static void qmt_lqe_debug(struct lquota_entry *lqe, void *arg,
                          struct libcfs_debug_msg_data *msgdata,
-                         const char *fmt, va_list args)
+                         struct va_format *vaf)
 {
        struct qmt_pool_info    *pool = (struct qmt_pool_info *)arg;
 
-       libcfs_debug_vmsg2(msgdata, fmt, args,
-                          "qmt:%s pool:%d-%s id:%llu enforced:%d hard:%llu"
-                          " soft:%llu granted:%llu time:%llu qunit: %llu"
-                          " edquot:%d may_rel:%llu revoke:%lld default:%s\n",
-                          pool->qpi_qmt->qmt_svname,
-                          pool->qpi_key & 0x0000ffff,
-                          RES_NAME(pool->qpi_key >> 16),
-                          lqe->lqe_id.qid_uid, lqe->lqe_enforced,
-                          lqe->lqe_hardlimit, lqe->lqe_softlimit,
-                          lqe->lqe_granted, lqe->lqe_gracetime,
-                          lqe->lqe_qunit, lqe->lqe_edquot, lqe->lqe_may_rel,
-                          lqe->lqe_revoke_time,
-                          lqe->lqe_is_default ? "yes" : "no");
+       libcfs_debug_msg(msgdata,
+                        "%pV qmt:%s pool:%d-%s id:%llu enforced:%d hard:%llu soft:%llu granted:%llu time:%llu qunit: %llu edquot:%d may_rel:%llu revoke:%lld default:%s\n",
+                        vaf, pool->qpi_qmt->qmt_svname,
+                        pool->qpi_key & 0x0000ffff,
+                        RES_NAME(pool->qpi_key >> 16),
+                        lqe->lqe_id.qid_uid, lqe->lqe_enforced,
+                        lqe->lqe_hardlimit, lqe->lqe_softlimit,
+                        lqe->lqe_granted, lqe->lqe_gracetime,
+                        lqe->lqe_qunit, lqe->lqe_edquot, lqe->lqe_may_rel,
+                        lqe->lqe_revoke_time,
+                        lqe->lqe_is_default ? "yes" : "no");
 }
 
 /*
index 4e0faac..3f622b9 100644 (file)
@@ -165,20 +165,19 @@ static int qsd_lqe_read(const struct lu_env *env, struct lquota_entry *lqe,
  */
 static void qsd_lqe_debug(struct lquota_entry *lqe, void *arg,
                          struct libcfs_debug_msg_data *msgdata,
-                         const char *fmt, va_list args)
+                         struct va_format *vaf)
 {
        struct qsd_qtype_info   *qqi = (struct qsd_qtype_info *)arg;
 
-       libcfs_debug_vmsg2(msgdata, fmt, args,
-                          "qsd:%s qtype:%s id:%llu enforced:%d granted: %llu"
-                          " pending:%llu waiting:%llu req:%d usage: %llu"
-                          " qunit:%llu qtune:%llu edquot:%d default:%s\n",
-                          qqi->qqi_qsd->qsd_svname, qtype_name(qqi->qqi_qtype),
-                          lqe->lqe_id.qid_uid, lqe->lqe_enforced,
-                          lqe->lqe_granted, lqe->lqe_pending_write,
-                          lqe->lqe_waiting_write, lqe->lqe_pending_req,
-                          lqe->lqe_usage, lqe->lqe_qunit, lqe->lqe_qtune,
-                          lqe->lqe_edquot, lqe->lqe_is_default ? "yes" : "no");
+       libcfs_debug_msg(msgdata,
+                        "%pV qsd:%s qtype:%s id:%llu enforced:%d granted: %llu pending:%llu waiting:%llu req:%d usage: %llu qunit:%llu qtune:%llu edquot:%d default:%s\n",
+                        vaf,
+                        qqi->qqi_qsd->qsd_svname, qtype_name(qqi->qqi_qtype),
+                        lqe->lqe_id.qid_uid, lqe->lqe_enforced,
+                        lqe->lqe_granted, lqe->lqe_pending_write,
+                        lqe->lqe_waiting_write, lqe->lqe_pending_req,
+                        lqe->lqe_usage, lqe->lqe_qunit, lqe->lqe_qtune,
+                        lqe->lqe_edquot, lqe->lqe_is_default ? "yes" : "no");
 }
 
 /*