diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2007-07-12 12:28:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 18:01:08 -0400 |
commit | d0d444c7d48c14d59f665887c758fde248f1cb37 (patch) | |
tree | 8175cb71399e3f4048a7cf4a2859f43d2ee29852 /drivers/md/dm.h | |
parent | 07a83c47cfc00ba5f0f090ccddd3a0703be0eec9 (diff) |
dm: add ratelimit logging macros
Add ratelimit extension to dm logging macros.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md/dm.h')
-rw-r--r-- | drivers/md/dm.h | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/drivers/md/dm.h b/drivers/md/dm.h index 2f796b1436b2..462ee652a890 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h | |||
@@ -18,13 +18,45 @@ | |||
18 | 18 | ||
19 | #define DM_NAME "device-mapper" | 19 | #define DM_NAME "device-mapper" |
20 | 20 | ||
21 | #define DMERR(f, arg...) printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 21 | #define DMERR(f, arg...) \ |
22 | #define DMWARN(f, arg...) printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 22 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
23 | #define DMINFO(f, arg...) printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 23 | #define DMERR_LIMIT(f, arg...) \ |
24 | do { \ | ||
25 | if (printk_ratelimit()) \ | ||
26 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ | ||
27 | f "\n", ## arg); \ | ||
28 | } while (0) | ||
29 | |||
30 | #define DMWARN(f, arg...) \ | ||
31 | printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | ||
32 | #define DMWARN_LIMIT(f, arg...) \ | ||
33 | do { \ | ||
34 | if (printk_ratelimit()) \ | ||
35 | printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \ | ||
36 | f "\n", ## arg); \ | ||
37 | } while (0) | ||
38 | |||
39 | #define DMINFO(f, arg...) \ | ||
40 | printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | ||
41 | #define DMINFO_LIMIT(f, arg...) \ | ||
42 | do { \ | ||
43 | if (printk_ratelimit()) \ | ||
44 | printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \ | ||
45 | "\n", ## arg); \ | ||
46 | } while (0) | ||
47 | |||
24 | #ifdef CONFIG_DM_DEBUG | 48 | #ifdef CONFIG_DM_DEBUG |
25 | # define DMDEBUG(f, arg...) printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) | 49 | # define DMDEBUG(f, arg...) \ |
50 | printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) | ||
51 | # define DMDEBUG_LIMIT(f, arg...) \ | ||
52 | do { \ | ||
53 | if (printk_ratelimit()) \ | ||
54 | printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ | ||
55 | "\n", ## arg); \ | ||
56 | } while (0) | ||
26 | #else | 57 | #else |
27 | # define DMDEBUG(f, arg...) do {} while (0) | 58 | # define DMDEBUG(f, arg...) do {} while (0) |
59 | # define DMDEBUG_LIMIT(f, arg...) do {} while (0) | ||
28 | #endif | 60 | #endif |
29 | 61 | ||
30 | #define DMEMIT(x...) sz += ((sz >= maxlen) ? \ | 62 | #define DMEMIT(x...) sz += ((sz >= maxlen) ? \ |