[NET]: Split skb->csum
[linux-2.6.git] / block / ioctl.c
index 35fdb7dc6512028be4a3d7e1e4012aaadf1b4ddf..58aab630dfc1a55eaf06975d5a48600b5f14e49e 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/backing-dev.h>
 #include <linux/buffer_head.h>
 #include <linux/smp_lock.h>
+#include <linux/blktrace_api.h>
 #include <asm/uaccess.h>
 
 static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user *arg)
@@ -71,7 +72,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                        bdevp = bdget_disk(disk, part);
                        if (!bdevp)
                                return -ENOMEM;
-                       mutex_lock(&bdevp->bd_mutex);
+                       mutex_lock_nested(&bdevp->bd_mutex, BD_MUTEX_PARTITION);
                        if (bdevp->bd_openers) {
                                mutex_unlock(&bdevp->bd_mutex);
                                bdput(bdevp);
@@ -81,7 +82,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                        fsync_bdev(bdevp);
                        invalidate_bdev(bdevp, 0);
 
-                       mutex_lock(&bdev->bd_mutex);
+                       mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_WHOLE);
                        delete_partition(disk, part);
                        mutex_unlock(&bdev->bd_mutex);
                        mutex_unlock(&bdevp->bd_mutex);
@@ -189,12 +190,17 @@ static int blkdev_locked_ioctl(struct file *file, struct block_device *bdev,
                return put_ulong(arg, bdev->bd_inode->i_size >> 9);
        case BLKGETSIZE64:
                return put_u64(arg, bdev->bd_inode->i_size);
+       case BLKTRACESTART:
+       case BLKTRACESTOP:
+       case BLKTRACESETUP:
+       case BLKTRACETEARDOWN:
+               return blk_trace_ioctl(bdev, cmd, (char __user *) arg);
        }
        return -ENOIOCTLCMD;
 }
 
-static int blkdev_driver_ioctl(struct inode *inode, struct file *file,
-               struct gendisk *disk, unsigned cmd, unsigned long arg)
+int blkdev_driver_ioctl(struct inode *inode, struct file *file,
+                       struct gendisk *disk, unsigned cmd, unsigned long arg)
 {
        int ret;
        if (disk->fops->unlocked_ioctl)
@@ -209,6 +215,7 @@ static int blkdev_driver_ioctl(struct inode *inode, struct file *file,
 
        return -ENOTTY;
 }
+EXPORT_SYMBOL_GPL(blkdev_driver_ioctl);
 
 int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
                        unsigned long arg)