git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git]
/
drivers
/
block
/
loop.c
diff --git
a/drivers/block/loop.c
b/drivers/block/loop.c
index
9c3b94e
..
b35bf49
100644
(file)
--- a/
drivers/block/loop.c
+++ b/
drivers/block/loop.c
@@
-50,7
+50,6
@@
*
*/
*
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/sched.h>
@@
-63,7
+62,6
@@
#include <linux/blkdev.h>
#include <linux/blkpg.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/blkpg.h>
#include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/smp_lock.h>
#include <linux/swap.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/swap.h>
#include <linux/slab.h>
@@
-74,6
+72,7
@@
#include <linux/completion.h>
#include <linux/highmem.h>
#include <linux/gfp.h>
#include <linux/completion.h>
#include <linux/highmem.h>
#include <linux/gfp.h>
+#include <linux/vs_context.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
@@
-210,7
+209,7
@@
static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec,
{
struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */
struct address_space *mapping = file->f_mapping;
{
struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */
struct address_space *mapping = file->f_mapping;
- struct address_space_operations *aops = mapping->a_ops;
+
const
struct address_space_operations *aops = mapping->a_ops;
pgoff_t index;
unsigned offset, bv_offs;
int len, ret;
pgoff_t index;
unsigned offset, bv_offs;
int len, ret;
@@
-664,7
+663,8
@@
static void do_loop_switch(struct loop_device *lo, struct switch_request *p)
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
lo->lo_backing_file = file;
mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
lo->lo_backing_file = file;
- lo->lo_blocksize = mapping->host->i_blksize;
+ lo->lo_blocksize = S_ISBLK(mapping->host->i_mode) ?
+ mapping->host->i_bdev->bd_block_size : PAGE_SIZE;
lo->old_gfp_mask = mapping_gfp_mask(mapping);
mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
complete(&p->wait);
lo->old_gfp_mask = mapping_gfp_mask(mapping);
mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
complete(&p->wait);
@@
-743,6
+743,7
@@
static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
struct file *file, *f;
struct inode *inode;
struct address_space *mapping;
struct file *file, *f;
struct inode *inode;
struct address_space *mapping;
+ struct vx_info_save vxis;
unsigned lo_blocksize;
int lo_flags = 0;
int error;
unsigned lo_blocksize;
int lo_flags = 0;
int error;
@@
-784,7
+785,7
@@
static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
error = -EINVAL;
if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) {
error = -EINVAL;
if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) {
- struct address_space_operations *aops = mapping->a_ops;
+
const
struct address_space_operations *aops = mapping->a_ops;
/*
* If we can't read - sorry. If we only can't write - well,
* it's going to be read-only.
/*
* If we can't read - sorry. If we only can't write - well,
* it's going to be read-only.
@@
-796,7
+797,9
@@
static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
if (!(lo_flags & LO_FLAGS_USE_AOPS) && !file->f_op->write)
lo_flags |= LO_FLAGS_READ_ONLY;
if (!(lo_flags & LO_FLAGS_USE_AOPS) && !file->f_op->write)
lo_flags |= LO_FLAGS_READ_ONLY;
- lo_blocksize = inode->i_blksize;
+ lo_blocksize = S_ISBLK(inode->i_mode) ?
+ inode->i_bdev->bd_block_size : PAGE_SIZE;
+
error = 0;
} else {
goto out_putf;
error = 0;
} else {
goto out_putf;
@@
-818,7
+821,7
@@
static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
lo->lo_device = bdev;
lo->lo_flags = lo_flags;
lo->lo_backing_file = file;
lo->lo_device = bdev;
lo->lo_flags = lo_flags;
lo->lo_backing_file = file;
- lo->transfer =
NULL
;
+ lo->transfer =
transfer_none
;
lo->ioctl = NULL;
lo->lo_sizelimit = 0;
lo->old_gfp_mask = mapping_gfp_mask(mapping);
lo->ioctl = NULL;
lo->lo_sizelimit = 0;
lo->old_gfp_mask = mapping_gfp_mask(mapping);
@@
-839,7
+842,9
@@
static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
set_blocksize(bdev, lo_blocksize);
set_blocksize(bdev, lo_blocksize);
+ __enter_vx_admin(&vxis);
error = kernel_thread(loop_thread, lo, CLONE_KERNEL);
error = kernel_thread(loop_thread, lo, CLONE_KERNEL);
+ __leave_vx_admin(&vxis);
if (error < 0)
goto out_putf;
wait_for_completion(&lo->lo_done);
if (error < 0)
goto out_putf;
wait_for_completion(&lo->lo_done);
@@
-1277,8
+1282,6
@@
static int __init loop_init(void)
goto out_mem3;
}
goto out_mem3;
}
- devfs_mk_dir("loop");
-
for (i = 0; i < max_loop; i++) {
struct loop_device *lo = &loop_dev[i];
struct gendisk *disk = disks[i];
for (i = 0; i < max_loop; i++) {
struct loop_device *lo = &loop_dev[i];
struct gendisk *disk = disks[i];
@@
-1296,7
+1299,6
@@
static int __init loop_init(void)
disk->first_minor = i;
disk->fops = &lo_fops;
sprintf(disk->disk_name, "loop%d", i);
disk->first_minor = i;
disk->fops = &lo_fops;
sprintf(disk->disk_name, "loop%d", i);
- sprintf(disk->devfs_name, "loop/%d", i);
disk->private_data = lo;
disk->queue = lo->lo_queue;
}
disk->private_data = lo;
disk->queue = lo->lo_queue;
}
@@
-1310,7
+1312,6
@@
static int __init loop_init(void)
out_mem4:
while (i--)
blk_cleanup_queue(loop_dev[i].lo_queue);
out_mem4:
while (i--)
blk_cleanup_queue(loop_dev[i].lo_queue);
- devfs_remove("loop");
i = max_loop;
out_mem3:
while (i--)
i = max_loop;
out_mem3:
while (i--)
@@
-1333,7
+1334,6
@@
static void loop_exit(void)
blk_cleanup_queue(loop_dev[i].lo_queue);
put_disk(disks[i]);
}
blk_cleanup_queue(loop_dev[i].lo_queue);
put_disk(disks[i]);
}
- devfs_remove("loop");
if (unregister_blkdev(LOOP_MAJOR, "loop"))
printk(KERN_WARNING "loop: cannot unregister blkdev\n");
if (unregister_blkdev(LOOP_MAJOR, "loop"))
printk(KERN_WARNING "loop: cannot unregister blkdev\n");