aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 18:14:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 18:14:53 -0400
commit292088ee032d0df59e7c8a7a00e9b97260146078 (patch)
tree99e5eee404285d4e2b6d282113cccee58236580f
parentbc2d968f0ec698c66750e0ad1c1d35568fe93c05 (diff)
parent254844d3b9959b52fedf2f22810cc66e82a1ca16 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs updates from Al Viro: "A couple of fixes + getting rid of __blkdev_put() return value" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: proc: Use PDE attribute setting accessor functions make blkdev_put() return void block_device_operations->release() should return void mtd_blktrans_ops->release() should return void hfs: SMP race on directory close()
-rw-r--r--arch/arm/mach-msm/last_radio_log.c2
-rw-r--r--arch/cris/kernel/profile.c2
-rw-r--r--arch/um/drivers/ubd_kern.c5
-rw-r--r--arch/xtensa/platforms/iss/simdisk.c3
-rw-r--r--drivers/block/amiflop.c3
-rw-r--r--drivers/block/aoe/aoeblk.c6
-rw-r--r--drivers/block/ataflop.c5
-rw-r--r--drivers/block/cciss.c5
-rw-r--r--drivers/block/cpqarray.c6
-rw-r--r--drivers/block/drbd/drbd_main.c5
-rw-r--r--drivers/block/floppy.c4
-rw-r--r--drivers/block/loop.c6
-rw-r--r--drivers/block/paride/pcd.c3
-rw-r--r--drivers/block/paride/pd.c4
-rw-r--r--drivers/block/paride/pf.c9
-rw-r--r--drivers/block/pktcdvd.c4
-rw-r--r--drivers/block/rbd.c4
-rw-r--r--drivers/block/swim.c4
-rw-r--r--drivers/block/swim3.c5
-rw-r--r--drivers/block/xen-blkfront.c3
-rw-r--r--drivers/block/xsysace.c3
-rw-r--r--drivers/block/z2ram.c6
-rw-r--r--drivers/cdrom/gdrom.c3
-rw-r--r--drivers/ide/ide-cd.c4
-rw-r--r--drivers/ide/ide-gd.c4
-rw-r--r--drivers/ide/ide-tape.c4
-rw-r--r--drivers/md/dm.c4
-rw-r--r--drivers/md/md.c4
-rw-r--r--drivers/memstick/core/mspro_block.c8
-rw-r--r--drivers/message/i2o/i2o_block.c8
-rw-r--r--drivers/mmc/card/block.c3
-rw-r--r--drivers/mtd/mtd_blkdevs.c9
-rw-r--r--drivers/mtd/mtdblock.c4
-rw-r--r--drivers/mtd/sm_ftl.c3
-rw-r--r--drivers/s390/block/dasd.c18
-rw-r--r--drivers/s390/block/dcssblk.c12
-rw-r--r--drivers/s390/block/scm_blk.c3
-rw-r--r--drivers/scsi/sd.c3
-rw-r--r--drivers/scsi/sr.c3
-rw-r--r--fs/block_dev.c16
-rw-r--r--fs/ext3/super.c11
-rw-r--r--fs/ext4/super.c11
-rw-r--r--fs/hfs/dir.c2
-rw-r--r--fs/nfs/blocklayout/blocklayout.h2
-rw-r--r--fs/nfs/blocklayout/blocklayoutdev.c4
-rw-r--r--fs/nfs/blocklayout/blocklayoutdm.c8
-rw-r--r--fs/reiserfs/journal.c16
-rw-r--r--include/linux/blkdev.h2
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/mtd/blktrans.h2
50 files changed, 93 insertions, 177 deletions
diff --git a/arch/arm/mach-msm/last_radio_log.c b/arch/arm/mach-msm/last_radio_log.c
index 7777767ee89a..9c392a29fc7e 100644
--- a/arch/arm/mach-msm/last_radio_log.c
+++ b/arch/arm/mach-msm/last_radio_log.c
@@ -66,6 +66,6 @@ void msm_init_last_radio_log(struct module *owner)
66 pr_err("%s: last radio log is %d bytes long\n", __func__, 66 pr_err("%s: last radio log is %d bytes long\n", __func__,
67 radio_log_size); 67 radio_log_size);
68 last_radio_log_fops.owner = owner; 68 last_radio_log_fops.owner = owner;
69 entry->size = radio_log_size; 69 proc_set_size(entry, radio_log_size);
70} 70}
71EXPORT_SYMBOL(msm_init_last_radio_log); 71EXPORT_SYMBOL(msm_init_last_radio_log);
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c
index b82e08615d1b..cd9f15b92f8f 100644
--- a/arch/cris/kernel/profile.c
+++ b/arch/cris/kernel/profile.c
@@ -76,7 +76,7 @@ static int __init init_cris_profile(void)
76 entry = proc_create("system_profile", S_IWUSR | S_IRUGO, NULL, 76 entry = proc_create("system_profile", S_IWUSR | S_IRUGO, NULL,
77 &cris_proc_profile_operations); 77 &cris_proc_profile_operations);
78 if (entry) { 78 if (entry) {
79 entry->size = SAMPLE_BUFFER_SIZE; 79 proc_set_size(entry, SAMPLE_BUFFER_SIZE);
80 } 80 }
81 prof_running = 1; 81 prof_running = 1;
82 82
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 41bf72073ccc..879990cb66c6 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -87,7 +87,7 @@ static DEFINE_MUTEX(ubd_lock);
87static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */ 87static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */
88 88
89static int ubd_open(struct block_device *bdev, fmode_t mode); 89static int ubd_open(struct block_device *bdev, fmode_t mode);
90static int ubd_release(struct gendisk *disk, fmode_t mode); 90static void ubd_release(struct gendisk *disk, fmode_t mode);
91static int ubd_ioctl(struct block_device *bdev, fmode_t mode, 91static int ubd_ioctl(struct block_device *bdev, fmode_t mode,
92 unsigned int cmd, unsigned long arg); 92 unsigned int cmd, unsigned long arg);
93static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); 93static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo);
@@ -1138,7 +1138,7 @@ out:
1138 return err; 1138 return err;
1139} 1139}
1140 1140
1141static int ubd_release(struct gendisk *disk, fmode_t mode) 1141static void ubd_release(struct gendisk *disk, fmode_t mode)
1142{ 1142{
1143 struct ubd *ubd_dev = disk->private_data; 1143 struct ubd *ubd_dev = disk->private_data;
1144 1144
@@ -1146,7 +1146,6 @@ static int ubd_release(struct gendisk *disk, fmode_t mode)
1146 if(--ubd_dev->count == 0) 1146 if(--ubd_dev->count == 0)
1147 ubd_close_dev(ubd_dev); 1147 ubd_close_dev(ubd_dev);
1148 mutex_unlock(&ubd_mutex); 1148 mutex_unlock(&ubd_mutex);
1149 return 0;
1150} 1149}
1151 1150
1152static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask, 1151static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask,
diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c
index 88608cc11b8c..0345f43d34f3 100644
--- a/arch/xtensa/platforms/iss/simdisk.c
+++ b/arch/xtensa/platforms/iss/simdisk.c
@@ -139,13 +139,12 @@ static int simdisk_open(struct block_device *bdev, fmode_t mode)
139 return 0; 139 return 0;
140} 140}
141 141
142static int simdisk_release(struct gendisk *disk, fmode_t mode) 142static void simdisk_release(struct gendisk *disk, fmode_t mode)
143{ 143{
144 struct simdisk *dev = disk->private_data; 144 struct simdisk *dev = disk->private_data;
145 spin_lock(&dev->lock); 145 spin_lock(&dev->lock);
146 --dev->users; 146 --dev->users;
147 spin_unlock(&dev->lock); 147 spin_unlock(&dev->lock);
148 return 0;
149} 148}
150 149
151static const struct block_device_operations simdisk_ops = { 150static const struct block_device_operations simdisk_ops = {
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 386146d792d1..4ff85b8785ee 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -1634,7 +1634,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
1634 return 0; 1634 return 0;
1635} 1635}
1636 1636
1637static int floppy_release(struct gendisk *disk, fmode_t mode) 1637static void floppy_release(struct gendisk *disk, fmode_t mode)
1638{ 1638{
1639 struct amiga_floppy_struct *p = disk->private_data; 1639 struct amiga_floppy_struct *p = disk->private_data;
1640 int drive = p - unit; 1640 int drive = p - unit;
@@ -1654,7 +1654,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)
1654 floppy_off (drive | 0x40000000); 1654 floppy_off (drive | 0x40000000);
1655#endif 1655#endif
1656 mutex_unlock(&amiflop_mutex); 1656 mutex_unlock(&amiflop_mutex);
1657 return 0;
1658} 1657}
1659 1658
1660/* 1659/*
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index a129f8c8073d..916d9ed5c8aa 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -169,7 +169,7 @@ aoeblk_open(struct block_device *bdev, fmode_t mode)
169 return -ENODEV; 169 return -ENODEV;
170} 170}
171 171
172static int 172static void
173aoeblk_release(struct gendisk *disk, fmode_t mode) 173aoeblk_release(struct gendisk *disk, fmode_t mode)
174{ 174{
175 struct aoedev *d = disk->private_data; 175 struct aoedev *d = disk->private_data;
@@ -180,11 +180,9 @@ aoeblk_release(struct gendisk *disk, fmode_t mode)
180 if (--d->nopen == 0) { 180 if (--d->nopen == 0) {
181 spin_unlock_irqrestore(&d->lock, flags); 181 spin_unlock_irqrestore(&d->lock, flags);
182 aoecmd_cfg(d->aoemajor, d->aoeminor); 182 aoecmd_cfg(d->aoemajor, d->aoeminor);
183 return 0; 183 return;
184 } 184 }
185 spin_unlock_irqrestore(&d->lock, flags); 185 spin_unlock_irqrestore(&d->lock, flags);
186
187 return 0;
188} 186}
189 187
190static void 188static void
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index ede16c64ff07..0e30c6e5492a 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -367,7 +367,7 @@ static void fd_probe( int drive );
367static int fd_test_drive_present( int drive ); 367static int fd_test_drive_present( int drive );
368static void config_types( void ); 368static void config_types( void );
369static int floppy_open(struct block_device *bdev, fmode_t mode); 369static int floppy_open(struct block_device *bdev, fmode_t mode);
370static int floppy_release(struct gendisk *disk, fmode_t mode); 370static void floppy_release(struct gendisk *disk, fmode_t mode);
371 371
372/************************* End of Prototypes **************************/ 372/************************* End of Prototypes **************************/
373 373
@@ -1886,7 +1886,7 @@ static int floppy_unlocked_open(struct block_device *bdev, fmode_t mode)
1886 return ret; 1886 return ret;
1887} 1887}
1888 1888
1889static int floppy_release(struct gendisk *disk, fmode_t mode) 1889static void floppy_release(struct gendisk *disk, fmode_t mode)
1890{ 1890{
1891 struct atari_floppy_struct *p = disk->private_data; 1891 struct atari_floppy_struct *p = disk->private_data;
1892 mutex_lock(&ataflop_mutex); 1892 mutex_lock(&ataflop_mutex);
@@ -1897,7 +1897,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)
1897 p->ref = 0; 1897 p->ref = 0;
1898 } 1898 }
1899 mutex_unlock(&ataflop_mutex); 1899 mutex_unlock(&ataflop_mutex);
1900 return 0;
1901} 1900}
1902 1901
1903static const struct block_device_operations floppy_fops = { 1902static const struct block_device_operations floppy_fops = {
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index e18c99140c0a..94b51c5e0678 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -161,7 +161,7 @@ static irqreturn_t do_cciss_intx(int irq, void *dev_id);
161static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id); 161static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id);
162static int cciss_open(struct block_device *bdev, fmode_t mode); 162static int cciss_open(struct block_device *bdev, fmode_t mode);
163static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode); 163static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode);
164static int cciss_release(struct gendisk *disk, fmode_t mode); 164static void cciss_release(struct gendisk *disk, fmode_t mode);
165static int do_ioctl(struct block_device *bdev, fmode_t mode, 165static int do_ioctl(struct block_device *bdev, fmode_t mode,
166 unsigned int cmd, unsigned long arg); 166 unsigned int cmd, unsigned long arg);
167static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 167static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
@@ -1123,7 +1123,7 @@ static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode)
1123/* 1123/*
1124 * Close. Sync first. 1124 * Close. Sync first.
1125 */ 1125 */
1126static int cciss_release(struct gendisk *disk, fmode_t mode) 1126static void cciss_release(struct gendisk *disk, fmode_t mode)
1127{ 1127{
1128 ctlr_info_t *h; 1128 ctlr_info_t *h;
1129 drive_info_struct *drv; 1129 drive_info_struct *drv;
@@ -1135,7 +1135,6 @@ static int cciss_release(struct gendisk *disk, fmode_t mode)
1135 drv->usage_count--; 1135 drv->usage_count--;
1136 h->usage_count--; 1136 h->usage_count--;
1137 mutex_unlock(&cciss_mutex); 1137 mutex_unlock(&cciss_mutex);
1138 return 0;
1139} 1138}
1140 1139
1141static int do_ioctl(struct block_device *bdev, fmode_t mode, 1140static int do_ioctl(struct block_device *bdev, fmode_t mode,
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 3b9e8ebcb96b..639d26b90b91 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -160,7 +160,7 @@ static int sendcmd(
160 unsigned int log_unit ); 160 unsigned int log_unit );
161 161
162static int ida_unlocked_open(struct block_device *bdev, fmode_t mode); 162static int ida_unlocked_open(struct block_device *bdev, fmode_t mode);
163static int ida_release(struct gendisk *disk, fmode_t mode); 163static void ida_release(struct gendisk *disk, fmode_t mode);
164static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg); 164static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg);
165static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo); 165static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo);
166static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io); 166static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io);
@@ -856,7 +856,7 @@ static int ida_unlocked_open(struct block_device *bdev, fmode_t mode)
856/* 856/*
857 * Close. Sync first. 857 * Close. Sync first.
858 */ 858 */
859static int ida_release(struct gendisk *disk, fmode_t mode) 859static void ida_release(struct gendisk *disk, fmode_t mode)
860{ 860{
861 ctlr_info_t *host; 861 ctlr_info_t *host;
862 862
@@ -864,8 +864,6 @@ static int ida_release(struct gendisk *disk, fmode_t mode)
864 host = get_host(disk); 864 host = get_host(disk);
865 host->usage_count--; 865 host->usage_count--;
866 mutex_unlock(&cpqarray_mutex); 866 mutex_unlock(&cpqarray_mutex);
867
868 return 0;
869} 867}
870 868
871/* 869/*
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index e98da675f0c1..298b868910dc 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -63,7 +63,7 @@ int drbd_asender(struct drbd_thread *);
63 63
64int drbd_init(void); 64int drbd_init(void);
65static int drbd_open(struct block_device *bdev, fmode_t mode); 65static int drbd_open(struct block_device *bdev, fmode_t mode);
66static int drbd_release(struct gendisk *gd, fmode_t mode); 66static void drbd_release(struct gendisk *gd, fmode_t mode);
67static int w_md_sync(struct drbd_work *w, int unused); 67static int w_md_sync(struct drbd_work *w, int unused);
68static void md_sync_timer_fn(unsigned long data); 68static void md_sync_timer_fn(unsigned long data);
69static int w_bitmap_io(struct drbd_work *w, int unused); 69static int w_bitmap_io(struct drbd_work *w, int unused);
@@ -1849,13 +1849,12 @@ static int drbd_open(struct block_device *bdev, fmode_t mode)
1849 return rv; 1849 return rv;
1850} 1850}
1851 1851
1852static int drbd_release(struct gendisk *gd, fmode_t mode) 1852static void drbd_release(struct gendisk *gd, fmode_t mode)
1853{ 1853{
1854 struct drbd_conf *mdev = gd->private_data; 1854 struct drbd_conf *mdev = gd->private_data;
1855 mutex_lock(&drbd_main_mutex); 1855 mutex_lock(&drbd_main_mutex);
1856 mdev->open_cnt--; 1856 mdev->open_cnt--;
1857 mutex_unlock(&drbd_main_mutex); 1857 mutex_unlock(&drbd_main_mutex);
1858 return 0;
1859} 1858}
1860 1859
1861static void drbd_set_defaults(struct drbd_conf *mdev) 1860static void drbd_set_defaults(struct drbd_conf *mdev)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 2ddd64a9ffde..c49e85608101 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3601,7 +3601,7 @@ static void __init config_types(void)
3601 pr_cont("\n"); 3601 pr_cont("\n");
3602} 3602}
3603 3603
3604static int floppy_release(struct gendisk *disk, fmode_t mode) 3604static void floppy_release(struct gendisk *disk, fmode_t mode)
3605{ 3605{
3606 int drive = (long)disk->private_data; 3606 int drive = (long)disk->private_data;
3607 3607
@@ -3615,8 +3615,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)
3615 opened_bdev[drive] = NULL; 3615 opened_bdev[drive] = NULL;
3616 mutex_unlock(&open_lock); 3616 mutex_unlock(&open_lock);
3617 mutex_unlock(&floppy_mutex); 3617 mutex_unlock(&floppy_mutex);
3618
3619 return 0;
3620} 3618}
3621 3619
3622/* 3620/*
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index b2955b3f2cbc..d92d50fd84b7 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1518,7 +1518,7 @@ out:
1518 return err; 1518 return err;
1519} 1519}
1520 1520
1521static int lo_release(struct gendisk *disk, fmode_t mode) 1521static void lo_release(struct gendisk *disk, fmode_t mode)
1522{ 1522{
1523 struct loop_device *lo = disk->private_data; 1523 struct loop_device *lo = disk->private_data;
1524 int err; 1524 int err;
@@ -1535,7 +1535,7 @@ static int lo_release(struct gendisk *disk, fmode_t mode)
1535 */ 1535 */
1536 err = loop_clr_fd(lo); 1536 err = loop_clr_fd(lo);
1537 if (!err) 1537 if (!err)
1538 goto out_unlocked; 1538 return;
1539 } else { 1539 } else {
1540 /* 1540 /*
1541 * Otherwise keep thread (if running) and config, 1541 * Otherwise keep thread (if running) and config,
@@ -1546,8 +1546,6 @@ static int lo_release(struct gendisk *disk, fmode_t mode)
1546 1546
1547out: 1547out:
1548 mutex_unlock(&lo->lo_ctl_mutex); 1548 mutex_unlock(&lo->lo_ctl_mutex);
1549out_unlocked:
1550 return 0;
1551} 1549}
1552 1550
1553static const struct block_device_operations lo_fops = { 1551static const struct block_device_operations lo_fops = {
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index ba2b6b5e5910..e76bdc074dbe 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -236,13 +236,12 @@ static int pcd_block_open(struct block_device *bdev, fmode_t mode)
236 return ret; 236 return ret;
237} 237}
238 238
239static int pcd_block_release(struct gendisk *disk, fmode_t mode) 239static void pcd_block_release(struct gendisk *disk, fmode_t mode)
240{ 240{
241 struct pcd_unit *cd = disk->private_data; 241 struct pcd_unit *cd = disk->private_data;
242 mutex_lock(&pcd_mutex); 242 mutex_lock(&pcd_mutex);
243 cdrom_release(&cd->info, mode); 243 cdrom_release(&cd->info, mode);
244 mutex_unlock(&pcd_mutex); 244 mutex_unlock(&pcd_mutex);
245 return 0;
246} 245}
247 246
248static int pcd_block_ioctl(struct block_device *bdev, fmode_t mode, 247static int pcd_block_ioctl(struct block_device *bdev, fmode_t mode,
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 831e3ac156e6..19ad8f0c83ef 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -783,7 +783,7 @@ static int pd_ioctl(struct block_device *bdev, fmode_t mode,
783 } 783 }
784} 784}
785 785
786static int pd_release(struct gendisk *p, fmode_t mode) 786static void pd_release(struct gendisk *p, fmode_t mode)
787{ 787{
788 struct pd_unit *disk = p->private_data; 788 struct pd_unit *disk = p->private_data;
789 789
@@ -791,8 +791,6 @@ static int pd_release(struct gendisk *p, fmode_t mode)
791 if (!--disk->access && disk->removable) 791 if (!--disk->access && disk->removable)
792 pd_special_command(disk, pd_door_unlock); 792 pd_special_command(disk, pd_door_unlock);
793 mutex_unlock(&pd_mutex); 793 mutex_unlock(&pd_mutex);
794
795 return 0;
796} 794}
797 795
798static unsigned int pd_check_events(struct gendisk *p, unsigned int clearing) 796static unsigned int pd_check_events(struct gendisk *p, unsigned int clearing)
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index ec8f9ed6326e..f5c86d523ba0 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -211,7 +211,7 @@ static int pf_ioctl(struct block_device *bdev, fmode_t mode,
211 unsigned int cmd, unsigned long arg); 211 unsigned int cmd, unsigned long arg);
212static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo); 212static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo);
213 213
214static int pf_release(struct gendisk *disk, fmode_t mode); 214static void pf_release(struct gendisk *disk, fmode_t mode);
215 215
216static int pf_detect(void); 216static int pf_detect(void);
217static void do_pf_read(void); 217static void do_pf_read(void);
@@ -360,14 +360,15 @@ static int pf_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, u
360 return 0; 360 return 0;
361} 361}
362 362
363static int pf_release(struct gendisk *disk, fmode_t mode) 363static void pf_release(struct gendisk *disk, fmode_t mode)
364{ 364{
365 struct pf_unit *pf = disk->private_data; 365 struct pf_unit *pf = disk->private_data;
366 366
367 mutex_lock(&pf_mutex); 367 mutex_lock(&pf_mutex);
368 if (pf->access <= 0) { 368 if (pf->access <= 0) {
369 mutex_unlock(&pf_mutex); 369 mutex_unlock(&pf_mutex);
370 return -EINVAL; 370 WARN_ON(1);
371 return;
371 } 372 }
372 373
373 pf->access--; 374 pf->access--;
@@ -376,8 +377,6 @@ static int pf_release(struct gendisk *disk, fmode_t mode)
376 pf_lock(pf, 0); 377 pf_lock(pf, 0);
377 378
378 mutex_unlock(&pf_mutex); 379 mutex_unlock(&pf_mutex);
379 return 0;
380
381} 380}
382 381
383static unsigned int pf_check_events(struct gendisk *disk, unsigned int clearing) 382static unsigned int pf_check_events(struct gendisk *disk, unsigned int clearing)
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index e0588c6dd86f..9f2d348f7115 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2376,10 +2376,9 @@ out:
2376 return ret; 2376 return ret;
2377} 2377}
2378 2378
2379static int pkt_close(struct gendisk *disk, fmode_t mode) 2379static void pkt_close(struct gendisk *disk, fmode_t mode)
2380{ 2380{
2381 struct pktcdvd_device *pd = disk->private_data; 2381 struct pktcdvd_device *pd = disk->private_data;
2382 int ret = 0;
2383 2382
2384 mutex_lock(&pktcdvd_mutex); 2383 mutex_lock(&pktcdvd_mutex);
2385 mutex_lock(&ctl_mutex); 2384 mutex_lock(&ctl_mutex);
@@ -2391,7 +2390,6 @@ static int pkt_close(struct gendisk *disk, fmode_t mode)
2391 } 2390 }
2392 mutex_unlock(&ctl_mutex); 2391 mutex_unlock(&ctl_mutex);
2393 mutex_unlock(&pktcdvd_mutex); 2392 mutex_unlock(&pktcdvd_mutex);
2394 return ret;
2395} 2393}
2396 2394
2397 2395
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index c2ca1818f335..22ffd5dcb168 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -460,7 +460,7 @@ static int rbd_open(struct block_device *bdev, fmode_t mode)
460 return 0; 460 return 0;
461} 461}
462 462
463static int rbd_release(struct gendisk *disk, fmode_t mode) 463static void rbd_release(struct gendisk *disk, fmode_t mode)
464{ 464{
465 struct rbd_device *rbd_dev = disk->private_data; 465 struct rbd_device *rbd_dev = disk->private_data;
466 unsigned long open_count_before; 466 unsigned long open_count_before;
@@ -473,8 +473,6 @@ static int rbd_release(struct gendisk *disk, fmode_t mode)
473 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); 473 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
474 put_device(&rbd_dev->dev); 474 put_device(&rbd_dev->dev);
475 mutex_unlock(&ctl_mutex); 475 mutex_unlock(&ctl_mutex);
476
477 return 0;
478} 476}
479 477
480static const struct block_device_operations rbd_bd_ops = { 478static const struct block_device_operations rbd_bd_ops = {
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 8766a2257091..2f445b7a174e 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -673,7 +673,7 @@ static int floppy_unlocked_open(struct block_device *bdev, fmode_t mode)
673 return ret; 673 return ret;
674} 674}
675 675
676static int floppy_release(struct gendisk *disk, fmode_t mode) 676static void floppy_release(struct gendisk *disk, fmode_t mode)
677{ 677{
678 struct floppy_state *fs = disk->private_data; 678 struct floppy_state *fs = disk->private_data;
679 struct swim __iomem *base = fs->swd->base; 679 struct swim __iomem *base = fs->swd->base;
@@ -687,8 +687,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)
687 if (fs->ref_count == 0) 687 if (fs->ref_count == 0)
688 swim_motor(base, OFF); 688 swim_motor(base, OFF);
689 mutex_unlock(&swim_mutex); 689 mutex_unlock(&swim_mutex);
690
691 return 0;
692} 690}
693 691
694static int floppy_ioctl(struct block_device *bdev, fmode_t mode, 692static int floppy_ioctl(struct block_device *bdev, fmode_t mode,
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 758f2ac878cf..20e061c3e023 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -251,7 +251,7 @@ static int fd_eject(struct floppy_state *fs);
251static int floppy_ioctl(struct block_device *bdev, fmode_t mode, 251static int floppy_ioctl(struct block_device *bdev, fmode_t mode,
252 unsigned int cmd, unsigned long param); 252 unsigned int cmd, unsigned long param);
253static int floppy_open(struct block_device *bdev, fmode_t mode); 253static int floppy_open(struct block_device *bdev, fmode_t mode);
254static int floppy_release(struct gendisk *disk, fmode_t mode); 254static void floppy_release(struct gendisk *disk, fmode_t mode);
255static unsigned int floppy_check_events(struct gendisk *disk, 255static unsigned int floppy_check_events(struct gendisk *disk,
256 unsigned int clearing); 256 unsigned int clearing);
257static int floppy_revalidate(struct gendisk *disk); 257static int floppy_revalidate(struct gendisk *disk);
@@ -1017,7 +1017,7 @@ static int floppy_unlocked_open(struct block_device *bdev, fmode_t mode)
1017 return ret; 1017 return ret;
1018} 1018}
1019 1019
1020static int floppy_release(struct gendisk *disk, fmode_t mode) 1020static void floppy_release(struct gendisk *disk, fmode_t mode)
1021{ 1021{
1022 struct floppy_state *fs = disk->private_data; 1022 struct floppy_state *fs = disk->private_data;
1023 struct swim3 __iomem *sw = fs->swim3; 1023 struct swim3 __iomem *sw = fs->swim3;
@@ -1029,7 +1029,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)
1029 swim3_select(fs, RELAX); 1029 swim3_select(fs, RELAX);
1030 } 1030 }
1031 mutex_unlock(&swim3_mutex); 1031 mutex_unlock(&swim3_mutex);
1032 return 0;
1033} 1032}
1034 1033
1035static unsigned int floppy_check_events(struct gendisk *disk, 1034static unsigned int floppy_check_events(struct gendisk *disk,
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index a894f88762d8..d89ef86220f4 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1617,7 +1617,7 @@ out:
1617 return err; 1617 return err;
1618} 1618}
1619 1619
1620static int blkif_release(struct gendisk *disk, fmode_t mode) 1620static void blkif_release(struct gendisk *disk, fmode_t mode)
1621{ 1621{
1622 struct blkfront_info *info = disk->private_data; 1622 struct blkfront_info *info = disk->private_data;
1623 struct block_device *bdev; 1623 struct block_device *bdev;
@@ -1658,7 +1658,6 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)
1658out: 1658out:
1659 bdput(bdev); 1659 bdput(bdev);
1660 mutex_unlock(&blkfront_mutex); 1660 mutex_unlock(&blkfront_mutex);
1661 return 0;
1662} 1661}
1663 1662
1664static const struct block_device_operations xlvbd_block_fops = 1663static const struct block_device_operations xlvbd_block_fops =
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 1f38643173ca..f8ef15f37c5e 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -915,7 +915,7 @@ static int ace_open(struct block_device *bdev, fmode_t mode)
915 return 0; 915 return 0;
916} 916}
917 917
918static int ace_release(struct gendisk *disk, fmode_t mode) 918static void ace_release(struct gendisk *disk, fmode_t mode)
919{ 919{
920 struct ace_device *ace = disk->private_data; 920 struct ace_device *ace = disk->private_data;
921 unsigned long flags; 921 unsigned long flags;
@@ -932,7 +932,6 @@ static int ace_release(struct gendisk *disk, fmode_t mode)
932 } 932 }
933 spin_unlock_irqrestore(&ace->lock, flags); 933 spin_unlock_irqrestore(&ace->lock, flags);
934 mutex_unlock(&xsysace_mutex); 934 mutex_unlock(&xsysace_mutex);
935 return 0;
936} 935}
937 936
938static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo) 937static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index a22e3f895947..5a95baf4b104 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -309,20 +309,18 @@ err_out:
309 return rc; 309 return rc;
310} 310}
311 311
312static int 312static void
313z2_release(struct gendisk *disk, fmode_t mode) 313z2_release(struct gendisk *disk, fmode_t mode)
314{ 314{
315 mutex_lock(&z2ram_mutex); 315 mutex_lock(&z2ram_mutex);
316 if ( current_device == -1 ) { 316 if ( current_device == -1 ) {
317 mutex_unlock(&z2ram_mutex); 317 mutex_unlock(&z2ram_mutex);
318 return 0; 318 return;
319 } 319 }
320 mutex_unlock(&z2ram_mutex); 320 mutex_unlock(&z2ram_mutex);
321 /* 321 /*
322 * FIXME: unmap memory 322 * FIXME: unmap memory
323 */ 323 */
324
325 return 0;
326} 324}
327 325
328static const struct block_device_operations z2_fops = 326static const struct block_device_operations z2_fops =
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index d59cdcb8fe39..4afcb65cc623 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -503,12 +503,11 @@ static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode)
503 return ret; 503 return ret;
504} 504}
505 505
506static int gdrom_bdops_release(struct gendisk *disk, fmode_t mode) 506static void gdrom_bdops_release(struct gendisk *disk, fmode_t mode)
507{ 507{
508 mutex_lock(&gdrom_mutex); 508 mutex_lock(&gdrom_mutex);
509 cdrom_release(gd.cd_info, mode); 509 cdrom_release(gd.cd_info, mode);
510 mutex_unlock(&gdrom_mutex); 510 mutex_unlock(&gdrom_mutex);
511 return 0;
512} 511}
513 512
514static unsigned int gdrom_bdops_check_events(struct gendisk *disk, 513static unsigned int gdrom_bdops_check_events(struct gendisk *disk,
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index b23113926388..2ff620444930 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1606,7 +1606,7 @@ out:
1606 return rc; 1606 return rc;
1607} 1607}
1608 1608
1609static int idecd_release(struct gendisk *disk, fmode_t mode) 1609static void idecd_release(struct gendisk *disk, fmode_t mode)
1610{ 1610{
1611 struct cdrom_info *info = ide_drv_g(disk, cdrom_info); 1611 struct cdrom_info *info = ide_drv_g(disk, cdrom_info);
1612 1612
@@ -1615,8 +1615,6 @@ static int idecd_release(struct gendisk *disk, fmode_t mode)
1615 1615
1616 ide_cd_put(info); 1616 ide_cd_put(info);
1617 mutex_unlock(&ide_cd_mutex); 1617 mutex_unlock(&ide_cd_mutex);
1618
1619 return 0;
1620} 1618}
1621 1619
1622static int idecd_set_spindown(struct cdrom_device_info *cdi, unsigned long arg) 1620static int idecd_set_spindown(struct cdrom_device_info *cdi, unsigned long arg)
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index 70ea8763567d..de86631e767d 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -250,7 +250,7 @@ static int ide_gd_unlocked_open(struct block_device *bdev, fmode_t mode)
250} 250}
251 251
252 252
253static int ide_gd_release(struct gendisk *disk, fmode_t mode) 253static void ide_gd_release(struct gendisk *disk, fmode_t mode)
254{ 254{
255 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); 255 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
256 ide_drive_t *drive = idkp->drive; 256 ide_drive_t *drive = idkp->drive;
@@ -270,8 +270,6 @@ static int ide_gd_release(struct gendisk *disk, fmode_t mode)
270 270
271 ide_disk_put(idkp); 271 ide_disk_put(idkp);
272 mutex_unlock(&ide_gd_mutex); 272 mutex_unlock(&ide_gd_mutex);
273
274 return 0;
275} 273}
276 274
277static int ide_gd_getgeo(struct block_device *bdev, struct hd_geometry *geo) 275static int ide_gd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 89f859591bbb..c6c574bd5f59 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1918,15 +1918,13 @@ static int idetape_open(struct block_device *bdev, fmode_t mode)
1918 return 0; 1918 return 0;
1919} 1919}
1920 1920
1921static int idetape_release(struct gendisk *disk, fmode_t mode) 1921static void idetape_release(struct gendisk *disk, fmode_t mode)
1922{ 1922{
1923 struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); 1923 struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj);
1924 1924
1925 mutex_lock(&ide_tape_mutex); 1925 mutex_lock(&ide_tape_mutex);
1926 ide_tape_put(tape); 1926 ide_tape_put(tape);
1927 mutex_unlock(&ide_tape_mutex); 1927 mutex_unlock(&ide_tape_mutex);
1928
1929 return 0;
1930} 1928}
1931 1929
1932static int idetape_ioctl(struct block_device *bdev, fmode_t mode, 1930static int idetape_ioctl(struct block_device *bdev, fmode_t mode,
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 9a0bdad9ad8f..d5370a94b2c1 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -339,7 +339,7 @@ out:
339 return md ? 0 : -ENXIO; 339 return md ? 0 : -ENXIO;
340} 340}
341 341
342static int dm_blk_close(struct gendisk *disk, fmode_t mode) 342static void dm_blk_close(struct gendisk *disk, fmode_t mode)
343{ 343{
344 struct mapped_device *md = disk->private_data; 344 struct mapped_device *md = disk->private_data;
345 345
@@ -349,8 +349,6 @@ static int dm_blk_close(struct gendisk *disk, fmode_t mode)
349 dm_put(md); 349 dm_put(md);
350 350
351 spin_unlock(&_minor_lock); 351 spin_unlock(&_minor_lock);
352
353 return 0;
354} 352}
355 353
356int dm_open_count(struct mapped_device *md) 354int dm_open_count(struct mapped_device *md)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4c74424c78b0..6330c727396c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6674,15 +6674,13 @@ static int md_open(struct block_device *bdev, fmode_t mode)
6674 return err; 6674 return err;
6675} 6675}
6676 6676
6677static int md_release(struct gendisk *disk, fmode_t mode) 6677static void md_release(struct gendisk *disk, fmode_t mode)
6678{ 6678{
6679 struct mddev *mddev = disk->private_data; 6679 struct mddev *mddev = disk->private_data;
6680 6680
6681 BUG_ON(!mddev); 6681 BUG_ON(!mddev);
6682 atomic_dec(&mddev->openers); 6682 atomic_dec(&mddev->openers);
6683 mddev_put(mddev); 6683 mddev_put(mddev);
6684
6685 return 0;
6686} 6684}
6687 6685
6688static int md_media_changed(struct gendisk *disk) 6686static int md_media_changed(struct gendisk *disk)
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index f12b78dbce04..f4176ca3a794 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -204,7 +204,7 @@ static int mspro_block_bd_open(struct block_device *bdev, fmode_t mode)
204} 204}
205 205
206 206
207static int mspro_block_disk_release(struct gendisk *disk) 207static void mspro_block_disk_release(struct gendisk *disk)
208{ 208{
209 struct mspro_block_data *msb = disk->private_data; 209 struct mspro_block_data *msb = disk->private_data;
210 int disk_id = MINOR(disk_devt(disk)) >> MSPRO_BLOCK_PART_SHIFT; 210 int disk_id = MINOR(disk_devt(disk)) >> MSPRO_BLOCK_PART_SHIFT;
@@ -224,13 +224,11 @@ static int mspro_block_disk_release(struct gendisk *disk)
224 } 224 }
225 225
226 mutex_unlock(&mspro_block_disk_lock); 226 mutex_unlock(&mspro_block_disk_lock);
227
228 return 0;
229} 227}
230 228
231static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode) 229static void mspro_block_bd_release(struct gendisk *disk, fmode_t mode)
232{ 230{
233 return mspro_block_disk_release(disk); 231 mspro_block_disk_release(disk);
234} 232}
235 233
236static int mspro_block_bd_getgeo(struct block_device *bdev, 234static int mspro_block_bd_getgeo(struct block_device *bdev,
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 49e86aed2bc4..6fc3866965df 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -600,10 +600,8 @@ static int i2o_block_open(struct block_device *bdev, fmode_t mode)
600 * 600 *
601 * Unlock and unmount the media, and power down the device. Gets called if 601 * Unlock and unmount the media, and power down the device. Gets called if
602 * the block device is closed. 602 * the block device is closed.
603 *
604 * Returns 0 on success or negative error code on failure.
605 */ 603 */
606static int i2o_block_release(struct gendisk *disk, fmode_t mode) 604static void i2o_block_release(struct gendisk *disk, fmode_t mode)
607{ 605{
608 struct i2o_block_device *dev = disk->private_data; 606 struct i2o_block_device *dev = disk->private_data;
609 u8 operation; 607 u8 operation;
@@ -617,7 +615,7 @@ static int i2o_block_release(struct gendisk *disk, fmode_t mode)
617 * the TID no longer exists. 615 * the TID no longer exists.
618 */ 616 */
619 if (!dev->i2o_dev) 617 if (!dev->i2o_dev)
620 return 0; 618 return;
621 619
622 mutex_lock(&i2o_block_mutex); 620 mutex_lock(&i2o_block_mutex);
623 i2o_block_device_flush(dev->i2o_dev); 621 i2o_block_device_flush(dev->i2o_dev);
@@ -631,8 +629,6 @@ static int i2o_block_release(struct gendisk *disk, fmode_t mode)
631 629
632 i2o_block_device_power(dev, operation); 630 i2o_block_device_power(dev, operation);
633 mutex_unlock(&i2o_block_mutex); 631 mutex_unlock(&i2o_block_mutex);
634
635 return 0;
636} 632}
637 633
638static int i2o_block_getgeo(struct block_device *bdev, struct hd_geometry *geo) 634static int i2o_block_getgeo(struct block_device *bdev, struct hd_geometry *geo)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e12a03cc2a6e..dd27b0783d52 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -304,14 +304,13 @@ static int mmc_blk_open(struct block_device *bdev, fmode_t mode)
304 return ret; 304 return ret;
305} 305}
306 306
307static int mmc_blk_release(struct gendisk *disk, fmode_t mode) 307static void mmc_blk_release(struct gendisk *disk, fmode_t mode)
308{ 308{
309 struct mmc_blk_data *md = disk->private_data; 309 struct mmc_blk_data *md = disk->private_data;
310 310
311 mutex_lock(&block_mutex); 311 mutex_lock(&block_mutex);
312 mmc_blk_put(md); 312 mmc_blk_put(md);
313 mutex_unlock(&block_mutex); 313 mutex_unlock(&block_mutex);
314 return 0;
315} 314}
316 315
317static int 316static int
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 5ad39bb5ab4c..5073cbc796d8 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -237,13 +237,12 @@ error_put:
237 return ret; 237 return ret;
238} 238}
239 239
240static int blktrans_release(struct gendisk *disk, fmode_t mode) 240static void blktrans_release(struct gendisk *disk, fmode_t mode)
241{ 241{
242 struct mtd_blktrans_dev *dev = blktrans_dev_get(disk); 242 struct mtd_blktrans_dev *dev = blktrans_dev_get(disk);
243 int ret = 0;
244 243
245 if (!dev) 244 if (!dev)
246 return ret; 245 return;
247 246
248 mutex_lock(&dev->lock); 247 mutex_lock(&dev->lock);
249 248
@@ -254,13 +253,13 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode)
254 module_put(dev->tr->owner); 253 module_put(dev->tr->owner);
255 254
256 if (dev->mtd) { 255 if (dev->mtd) {
257 ret = dev->tr->release ? dev->tr->release(dev) : 0; 256 if (dev->tr->release)
257 dev->tr->release(dev);
258 __put_mtd_device(dev->mtd); 258 __put_mtd_device(dev->mtd);
259 } 259 }
260unlock: 260unlock:
261 mutex_unlock(&dev->lock); 261 mutex_unlock(&dev->lock);
262 blktrans_dev_put(dev); 262 blktrans_dev_put(dev);
263 return ret;
264} 263}
265 264
266static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo) 265static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo)
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index 6c6d80736fad..2aef5dda522b 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -308,7 +308,7 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)
308 return 0; 308 return 0;
309} 309}
310 310
311static int mtdblock_release(struct mtd_blktrans_dev *mbd) 311static void mtdblock_release(struct mtd_blktrans_dev *mbd)
312{ 312{
313 struct mtdblk_dev *mtdblk = container_of(mbd, struct mtdblk_dev, mbd); 313 struct mtdblk_dev *mtdblk = container_of(mbd, struct mtdblk_dev, mbd);
314 314
@@ -333,8 +333,6 @@ static int mtdblock_release(struct mtd_blktrans_dev *mbd)
333 mutex_unlock(&mtdblks_lock); 333 mutex_unlock(&mtdblks_lock);
334 334
335 pr_debug("ok\n"); 335 pr_debug("ok\n");
336
337 return 0;
338} 336}
339 337
340static int mtdblock_flush(struct mtd_blktrans_dev *dev) 338static int mtdblock_flush(struct mtd_blktrans_dev *dev)
diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c
index 8dd6ba52404a..f9d5615c5727 100644
--- a/drivers/mtd/sm_ftl.c
+++ b/drivers/mtd/sm_ftl.c
@@ -1107,7 +1107,7 @@ static int sm_flush(struct mtd_blktrans_dev *dev)
1107} 1107}
1108 1108
1109/* outside interface: device is released */ 1109/* outside interface: device is released */
1110static int sm_release(struct mtd_blktrans_dev *dev) 1110static void sm_release(struct mtd_blktrans_dev *dev)
1111{ 1111{
1112 struct sm_ftl *ftl = dev->priv; 1112 struct sm_ftl *ftl = dev->priv;
1113 1113
@@ -1116,7 +1116,6 @@ static int sm_release(struct mtd_blktrans_dev *dev)
1116 cancel_work_sync(&ftl->flush_work); 1116 cancel_work_sync(&ftl->flush_work);
1117 sm_cache_flush(ftl); 1117 sm_cache_flush(ftl);
1118 mutex_unlock(&ftl->mutex); 1118 mutex_unlock(&ftl->mutex);
1119 return 0;
1120} 1119}
1121 1120
1122/* outside interface: get geometry */ 1121/* outside interface: get geometry */
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 82758cbb220b..4361d9772c42 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -2997,18 +2997,14 @@ unlock:
2997 return rc; 2997 return rc;
2998} 2998}
2999 2999
3000static int dasd_release(struct gendisk *disk, fmode_t mode) 3000static void dasd_release(struct gendisk *disk, fmode_t mode)
3001{ 3001{
3002 struct dasd_device *base; 3002 struct dasd_device *base = dasd_device_from_gendisk(disk);
3003 3003 if (base) {
3004 base = dasd_device_from_gendisk(disk); 3004 atomic_dec(&base->block->open_count);
3005 if (!base) 3005 module_put(base->discipline->owner);
3006 return -ENODEV; 3006 dasd_put_device(base);
3007 3007 }
3008 atomic_dec(&base->block->open_count);
3009 module_put(base->discipline->owner);
3010 dasd_put_device(base);
3011 return 0;
3012} 3008}
3013 3009
3014/* 3010/*
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index b6ad0de07930..07ba32b07fb0 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -26,7 +26,7 @@
26#define DCSS_BUS_ID_SIZE 20 26#define DCSS_BUS_ID_SIZE 20
27 27
28static int dcssblk_open(struct block_device *bdev, fmode_t mode); 28static int dcssblk_open(struct block_device *bdev, fmode_t mode);
29static int dcssblk_release(struct gendisk *disk, fmode_t mode); 29static void dcssblk_release(struct gendisk *disk, fmode_t mode);
30static void dcssblk_make_request(struct request_queue *q, struct bio *bio); 30static void dcssblk_make_request(struct request_queue *q, struct bio *bio);
31static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, 31static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum,
32 void **kaddr, unsigned long *pfn); 32 void **kaddr, unsigned long *pfn);
@@ -781,16 +781,15 @@ out:
781 return rc; 781 return rc;
782} 782}
783 783
784static int 784static void
785dcssblk_release(struct gendisk *disk, fmode_t mode) 785dcssblk_release(struct gendisk *disk, fmode_t mode)
786{ 786{
787 struct dcssblk_dev_info *dev_info = disk->private_data; 787 struct dcssblk_dev_info *dev_info = disk->private_data;
788 struct segment_info *entry; 788 struct segment_info *entry;
789 int rc;
790 789
791 if (!dev_info) { 790 if (!dev_info) {
792 rc = -ENODEV; 791 WARN_ON(1);
793 goto out; 792 return;
794 } 793 }
795 down_write(&dcssblk_devices_sem); 794 down_write(&dcssblk_devices_sem);
796 if (atomic_dec_and_test(&dev_info->use_count) 795 if (atomic_dec_and_test(&dev_info->use_count)
@@ -803,9 +802,6 @@ dcssblk_release(struct gendisk *disk, fmode_t mode)
803 dev_info->save_pending = 0; 802 dev_info->save_pending = 0;
804 } 803 }
805 up_write(&dcssblk_devices_sem); 804 up_write(&dcssblk_devices_sem);
806 rc = 0;
807out:
808 return rc;
809} 805}
810 806
811static void 807static void
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index b303cab76a7f..5d73e6e49af6 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -123,10 +123,9 @@ static int scm_open(struct block_device *blkdev, fmode_t mode)
123 return scm_get_ref(); 123 return scm_get_ref();
124} 124}
125 125
126static int scm_release(struct gendisk *gendisk, fmode_t mode) 126static void scm_release(struct gendisk *gendisk, fmode_t mode)
127{ 127{
128 scm_put_ref(); 128 scm_put_ref();
129 return 0;
130} 129}
131 130
132static const struct block_device_operations scm_blk_devops = { 131static const struct block_device_operations scm_blk_devops = {
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 7992635d405f..e6689776b4f6 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1188,7 +1188,7 @@ error_autopm:
1188 * 1188 *
1189 * Locking: called with bdev->bd_mutex held. 1189 * Locking: called with bdev->bd_mutex held.
1190 **/ 1190 **/
1191static int sd_release(struct gendisk *disk, fmode_t mode) 1191static void sd_release(struct gendisk *disk, fmode_t mode)
1192{ 1192{
1193 struct scsi_disk *sdkp = scsi_disk(disk); 1193 struct scsi_disk *sdkp = scsi_disk(disk);
1194 struct scsi_device *sdev = sdkp->device; 1194 struct scsi_device *sdev = sdkp->device;
@@ -1207,7 +1207,6 @@ static int sd_release(struct gendisk *disk, fmode_t mode)
1207 1207
1208 scsi_autopm_put_device(sdev); 1208 scsi_autopm_put_device(sdev);
1209 scsi_disk_put(sdkp); 1209 scsi_disk_put(sdkp);
1210 return 0;
1211} 1210}
1212 1211
1213static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo) 1212static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index f2884ee90710..119d67f9c47e 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -541,14 +541,13 @@ static int sr_block_open(struct block_device *bdev, fmode_t mode)
541 return ret; 541 return ret;
542} 542}
543 543
544static int sr_block_release(struct gendisk *disk, fmode_t mode) 544static void sr_block_release(struct gendisk *disk, fmode_t mode)
545{ 545{
546 struct scsi_cd *cd = scsi_cd(disk); 546 struct scsi_cd *cd = scsi_cd(disk);
547 mutex_lock(&sr_mutex); 547 mutex_lock(&sr_mutex);
548 cdrom_release(&cd->cdi, mode); 548 cdrom_release(&cd->cdi, mode);
549 scsi_cd_put(cd); 549 scsi_cd_put(cd);
550 mutex_unlock(&sr_mutex); 550 mutex_unlock(&sr_mutex);
551 return 0;
552} 551}
553 552
554static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, 553static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
diff --git a/fs/block_dev.c b/fs/block_dev.c
index ce08de7467a3..3823d3ffb760 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1045,7 +1045,7 @@ void bd_set_size(struct block_device *bdev, loff_t size)
1045} 1045}
1046EXPORT_SYMBOL(bd_set_size); 1046EXPORT_SYMBOL(bd_set_size);
1047 1047
1048static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part); 1048static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
1049 1049
1050/* 1050/*
1051 * bd_mutex locking: 1051 * bd_mutex locking:
@@ -1400,9 +1400,8 @@ static int blkdev_open(struct inode * inode, struct file * filp)
1400 return blkdev_get(bdev, filp->f_mode, filp); 1400 return blkdev_get(bdev, filp->f_mode, filp);
1401} 1401}
1402 1402
1403static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part) 1403static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
1404{ 1404{
1405 int ret = 0;
1406 struct gendisk *disk = bdev->bd_disk; 1405 struct gendisk *disk = bdev->bd_disk;
1407 struct block_device *victim = NULL; 1406 struct block_device *victim = NULL;
1408 1407
@@ -1422,7 +1421,7 @@ static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
1422 } 1421 }
1423 if (bdev->bd_contains == bdev) { 1422 if (bdev->bd_contains == bdev) {
1424 if (disk->fops->release) 1423 if (disk->fops->release)
1425 ret = disk->fops->release(disk, mode); 1424 disk->fops->release(disk, mode);
1426 } 1425 }
1427 if (!bdev->bd_openers) { 1426 if (!bdev->bd_openers) {
1428 struct module *owner = disk->fops->owner; 1427 struct module *owner = disk->fops->owner;
@@ -1441,10 +1440,9 @@ static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
1441 bdput(bdev); 1440 bdput(bdev);
1442 if (victim) 1441 if (victim)
1443 __blkdev_put(victim, mode, 1); 1442 __blkdev_put(victim, mode, 1);
1444 return ret;
1445} 1443}
1446 1444
1447int blkdev_put(struct block_device *bdev, fmode_t mode) 1445void blkdev_put(struct block_device *bdev, fmode_t mode)
1448{ 1446{
1449 mutex_lock(&bdev->bd_mutex); 1447 mutex_lock(&bdev->bd_mutex);
1450 1448
@@ -1488,15 +1486,15 @@ int blkdev_put(struct block_device *bdev, fmode_t mode)
1488 1486
1489 mutex_unlock(&bdev->bd_mutex); 1487 mutex_unlock(&bdev->bd_mutex);
1490 1488
1491 return __blkdev_put(bdev, mode, 0); 1489 __blkdev_put(bdev, mode, 0);
1492} 1490}
1493EXPORT_SYMBOL(blkdev_put); 1491EXPORT_SYMBOL(blkdev_put);
1494 1492
1495static int blkdev_close(struct inode * inode, struct file * filp) 1493static int blkdev_close(struct inode * inode, struct file * filp)
1496{ 1494{
1497 struct block_device *bdev = I_BDEV(filp->f_mapping->host); 1495 struct block_device *bdev = I_BDEV(filp->f_mapping->host);
1498 1496 blkdev_put(bdev, filp->f_mode);
1499 return blkdev_put(bdev, filp->f_mode); 1497 return 0;
1500} 1498}
1501 1499
1502static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg) 1500static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 3dc48cc8b6eb..6356665a74bb 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -362,22 +362,19 @@ fail:
362/* 362/*
363 * Release the journal device 363 * Release the journal device
364 */ 364 */
365static int ext3_blkdev_put(struct block_device *bdev) 365static void ext3_blkdev_put(struct block_device *bdev)
366{ 366{
367 return blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); 367 blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
368} 368}
369 369
370static int ext3_blkdev_remove(struct ext3_sb_info *sbi) 370static void ext3_blkdev_remove(struct ext3_sb_info *sbi)
371{ 371{
372 struct block_device *bdev; 372 struct block_device *bdev;
373 int ret = -ENODEV;
374
375 bdev = sbi->journal_bdev; 373 bdev = sbi->journal_bdev;
376 if (bdev) { 374 if (bdev) {
377 ret = ext3_blkdev_put(bdev); 375 ext3_blkdev_put(bdev);
378 sbi->journal_bdev = NULL; 376 sbi->journal_bdev = NULL;
379 } 377 }
380 return ret;
381} 378}
382 379
383static inline struct inode *orphan_list_entry(struct list_head *l) 380static inline struct inode *orphan_list_entry(struct list_head *l)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 24a146bde742..94cc84db7c9a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -703,22 +703,19 @@ fail:
703/* 703/*
704 * Release the journal device 704 * Release the journal device
705 */ 705 */
706static int ext4_blkdev_put(struct block_device *bdev) 706static void ext4_blkdev_put(struct block_device *bdev)
707{ 707{
708 return blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); 708 blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
709} 709}
710 710
711static int ext4_blkdev_remove(struct ext4_sb_info *sbi) 711static void ext4_blkdev_remove(struct ext4_sb_info *sbi)
712{ 712{
713 struct block_device *bdev; 713 struct block_device *bdev;
714 int ret = -ENODEV;
715
716 bdev = sbi->journal_bdev; 714 bdev = sbi->journal_bdev;
717 if (bdev) { 715 if (bdev) {
718 ret = ext4_blkdev_put(bdev); 716 ext4_blkdev_put(bdev);
719 sbi->journal_bdev = NULL; 717 sbi->journal_bdev = NULL;
720 } 718 }
721 return ret;
722} 719}
723 720
724static inline struct inode *orphan_list_entry(struct list_head *l) 721static inline struct inode *orphan_list_entry(struct list_head *l)
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index 17c22a8fd40a..e0101b6fb0d7 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -176,7 +176,9 @@ static int hfs_dir_release(struct inode *inode, struct file *file)
176{ 176{
177 struct hfs_readdir_data *rd = file->private_data; 177 struct hfs_readdir_data *rd = file->private_data;
178 if (rd) { 178 if (rd) {
179 mutex_lock(&inode->i_mutex);
179 list_del(&rd->list); 180 list_del(&rd->list);
181 mutex_unlock(&inode->i_mutex);
180 kfree(rd); 182 kfree(rd);
181 } 183 }
182 return 0; 184 return 0;
diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h
index f4891bde8851..8485978993e8 100644
--- a/fs/nfs/blocklayout/blocklayout.h
+++ b/fs/nfs/blocklayout/blocklayout.h
@@ -173,7 +173,7 @@ struct bl_msg_hdr {
173/* blocklayoutdev.c */ 173/* blocklayoutdev.c */
174ssize_t bl_pipe_downcall(struct file *, const char __user *, size_t); 174ssize_t bl_pipe_downcall(struct file *, const char __user *, size_t);
175void bl_pipe_destroy_msg(struct rpc_pipe_msg *); 175void bl_pipe_destroy_msg(struct rpc_pipe_msg *);
176int nfs4_blkdev_put(struct block_device *bdev); 176void nfs4_blkdev_put(struct block_device *bdev);
177struct pnfs_block_dev *nfs4_blk_decode_device(struct nfs_server *server, 177struct pnfs_block_dev *nfs4_blk_decode_device(struct nfs_server *server,
178 struct pnfs_device *dev); 178 struct pnfs_device *dev);
179int nfs4_blk_process_layoutget(struct pnfs_layout_hdr *lo, 179int nfs4_blk_process_layoutget(struct pnfs_layout_hdr *lo,
diff --git a/fs/nfs/blocklayout/blocklayoutdev.c b/fs/nfs/blocklayout/blocklayoutdev.c
index a86c5bdad9e3..04303b5c9361 100644
--- a/fs/nfs/blocklayout/blocklayoutdev.c
+++ b/fs/nfs/blocklayout/blocklayoutdev.c
@@ -56,11 +56,11 @@ static int decode_sector_number(__be32 **rp, sector_t *sp)
56/* 56/*
57 * Release the block device 57 * Release the block device
58 */ 58 */
59int nfs4_blkdev_put(struct block_device *bdev) 59void nfs4_blkdev_put(struct block_device *bdev)
60{ 60{
61 dprintk("%s for device %d:%d\n", __func__, MAJOR(bdev->bd_dev), 61 dprintk("%s for device %d:%d\n", __func__, MAJOR(bdev->bd_dev),
62 MINOR(bdev->bd_dev)); 62 MINOR(bdev->bd_dev));
63 return blkdev_put(bdev, FMODE_READ); 63 blkdev_put(bdev, FMODE_READ);
64} 64}
65 65
66ssize_t bl_pipe_downcall(struct file *filp, const char __user *src, 66ssize_t bl_pipe_downcall(struct file *filp, const char __user *src,
diff --git a/fs/nfs/blocklayout/blocklayoutdm.c b/fs/nfs/blocklayout/blocklayoutdm.c
index 6fc7b5cae92b..8999cfddd866 100644
--- a/fs/nfs/blocklayout/blocklayoutdm.c
+++ b/fs/nfs/blocklayout/blocklayoutdm.c
@@ -88,14 +88,8 @@ out:
88 */ 88 */
89static void nfs4_blk_metadev_release(struct pnfs_block_dev *bdev) 89static void nfs4_blk_metadev_release(struct pnfs_block_dev *bdev)
90{ 90{
91 int rv;
92
93 dprintk("%s Releasing\n", __func__); 91 dprintk("%s Releasing\n", __func__);
94 rv = nfs4_blkdev_put(bdev->bm_mdev); 92 nfs4_blkdev_put(bdev->bm_mdev);
95 if (rv)
96 printk(KERN_ERR "NFS: %s nfs4_blkdev_put returns %d\n",
97 __func__, rv);
98
99 dev_remove(bdev->net, bdev->bm_mdev->bd_dev); 93 dev_remove(bdev->net, bdev->bm_mdev->bd_dev);
100} 94}
101 95
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index afcadcc03e8a..742fdd4c209a 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -97,7 +97,7 @@ static int flush_commit_list(struct super_block *s,
97static int can_dirty(struct reiserfs_journal_cnode *cn); 97static int can_dirty(struct reiserfs_journal_cnode *cn);
98static int journal_join(struct reiserfs_transaction_handle *th, 98static int journal_join(struct reiserfs_transaction_handle *th,
99 struct super_block *sb, unsigned long nblocks); 99 struct super_block *sb, unsigned long nblocks);
100static int release_journal_dev(struct super_block *super, 100static void release_journal_dev(struct super_block *super,
101 struct reiserfs_journal *journal); 101 struct reiserfs_journal *journal);
102static int dirty_one_transaction(struct super_block *s, 102static int dirty_one_transaction(struct super_block *s,
103 struct reiserfs_journal_list *jl); 103 struct reiserfs_journal_list *jl);
@@ -2532,23 +2532,13 @@ static void journal_list_init(struct super_block *sb)
2532 SB_JOURNAL(sb)->j_current_jl = alloc_journal_list(sb); 2532 SB_JOURNAL(sb)->j_current_jl = alloc_journal_list(sb);
2533} 2533}
2534 2534
2535static int release_journal_dev(struct super_block *super, 2535static void release_journal_dev(struct super_block *super,
2536 struct reiserfs_journal *journal) 2536 struct reiserfs_journal *journal)
2537{ 2537{
2538 int result;
2539
2540 result = 0;
2541
2542 if (journal->j_dev_bd != NULL) { 2538 if (journal->j_dev_bd != NULL) {
2543 result = blkdev_put(journal->j_dev_bd, journal->j_dev_mode); 2539 blkdev_put(journal->j_dev_bd, journal->j_dev_mode);
2544 journal->j_dev_bd = NULL; 2540 journal->j_dev_bd = NULL;
2545 } 2541 }
2546
2547 if (result != 0) {
2548 reiserfs_warning(super, "sh-457",
2549 "Cannot release journal device: %i", result);
2550 }
2551 return result;
2552} 2542}
2553 2543
2554static int journal_init_dev(struct super_block *super, 2544static int journal_init_dev(struct super_block *super,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 78feda9bbae2..e38cfe77f7f0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1484,7 +1484,7 @@ static inline bool blk_integrity_is_initialized(struct gendisk *g)
1484 1484
1485struct block_device_operations { 1485struct block_device_operations {
1486 int (*open) (struct block_device *, fmode_t); 1486 int (*open) (struct block_device *, fmode_t);
1487 int (*release) (struct gendisk *, fmode_t); 1487 void (*release) (struct gendisk *, fmode_t);
1488 int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); 1488 int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
1489 int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); 1489 int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
1490 int (*direct_access) (struct block_device *, sector_t, 1490 int (*direct_access) (struct block_device *, sector_t,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b5a24ba83b6f..43db02e9c9fa 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2091,7 +2091,7 @@ extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode,
2091 void *holder); 2091 void *holder);
2092extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, 2092extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode,
2093 void *holder); 2093 void *holder);
2094extern int blkdev_put(struct block_device *bdev, fmode_t mode); 2094extern void blkdev_put(struct block_device *bdev, fmode_t mode);
2095#ifdef CONFIG_SYSFS 2095#ifdef CONFIG_SYSFS
2096extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk); 2096extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
2097extern void bd_unlink_disk_holder(struct block_device *bdev, 2097extern void bd_unlink_disk_holder(struct block_device *bdev,
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index 4eb0a50d0c55..e93837f647de 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -74,7 +74,7 @@ struct mtd_blktrans_ops {
74 74
75 /* Called with mtd_table_mutex held; no race with add/remove */ 75 /* Called with mtd_table_mutex held; no race with add/remove */
76 int (*open)(struct mtd_blktrans_dev *dev); 76 int (*open)(struct mtd_blktrans_dev *dev);
77 int (*release)(struct mtd_blktrans_dev *dev); 77 void (*release)(struct mtd_blktrans_dev *dev);
78 78
79 /* Called on {de,}registration and on subsequent addition/removal 79 /* Called on {de,}registration and on subsequent addition/removal
80 of devices, with mtd_table_mutex held. */ 80 of devices, with mtd_table_mutex held. */