diff options
Diffstat (limited to 'fs/ocfs2/cluster/masklog.h')
| -rw-r--r-- | fs/ocfs2/cluster/masklog.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h index 308ea0eb35fd..a396096a5099 100644 --- a/fs/ocfs2/cluster/masklog.h +++ b/fs/ocfs2/cluster/masklog.h | |||
| @@ -178,6 +178,15 @@ do { \ | |||
| 178 | ##__VA_ARGS__); \ | 178 | ##__VA_ARGS__); \ |
| 179 | } while (0) | 179 | } while (0) |
| 180 | 180 | ||
| 181 | #define mlog_ratelimited(mask, fmt, ...) \ | ||
| 182 | do { \ | ||
| 183 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
| 184 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
| 185 | DEFAULT_RATELIMIT_BURST); \ | ||
| 186 | if (__ratelimit(&_rs)) \ | ||
| 187 | mlog(mask, fmt, ##__VA_ARGS__); \ | ||
| 188 | } while (0) | ||
| 189 | |||
| 181 | #define mlog_errno(st) ({ \ | 190 | #define mlog_errno(st) ({ \ |
| 182 | int _st = (st); \ | 191 | int _st = (st); \ |
| 183 | if (_st != -ERESTARTSYS && _st != -EINTR && \ | 192 | if (_st != -ERESTARTSYS && _st != -EINTR && \ |
