aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-02-22 20:40:24 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-21 07:48:58 -0400
commit9a1c3542768b5a58e45a9216921cd10a3bae1205 (patch)
treec20ffda950db868ec7e1e35aed532962de2ecfd9 /fs
parent511de73ff09034fb89c8d54bed201a10d057328c (diff)
[PATCH] pass fmode_t to blkdev_put()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/block_dev.c22
-rw-r--r--fs/ext3/super.c4
-rw-r--r--fs/ext4/super.c4
-rw-r--r--fs/jfs/jfs_logmgr.c4
-rw-r--r--fs/ocfs2/cluster/heartbeat.c4
-rw-r--r--fs/partitions/check.c2
-rw-r--r--fs/reiserfs/journal.c4
7 files changed, 22 insertions, 22 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 55124ac8c7ad..05131baf3cf8 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -977,7 +977,7 @@ EXPORT_SYMBOL(bd_set_size);
977 977
978static int __blkdev_get(struct block_device *bdev, fmode_t mode, unsigned flags, 978static int __blkdev_get(struct block_device *bdev, fmode_t mode, unsigned flags,
979 int for_part); 979 int for_part);
980static int __blkdev_put(struct block_device *bdev, int for_part); 980static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
981 981
982/* 982/*
983 * bd_mutex locking: 983 * bd_mutex locking:
@@ -1095,7 +1095,7 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part)
1095 bdev->bd_part = NULL; 1095 bdev->bd_part = NULL;
1096 bdev->bd_inode->i_data.backing_dev_info = &default_backing_dev_info; 1096 bdev->bd_inode->i_data.backing_dev_info = &default_backing_dev_info;
1097 if (bdev != bdev->bd_contains) 1097 if (bdev != bdev->bd_contains)
1098 __blkdev_put(bdev->bd_contains, 1); 1098 __blkdev_put(bdev->bd_contains, file->f_mode, 1);
1099 bdev->bd_contains = NULL; 1099 bdev->bd_contains = NULL;
1100 out_unlock_bdev: 1100 out_unlock_bdev:
1101 mutex_unlock(&bdev->bd_mutex); 1101 mutex_unlock(&bdev->bd_mutex);
@@ -1163,11 +1163,11 @@ static int blkdev_open(struct inode * inode, struct file * filp)
1163 if (!(res = bd_claim(bdev, filp))) 1163 if (!(res = bd_claim(bdev, filp)))
1164 return 0; 1164 return 0;
1165 1165
1166 blkdev_put(bdev); 1166 blkdev_put(bdev, filp->f_mode);
1167 return res; 1167 return res;
1168} 1168}
1169 1169
1170static int __blkdev_put(struct block_device *bdev, int for_part) 1170static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
1171{ 1171{
1172 int ret = 0; 1172 int ret = 0;
1173 struct gendisk *disk = bdev->bd_disk; 1173 struct gendisk *disk = bdev->bd_disk;
@@ -1184,7 +1184,7 @@ static int __blkdev_put(struct block_device *bdev, int for_part)
1184 } 1184 }
1185 if (bdev->bd_contains == bdev) { 1185 if (bdev->bd_contains == bdev) {
1186 if (disk->fops->release) 1186 if (disk->fops->release)
1187 ret = disk->fops->release(disk, 0); 1187 ret = disk->fops->release(disk, mode);
1188 } 1188 }
1189 if (!bdev->bd_openers) { 1189 if (!bdev->bd_openers) {
1190 struct module *owner = disk->fops->owner; 1190 struct module *owner = disk->fops->owner;
@@ -1203,13 +1203,13 @@ static int __blkdev_put(struct block_device *bdev, int for_part)
1203 mutex_unlock(&bdev->bd_mutex); 1203 mutex_unlock(&bdev->bd_mutex);
1204 bdput(bdev); 1204 bdput(bdev);
1205 if (victim) 1205 if (victim)
1206 __blkdev_put(victim, 1); 1206 __blkdev_put(victim, mode, 1);
1207 return ret; 1207 return ret;
1208} 1208}
1209 1209
1210int blkdev_put(struct block_device *bdev) 1210int blkdev_put(struct block_device *bdev, fmode_t mode)
1211{ 1211{
1212 return __blkdev_put(bdev, 0); 1212 return __blkdev_put(bdev, mode, 0);
1213} 1213}
1214EXPORT_SYMBOL(blkdev_put); 1214EXPORT_SYMBOL(blkdev_put);
1215 1215
@@ -1218,7 +1218,7 @@ static int blkdev_close(struct inode * inode, struct file * filp)
1218 struct block_device *bdev = I_BDEV(filp->f_mapping->host); 1218 struct block_device *bdev = I_BDEV(filp->f_mapping->host);
1219 if (bdev->bd_holder == filp) 1219 if (bdev->bd_holder == filp)
1220 bd_release(bdev); 1220 bd_release(bdev);
1221 return blkdev_put(bdev); 1221 return blkdev_put(bdev, filp->f_mode);
1222} 1222}
1223 1223
1224static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg) 1224static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
@@ -1343,7 +1343,7 @@ struct block_device *open_bdev_excl(const char *path, int flags, void *holder)
1343 return bdev; 1343 return bdev;
1344 1344
1345blkdev_put: 1345blkdev_put:
1346 blkdev_put(bdev); 1346 blkdev_put(bdev, mode);
1347 return ERR_PTR(error); 1347 return ERR_PTR(error);
1348} 1348}
1349 1349
@@ -1359,7 +1359,7 @@ EXPORT_SYMBOL(open_bdev_excl);
1359void close_bdev_excl(struct block_device *bdev) 1359void close_bdev_excl(struct block_device *bdev)
1360{ 1360{
1361 bd_release(bdev); 1361 bd_release(bdev);
1362 blkdev_put(bdev); 1362 blkdev_put(bdev, 0); /* move up in the next patches */
1363} 1363}
1364 1364
1365EXPORT_SYMBOL(close_bdev_excl); 1365EXPORT_SYMBOL(close_bdev_excl);
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 3a260af5544d..15c38e69b694 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -347,7 +347,7 @@ fail:
347static int ext3_blkdev_put(struct block_device *bdev) 347static int ext3_blkdev_put(struct block_device *bdev)
348{ 348{
349 bd_release(bdev); 349 bd_release(bdev);
350 return blkdev_put(bdev); 350 return blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
351} 351}
352 352
353static int ext3_blkdev_remove(struct ext3_sb_info *sbi) 353static int ext3_blkdev_remove(struct ext3_sb_info *sbi)
@@ -2066,7 +2066,7 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb,
2066 if (bd_claim(bdev, sb)) { 2066 if (bd_claim(bdev, sb)) {
2067 printk(KERN_ERR 2067 printk(KERN_ERR
2068 "EXT3: failed to claim external journal device.\n"); 2068 "EXT3: failed to claim external journal device.\n");
2069 blkdev_put(bdev); 2069 blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
2070 return NULL; 2070 return NULL;
2071 } 2071 }
2072 2072
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 9b2b2bc4ec17..c12cf7a657a9 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -399,7 +399,7 @@ fail:
399static int ext4_blkdev_put(struct block_device *bdev) 399static int ext4_blkdev_put(struct block_device *bdev)
400{ 400{
401 bd_release(bdev); 401 bd_release(bdev);
402 return blkdev_put(bdev); 402 return blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
403} 403}
404 404
405static int ext4_blkdev_remove(struct ext4_sb_info *sbi) 405static int ext4_blkdev_remove(struct ext4_sb_info *sbi)
@@ -2553,7 +2553,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
2553 if (bd_claim(bdev, sb)) { 2553 if (bd_claim(bdev, sb)) {
2554 printk(KERN_ERR 2554 printk(KERN_ERR
2555 "EXT4: failed to claim external journal device.\n"); 2555 "EXT4: failed to claim external journal device.\n");
2556 blkdev_put(bdev); 2556 blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
2557 return NULL; 2557 return NULL;
2558 } 2558 }
2559 2559
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index cd2ec2988b59..335c4de6552d 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -1168,7 +1168,7 @@ journal_found:
1168 bd_release(bdev); 1168 bd_release(bdev);
1169 1169
1170 close: /* close external log device */ 1170 close: /* close external log device */
1171 blkdev_put(bdev); 1171 blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
1172 1172
1173 free: /* free log descriptor */ 1173 free: /* free log descriptor */
1174 mutex_unlock(&jfs_log_mutex); 1174 mutex_unlock(&jfs_log_mutex);
@@ -1514,7 +1514,7 @@ int lmLogClose(struct super_block *sb)
1514 rc = lmLogShutdown(log); 1514 rc = lmLogShutdown(log);
1515 1515
1516 bd_release(bdev); 1516 bd_release(bdev);
1517 blkdev_put(bdev); 1517 blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
1518 1518
1519 kfree(log); 1519 kfree(log);
1520 1520
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 7dce1612553e..4b6fdf591eed 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -976,7 +976,7 @@ static void o2hb_region_release(struct config_item *item)
976 } 976 }
977 977
978 if (reg->hr_bdev) 978 if (reg->hr_bdev)
979 blkdev_put(reg->hr_bdev); 979 blkdev_put(reg->hr_bdev, FMODE_READ|FMODE_WRITE);
980 980
981 if (reg->hr_slots) 981 if (reg->hr_slots)
982 kfree(reg->hr_slots); 982 kfree(reg->hr_slots);
@@ -1358,7 +1358,7 @@ out:
1358 iput(inode); 1358 iput(inode);
1359 if (ret < 0) { 1359 if (ret < 0) {
1360 if (reg->hr_bdev) { 1360 if (reg->hr_bdev) {
1361 blkdev_put(reg->hr_bdev); 1361 blkdev_put(reg->hr_bdev, FMODE_READ|FMODE_WRITE);
1362 reg->hr_bdev = NULL; 1362 reg->hr_bdev = NULL;
1363 } 1363 }
1364 } 1364 }
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index cfb0c80690aa..5a35ff2e1a9b 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -488,7 +488,7 @@ void register_disk(struct gendisk *disk)
488 err = blkdev_get(bdev, FMODE_READ, 0); 488 err = blkdev_get(bdev, FMODE_READ, 0);
489 if (err < 0) 489 if (err < 0)
490 goto exit; 490 goto exit;
491 blkdev_put(bdev); 491 blkdev_put(bdev, FMODE_READ);
492 492
493exit: 493exit:
494 /* announce disk after possible partitions are created */ 494 /* announce disk after possible partitions are created */
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index b89d193a00d9..3261518478f4 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -2575,7 +2575,7 @@ static int release_journal_dev(struct super_block *super,
2575 if (journal->j_dev_bd != NULL) { 2575 if (journal->j_dev_bd != NULL) {
2576 if (journal->j_dev_bd->bd_dev != super->s_dev) 2576 if (journal->j_dev_bd->bd_dev != super->s_dev)
2577 bd_release(journal->j_dev_bd); 2577 bd_release(journal->j_dev_bd);
2578 result = blkdev_put(journal->j_dev_bd); 2578 result = blkdev_put(journal->j_dev_bd, 0); /* move up */
2579 journal->j_dev_bd = NULL; 2579 journal->j_dev_bd = NULL;
2580 } 2580 }
2581 2581
@@ -2618,7 +2618,7 @@ static int journal_init_dev(struct super_block *super,
2618 } else if (jdev != super->s_dev) { 2618 } else if (jdev != super->s_dev) {
2619 result = bd_claim(journal->j_dev_bd, journal); 2619 result = bd_claim(journal->j_dev_bd, journal);
2620 if (result) { 2620 if (result) {
2621 blkdev_put(journal->j_dev_bd); 2621 blkdev_put(journal->j_dev_bd, blkdev_mode);
2622 return result; 2622 return result;
2623 } 2623 }
2624 2624