aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.h
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2008-04-24 16:43:52 -0400
committerAlasdair G Kergon <agk@redhat.com>2008-04-25 08:26:53 -0400
commit0da336e5fab75c712ba8c67f3135d5a20528465f (patch)
tree8907bfc6db07ba73979df23d99424984aa02d3d7 /drivers/md/dm.h
parent945fa4d283a3a472186c11028f6fea1e77a91d14 (diff)
dm: expose macros
Make dm.h macros and inlines available in include/linux/device-mapper.h Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm.h')
-rw-r--r--drivers/md/dm.h89
1 files changed, 0 insertions, 89 deletions
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index 9a6023c9bc6b..8c03b634e62e 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -16,67 +16,6 @@
16#include <linux/blkdev.h> 16#include <linux/blkdev.h>
17#include <linux/hdreg.h> 17#include <linux/hdreg.h>
18 18
19#define DM_NAME "device-mapper"
20
21#define DMERR(f, arg...) \
22 printk(KERN_ERR 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
48#ifdef CONFIG_DM_DEBUG
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)
57#else
58# define DMDEBUG(f, arg...) do {} while (0)
59# define DMDEBUG_LIMIT(f, arg...) do {} while (0)
60#endif
61
62#define DMEMIT(x...) sz += ((sz >= maxlen) ? \
63 0 : scnprintf(result + sz, maxlen - sz, x))
64
65#define SECTOR_SHIFT 9
66
67/*
68 * Definitions of return values from target end_io function.
69 */
70#define DM_ENDIO_INCOMPLETE 1
71#define DM_ENDIO_REQUEUE 2
72
73/*
74 * Definitions of return values from target map function.
75 */
76#define DM_MAPIO_SUBMITTED 0
77#define DM_MAPIO_REMAPPED 1
78#define DM_MAPIO_REQUEUE DM_ENDIO_REQUEUE
79
80/* 19/*
81 * Suspend feature flags 20 * Suspend feature flags
82 */ 21 */
@@ -136,34 +75,6 @@ static inline int array_too_big(unsigned long fixed, unsigned long obj,
136 return (num > (ULONG_MAX - fixed) / obj); 75 return (num > (ULONG_MAX - fixed) / obj);
137} 76}
138 77
139/*
140 * Ceiling(n / sz)
141 */
142#define dm_div_up(n, sz) (((n) + (sz) - 1) / (sz))
143
144#define dm_sector_div_up(n, sz) ( \
145{ \
146 sector_t _r = ((n) + (sz) - 1); \
147 sector_div(_r, (sz)); \
148 _r; \
149} \
150)
151
152/*
153 * ceiling(n / size) * size
154 */
155#define dm_round_up(n, sz) (dm_div_up((n), (sz)) * (sz))
156
157static inline sector_t to_sector(unsigned long n)
158{
159 return (n >> 9);
160}
161
162static inline unsigned long to_bytes(sector_t n)
163{
164 return (n << 9);
165}
166
167int dm_split_args(int *argc, char ***argvp, char *input); 78int dm_split_args(int *argc, char ***argvp, char *input);
168 79
169/* 80/*