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
This commit is contained in:
Vladislav Bolkhovitin
2010-07-13 11:48:49 +00:00
parent 47a5c6072c
commit d3847b031e
2 changed files with 3 additions and 11 deletions

View File

@@ -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, "

View File

@@ -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,