From d3847b031eff518831a77360e49689e0d32447c0 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 13 Jul 2010 11:48:49 +0000 Subject: [PATCH] Make SG IO count limitation messages less annoying git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1813 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_user.c | 1 + scst/src/scst_lib.c | 13 ++----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index 91b52b8c3..06755cc8a 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -618,6 +618,7 @@ static int dev_user_alloc_sg(struct scst_user_cmd *ucmd, int cached_buff) if (unlikely(cmd->sg_cnt > cmd->tgt_dev->max_sg_cnt)) { static int ll; + if ((ll < 10) || (trace_flag & TRACE_MINOR)) if (ll < 10) { PRINT_INFO("Unable to complete command due to " "SG IO count limitation (requested %d, " diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 9e9335b75..8211ae96f 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -4387,15 +4387,6 @@ void scst_release_request(struct scst_cmd *cmd) } #endif -static bool is_report_sg_limitation(void) -{ -#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) - return (trace_flag & TRACE_OUT_OF_MEM) != 0; -#else - return false; -#endif -} - int scst_alloc_space(struct scst_cmd *cmd) { gfp_t gfp_mask; @@ -4419,7 +4410,7 @@ int scst_alloc_space(struct scst_cmd *cmd) goto out; if (unlikely(cmd->sg_cnt > tgt_dev->max_sg_cnt)) { - if ((ll < 10) || is_report_sg_limitation()) { + if ((ll < 10) || (trace_flag & TRACE_MINOR)) { PRINT_INFO("Unable to complete command due to " "SG IO count limitation (requested %d, " "available %d, tgt lim %d)", cmd->sg_cnt, @@ -4439,7 +4430,7 @@ int scst_alloc_space(struct scst_cmd *cmd) goto out_sg_free; if (unlikely(cmd->out_sg_cnt > tgt_dev->max_sg_cnt)) { - if ((ll < 10) || is_report_sg_limitation()) { + if ((ll < 10) || (trace_flag & TRACE_MINOR)) { PRINT_INFO("Unable to complete command due to " "SG IO count limitation (OUT buffer, requested " "%d, available %d, tgt lim %d)", cmd->out_sg_cnt,