aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 3c74ea729fc7..7b3b94ddddcc 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -50,7 +50,6 @@
50 * 50 *
51 */ 51 */
52 52
53#include <linux/config.h>
54#include <linux/module.h> 53#include <linux/module.h>
55#include <linux/moduleparam.h> 54#include <linux/moduleparam.h>
56#include <linux/sched.h> 55#include <linux/sched.h>
@@ -63,7 +62,6 @@
63#include <linux/blkdev.h> 62#include <linux/blkdev.h>
64#include <linux/blkpg.h> 63#include <linux/blkpg.h>
65#include <linux/init.h> 64#include <linux/init.h>
66#include <linux/devfs_fs_kernel.h>
67#include <linux/smp_lock.h> 65#include <linux/smp_lock.h>
68#include <linux/swap.h> 66#include <linux/swap.h>
69#include <linux/slab.h> 67#include <linux/slab.h>
@@ -210,7 +208,7 @@ static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec,
210{ 208{
211 struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */ 209 struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */
212 struct address_space *mapping = file->f_mapping; 210 struct address_space *mapping = file->f_mapping;
213 struct address_space_operations *aops = mapping->a_ops; 211 const struct address_space_operations *aops = mapping->a_ops;
214 pgoff_t index; 212 pgoff_t index;
215 unsigned offset, bv_offs; 213 unsigned offset, bv_offs;
216 int len, ret; 214 int len, ret;
@@ -784,7 +782,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
784 782
785 error = -EINVAL; 783 error = -EINVAL;
786 if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) { 784 if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) {
787 struct address_space_operations *aops = mapping->a_ops; 785 const struct address_space_operations *aops = mapping->a_ops;
788 /* 786 /*
789 * If we can't read - sorry. If we only can't write - well, 787 * If we can't read - sorry. If we only can't write - well,
790 * it's going to be read-only. 788 * it's going to be read-only.
@@ -1277,8 +1275,6 @@ static int __init loop_init(void)
1277 goto out_mem3; 1275 goto out_mem3;
1278 } 1276 }
1279 1277
1280 devfs_mk_dir("loop");
1281
1282 for (i = 0; i < max_loop; i++) { 1278 for (i = 0; i < max_loop; i++) {
1283 struct loop_device *lo = &loop_dev[i]; 1279 struct loop_device *lo = &loop_dev[i];
1284 struct gendisk *disk = disks[i]; 1280 struct gendisk *disk = disks[i];
@@ -1296,7 +1292,6 @@ static int __init loop_init(void)
1296 disk->first_minor = i; 1292 disk->first_minor = i;
1297 disk->fops = &lo_fops; 1293 disk->fops = &lo_fops;
1298 sprintf(disk->disk_name, "loop%d", i); 1294 sprintf(disk->disk_name, "loop%d", i);
1299 sprintf(disk->devfs_name, "loop/%d", i);
1300 disk->private_data = lo; 1295 disk->private_data = lo;
1301 disk->queue = lo->lo_queue; 1296 disk->queue = lo->lo_queue;
1302 } 1297 }
@@ -1310,7 +1305,6 @@ static int __init loop_init(void)
1310out_mem4: 1305out_mem4:
1311 while (i--) 1306 while (i--)
1312 blk_cleanup_queue(loop_dev[i].lo_queue); 1307 blk_cleanup_queue(loop_dev[i].lo_queue);
1313 devfs_remove("loop");
1314 i = max_loop; 1308 i = max_loop;
1315out_mem3: 1309out_mem3:
1316 while (i--) 1310 while (i--)
@@ -1333,7 +1327,6 @@ static void loop_exit(void)
1333 blk_cleanup_queue(loop_dev[i].lo_queue); 1327 blk_cleanup_queue(loop_dev[i].lo_queue);
1334 put_disk(disks[i]); 1328 put_disk(disks[i]);
1335 } 1329 }
1336 devfs_remove("loop");
1337 if (unregister_blkdev(LOOP_MAJOR, "loop")) 1330 if (unregister_blkdev(LOOP_MAJOR, "loop"))
1338 printk(KERN_WARNING "loop: cannot unregister blkdev\n"); 1331 printk(KERN_WARNING "loop: cannot unregister blkdev\n");
1339 1332