scst_vdisk: lower severity of message about not supported fallocate(FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE) and print it only once

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7328 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2018-01-05 05:14:03 +00:00
parent a5e93d46b0
commit cbc53b12c8
2 changed files with 10 additions and 1 deletions

View File

@@ -399,4 +399,13 @@ do { \
#define SCST_SLAB_FLAGS 0L
#endif
#define PRINT_WARNING_ONCE(format, args...) \
do { \
static bool __warned; \
if (!__warned) { \
__warned = true; \
PRINT_WARNING(format, ## args); \
} \
} while(0)
#endif /* __SCST_DEBUG_H */

View File

@@ -3847,7 +3847,7 @@ static int vdisk_unmap_file_range(struct scst_cmd *cmd,
res = fd->f_op->fallocate(fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, len);
if (unlikely(res != 0)) {
PRINT_ERROR("fallocate() for %lld, len %lld "
PRINT_WARNING_ONCE("fallocate() for %lld, len %lld "
"failed: %d", (unsigned long long)off,
(unsigned long long)len, res);
scst_set_cmd_error(cmd,