aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:23:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:23:07 -0400
commit22484856402bfa1ff3defe47f6029ab0418240d9 (patch)
tree140c67bf59674da350a7b51765d6ff7eb101b597 /drivers/md/dm-table.c
parent5ed487bc2c44ca4e9668ef9cb54c830e2a9fac47 (diff)
parent56b26add02b4bdea81d5e0ebda60db1fe3311ad4 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev
* git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev: (66 commits) [PATCH] kill the rest of struct file propagation in block ioctls [PATCH] get rid of struct file use in blkdev_ioctl() BLKBSZSET [PATCH] get rid of blkdev_locked_ioctl() [PATCH] get rid of blkdev_driver_ioctl() [PATCH] sanitize blkdev_get() and friends [PATCH] remember mode of reiserfs journal [PATCH] propagate mode through swsusp_close() [PATCH] propagate mode through open_bdev_excl/close_bdev_excl [PATCH] pass fmode_t to blkdev_put() [PATCH] kill the unused bsize on the send side of /dev/loop [PATCH] trim file propagation in block/compat_ioctl.c [PATCH] end of methods switch: remove the old ones [PATCH] switch sr [PATCH] switch sd [PATCH] switch ide-scsi [PATCH] switch tape_block [PATCH] switch dcssblk [PATCH] switch dasd [PATCH] switch mtd_blkdevs [PATCH] switch mmc ...
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c16
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
220int dm_table_create(struct dm_table **result, int mode, 220int 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 */
385static int upgrade_mode(struct dm_dev_internal *dd, int new_mode, 385static 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 */
409static int __table_get_device(struct dm_table *t, struct dm_target *ti, 409static 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)
528EXPORT_SYMBOL_GPL(dm_set_device_limits); 528EXPORT_SYMBOL_GPL(dm_set_device_limits);
529 529
530int dm_get_device(struct dm_target *ti, const char *path, sector_t start, 530int 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
881int dm_table_get_mode(struct dm_table *t) 881fmode_t dm_table_get_mode(struct dm_table *t)
882{ 882{
883 return t->mode; 883 return t->mode;
884} 884}