Commit 4f5f78e6 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] misc cleanups

assorted minor cleanups
parent 16a974dc
......@@ -176,8 +176,6 @@ MODULE_PARM(drive3, "1-6i");
/* set up defines for blk.h, why don't all drivers do it this way ? */
#define MAJOR_NR major
#define DEVICE_NR(device) (minor(device))
#define DEVICE_OFF(device)
#include <linux/blk.h>
......
......@@ -199,7 +199,6 @@ MODULE_PARM(drive3,"1-7i");
#define MAJOR_NR major
#define DEVICE_NR(device) minor(device)
#define DEVICE_OFF(device)
#include <linux/blk.h>
#include <linux/blkpg.h>
......
......@@ -94,12 +94,6 @@ MODULE_PARM(shuffle_freq, "i");
/* Funky stuff for setting up a block device */
#define MAJOR_NR FTL_MAJOR
#define DEVICE_OFF(device)
#define DEVICE_NR(minor) ((minor)>>5)
#define REGION_NR(minor) (((minor)>>3)&3)
#define PART_NR(minor) ((minor)&7)
#define MINOR_NR(dev,reg,part) (((dev)<<5)+((reg)<<3)+(part))
#include <linux/blk.h>
......
......@@ -41,8 +41,6 @@
/* NFTL block device stuff */
#define MAJOR_NR NFTL_MAJOR
#define DEVICE_OFF(device)
#include <linux/blk.h>
#include <linux/hdreg.h>
......
......@@ -42,15 +42,7 @@
*/
#define MAJOR_NR JSFD_MAJOR
#define DEVICE_REQUEST jsfd_do_request
#define DEVICE_NR(device) (MINOR(device))
#define DEVICE_ON(device)
#define DEVICE_OFF(device)
#define DEVICE_NO_RANDOM
#include <linux/blk.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/io.h>
......@@ -657,7 +649,7 @@ int jsfd_init(void) {
blk_size[JSFD_MAJOR] = jsfd_sizes;
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), jsf_do_request);
for (i = 0; i < JSF_MAX; i++) {
if ((i & JSF_PART_MASK) >= JSF_NPART) continue;
jsf = &jsf0; /* actually, &jsfv[i >> JSF_PART_BITS] */
......
......@@ -545,16 +545,7 @@ int sr_dev_ioctl(struct cdrom_device_info *cdi,
unsigned int cmd, unsigned long arg)
{
Scsi_CD *cd = cdi->handle;
switch (cmd) {
case BLKGETSIZE:
return put_user(cd->capacity, (unsigned long *) arg);
case BLKGETSIZE64:
return put_user((u64)cd->capacity << 9, (u64 *)arg);
default:
return scsi_ioctl(cd->device, cmd, (void *)arg);
}
return scsi_ioctl(cd->device, cmd, (void *)arg);
}
/*
......
......@@ -843,6 +843,9 @@ static int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
case BLKPG:
ret = blk_ioctl(bdev, cmd, arg);
break;
case BLKRRPART:
ret = blkdev_reread_part(bdev);
break;
default:
if (bdev->bd_op->ioctl)
ret =bdev->bd_op->ioctl(inode, file, cmd, arg);
......@@ -854,8 +857,6 @@ static int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
case BLKROSET:
ret = blk_ioctl(bdev,cmd,arg);
break;
case BLKRRPART:
ret = blkdev_reread_part(bdev);
}
}
}
......
......@@ -78,13 +78,10 @@ udf_get_last_block(struct super_block *sb)
if (ret) /* Hard Disk */
{
ret = ioctl_by_bdev(bdev, BLKGETSIZE, (unsigned long) &lblock);
if (!ret && lblock != 0x7FFFFFFF)
lblock = ((512 * lblock) / sb->s_blocksize);
lblock = bdev->bd_inode->i_size / sb->s_blocksize;
}
if (!ret && lblock)
if (lblock)
return lblock - 1;
else
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment