diff options
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 1407eb96f1a4..a63161aec487 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -43,7 +43,7 @@ struct dm_table { | |||
43 | * device. This should be a combination of FMODE_READ | 43 | * device. This should be a combination of FMODE_READ |
44 | * and FMODE_WRITE. | 44 | * and FMODE_WRITE. |
45 | */ | 45 | */ |
46 | int mode; | 46 | fmode_t mode; |
47 | 47 | ||
48 | /* a list of devices used by this table */ | 48 | /* a list of devices used by this table */ |
49 | struct list_head devices; | 49 | struct list_head devices; |
@@ -217,7 +217,7 @@ static int alloc_targets(struct dm_table *t, unsigned int num) | |||
217 | return 0; | 217 | return 0; |
218 | } | 218 | } |
219 | 219 | ||
220 | int dm_table_create(struct dm_table **result, int mode, | 220 | int dm_table_create(struct dm_table **result, fmode_t mode, |
221 | unsigned num_targets, struct mapped_device *md) | 221 | unsigned num_targets, struct mapped_device *md) |
222 | { | 222 | { |
223 | struct dm_table *t = kzalloc(sizeof(*t), GFP_KERNEL); | 223 | struct dm_table *t = kzalloc(sizeof(*t), GFP_KERNEL); |
@@ -344,7 +344,7 @@ static int open_dev(struct dm_dev_internal *d, dev_t dev, | |||
344 | return PTR_ERR(bdev); | 344 | return PTR_ERR(bdev); |
345 | r = bd_claim_by_disk(bdev, _claim_ptr, dm_disk(md)); | 345 | r = bd_claim_by_disk(bdev, _claim_ptr, dm_disk(md)); |
346 | if (r) | 346 | if (r) |
347 | blkdev_put(bdev); | 347 | blkdev_put(bdev, d->dm_dev.mode); |
348 | else | 348 | else |
349 | d->dm_dev.bdev = bdev; | 349 | d->dm_dev.bdev = bdev; |
350 | return r; | 350 | return r; |
@@ -359,7 +359,7 @@ static void close_dev(struct dm_dev_internal *d, struct mapped_device *md) | |||
359 | return; | 359 | return; |
360 | 360 | ||
361 | bd_release_from_disk(d->dm_dev.bdev, dm_disk(md)); | 361 | bd_release_from_disk(d->dm_dev.bdev, dm_disk(md)); |
362 | blkdev_put(d->dm_dev.bdev); | 362 | blkdev_put(d->dm_dev.bdev, d->dm_dev.mode); |
363 | d->dm_dev.bdev = NULL; | 363 | d->dm_dev.bdev = NULL; |
364 | } | 364 | } |
365 | 365 | ||
@@ -382,7 +382,7 @@ static int check_device_area(struct dm_dev_internal *dd, sector_t start, | |||
382 | * careful to leave things as they were if we fail to reopen the | 382 | * careful to leave things as they were if we fail to reopen the |
383 | * device. | 383 | * device. |
384 | */ | 384 | */ |
385 | static int upgrade_mode(struct dm_dev_internal *dd, int new_mode, | 385 | static int upgrade_mode(struct dm_dev_internal *dd, fmode_t new_mode, |
386 | struct mapped_device *md) | 386 | struct mapped_device *md) |
387 | { | 387 | { |
388 | int r; | 388 | int r; |
@@ -408,7 +408,7 @@ static int upgrade_mode(struct dm_dev_internal *dd, int new_mode, | |||
408 | */ | 408 | */ |
409 | static int __table_get_device(struct dm_table *t, struct dm_target *ti, | 409 | static int __table_get_device(struct dm_table *t, struct dm_target *ti, |
410 | const char *path, sector_t start, sector_t len, | 410 | const char *path, sector_t start, sector_t len, |
411 | int mode, struct dm_dev **result) | 411 | fmode_t mode, struct dm_dev **result) |
412 | { | 412 | { |
413 | int r; | 413 | int r; |
414 | dev_t uninitialized_var(dev); | 414 | dev_t uninitialized_var(dev); |
@@ -528,7 +528,7 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev) | |||
528 | EXPORT_SYMBOL_GPL(dm_set_device_limits); | 528 | EXPORT_SYMBOL_GPL(dm_set_device_limits); |
529 | 529 | ||
530 | int dm_get_device(struct dm_target *ti, const char *path, sector_t start, | 530 | int dm_get_device(struct dm_target *ti, const char *path, sector_t start, |
531 | sector_t len, int mode, struct dm_dev **result) | 531 | sector_t len, fmode_t mode, struct dm_dev **result) |
532 | { | 532 | { |
533 | int r = __table_get_device(ti->table, ti, path, | 533 | int r = __table_get_device(ti->table, ti, path, |
534 | start, len, mode, result); | 534 | start, len, mode, result); |
@@ -878,7 +878,7 @@ struct list_head *dm_table_get_devices(struct dm_table *t) | |||
878 | return &t->devices; | 878 | return &t->devices; |
879 | } | 879 | } |
880 | 880 | ||
881 | int dm_table_get_mode(struct dm_table *t) | 881 | fmode_t dm_table_get_mode(struct dm_table *t) |
882 | { | 882 | { |
883 | return t->mode; | 883 | return t->mode; |
884 | } | 884 | } |