aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device-mapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/device-mapper.h')
-rw-r--r--include/linux/device-mapper.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 08d783592b7..c17fd334e57 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -69,8 +69,7 @@ typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type,
69 69
70typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); 70typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv);
71 71
72typedef int (*dm_ioctl_fn) (struct dm_target *ti, struct inode *inode, 72typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd,
73 struct file *filp, unsigned int cmd,
74 unsigned long arg); 73 unsigned long arg);
75 74
76typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, 75typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
@@ -85,7 +84,7 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev);
85 84
86struct dm_dev { 85struct dm_dev {
87 struct block_device *bdev; 86 struct block_device *bdev;
88 int mode; 87 fmode_t mode;
89 char name[16]; 88 char name[16];
90}; 89};
91 90
@@ -95,7 +94,7 @@ struct dm_dev {
95 * FIXME: too many arguments. 94 * FIXME: too many arguments.
96 */ 95 */
97int dm_get_device(struct dm_target *ti, const char *path, sector_t start, 96int dm_get_device(struct dm_target *ti, const char *path, sector_t start,
98 sector_t len, int mode, struct dm_dev **result); 97 sector_t len, fmode_t mode, struct dm_dev **result);
99void dm_put_device(struct dm_target *ti, struct dm_dev *d); 98void dm_put_device(struct dm_target *ti, struct dm_dev *d);
100 99
101/* 100/*
@@ -223,7 +222,7 @@ int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo);
223/* 222/*
224 * First create an empty table. 223 * First create an empty table.
225 */ 224 */
226int dm_table_create(struct dm_table **result, int mode, 225int dm_table_create(struct dm_table **result, fmode_t mode,
227 unsigned num_targets, struct mapped_device *md); 226 unsigned num_targets, struct mapped_device *md);
228 227
229/* 228/*
@@ -254,7 +253,7 @@ void dm_table_put(struct dm_table *t);
254 */ 253 */
255sector_t dm_table_get_size(struct dm_table *t); 254sector_t dm_table_get_size(struct dm_table *t);
256unsigned int dm_table_get_num_targets(struct dm_table *t); 255unsigned int dm_table_get_num_targets(struct dm_table *t);
257int dm_table_get_mode(struct dm_table *t); 256fmode_t dm_table_get_mode(struct dm_table *t);
258struct mapped_device *dm_table_get_md(struct dm_table *t); 257struct mapped_device *dm_table_get_md(struct dm_table *t);
259 258
260/* 259/*
@@ -354,6 +353,9 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
354 */ 353 */
355#define dm_round_up(n, sz) (dm_div_up((n), (sz)) * (sz)) 354#define dm_round_up(n, sz) (dm_div_up((n), (sz)) * (sz))
356 355
356#define dm_array_too_big(fixed, obj, num) \
357 ((num) > (UINT_MAX - (fixed)) / (obj))
358
357static inline sector_t to_sector(unsigned long n) 359static inline sector_t to_sector(unsigned long n)
358{ 360{
359 return (n >> SECTOR_SHIFT); 361 return (n >> SECTOR_SHIFT);