Commit 1fa8f450 authored by Mark Rustad's avatar Mark Rustad Committed by Nicholas Bellinger

tcm_fc: Avoid debug overhead when not debugging

Stop doing a pile of work related to debugging messages when
the ft_debug_logging flag is not set. Use unlikely to add the
check in a way that the check can be inlined without inlining the
whole thing.
Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 101998f6
...@@ -131,6 +131,7 @@ extern struct list_head ft_lport_list; ...@@ -131,6 +131,7 @@ extern struct list_head ft_lport_list;
extern struct mutex ft_lport_lock; extern struct mutex ft_lport_lock;
extern struct fc4_prov ft_prov; extern struct fc4_prov ft_prov;
extern struct target_fabric_configfs *ft_configfs; extern struct target_fabric_configfs *ft_configfs;
extern unsigned int ft_debug_logging;
/* /*
* Fabric methods. * Fabric methods.
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
/* /*
* Dump cmd state for debugging. * Dump cmd state for debugging.
*/ */
void ft_dump_cmd(struct ft_cmd *cmd, const char *caller) static void _ft_dump_cmd(struct ft_cmd *cmd, const char *caller)
{ {
struct fc_exch *ep; struct fc_exch *ep;
struct fc_seq *sp; struct fc_seq *sp;
...@@ -80,6 +80,12 @@ void ft_dump_cmd(struct ft_cmd *cmd, const char *caller) ...@@ -80,6 +80,12 @@ void ft_dump_cmd(struct ft_cmd *cmd, const char *caller)
} }
} }
void ft_dump_cmd(struct ft_cmd *cmd, const char *caller)
{
if (unlikely(ft_debug_logging))
_ft_dump_cmd(cmd, caller);
}
static void ft_free_cmd(struct ft_cmd *cmd) static void ft_free_cmd(struct ft_cmd *cmd)
{ {
struct fc_frame *fp; struct fc_frame *fp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment