diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/ataflop.c | 16 | ||||
-rw-r--r-- | drivers/block/cciss.c | 10 | ||||
-rw-r--r-- | drivers/block/loop.c | 8 | ||||
-rw-r--r-- | drivers/block/paride/pt.c | 2 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 4 | ||||
-rw-r--r-- | drivers/block/rd.c | 3 |
6 files changed, 27 insertions, 16 deletions
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index 94268c75d04f..424995073c6b 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c | |||
@@ -90,7 +90,7 @@ static struct atari_disk_type { | |||
90 | unsigned blocks; /* total number of blocks */ | 90 | unsigned blocks; /* total number of blocks */ |
91 | unsigned fdc_speed; /* fdc_speed setting */ | 91 | unsigned fdc_speed; /* fdc_speed setting */ |
92 | unsigned stretch; /* track doubling ? */ | 92 | unsigned stretch; /* track doubling ? */ |
93 | } disk_type[] = { | 93 | } atari_disk_type[] = { |
94 | { "d360", 9, 720, 0, 0}, /* 0: 360kB diskette */ | 94 | { "d360", 9, 720, 0, 0}, /* 0: 360kB diskette */ |
95 | { "D360", 9, 720, 0, 1}, /* 1: 360kb in 720k or 1.2MB drive */ | 95 | { "D360", 9, 720, 0, 1}, /* 1: 360kb in 720k or 1.2MB drive */ |
96 | { "D720", 9,1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */ | 96 | { "D720", 9,1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */ |
@@ -658,7 +658,7 @@ static int do_format(int drive, int type, struct atari_format_descr *desc) | |||
658 | return -EINVAL; | 658 | return -EINVAL; |
659 | } | 659 | } |
660 | type = minor2disktype[type].index; | 660 | type = minor2disktype[type].index; |
661 | UDT = &disk_type[type]; | 661 | UDT = &atari_disk_type[type]; |
662 | } | 662 | } |
663 | 663 | ||
664 | if (!UDT || desc->track >= UDT->blocks/UDT->spt/2 || desc->head >= 2) { | 664 | if (!UDT || desc->track >= UDT->blocks/UDT->spt/2 || desc->head >= 2) { |
@@ -1064,7 +1064,7 @@ static void fd_rwsec_done1(int status) | |||
1064 | searched for a non-existent sector! */ | 1064 | searched for a non-existent sector! */ |
1065 | !(read_track && FDC_READ(FDCREG_SECTOR) > SUDT->spt)) { | 1065 | !(read_track && FDC_READ(FDCREG_SECTOR) > SUDT->spt)) { |
1066 | if (Probing) { | 1066 | if (Probing) { |
1067 | if (SUDT > disk_type) { | 1067 | if (SUDT > atari_disk_type) { |
1068 | if (SUDT[-1].blocks > ReqBlock) { | 1068 | if (SUDT[-1].blocks > ReqBlock) { |
1069 | /* try another disk type */ | 1069 | /* try another disk type */ |
1070 | SUDT--; | 1070 | SUDT--; |
@@ -1082,7 +1082,7 @@ static void fd_rwsec_done1(int status) | |||
1082 | } else { | 1082 | } else { |
1083 | /* record not found, but not probing. Maybe stretch wrong ? Restart probing */ | 1083 | /* record not found, but not probing. Maybe stretch wrong ? Restart probing */ |
1084 | if (SUD.autoprobe) { | 1084 | if (SUD.autoprobe) { |
1085 | SUDT = disk_type + StartDiskType[DriveType]; | 1085 | SUDT = atari_disk_type + StartDiskType[DriveType]; |
1086 | set_capacity(unit[SelectedDrive].disk, | 1086 | set_capacity(unit[SelectedDrive].disk, |
1087 | SUDT->blocks); | 1087 | SUDT->blocks); |
1088 | Probing = 1; | 1088 | Probing = 1; |
@@ -1421,7 +1421,7 @@ repeat: | |||
1421 | if (type == 0) { | 1421 | if (type == 0) { |
1422 | if (!UDT) { | 1422 | if (!UDT) { |
1423 | Probing = 1; | 1423 | Probing = 1; |
1424 | UDT = disk_type + StartDiskType[DriveType]; | 1424 | UDT = atari_disk_type + StartDiskType[DriveType]; |
1425 | set_capacity(floppy->disk, UDT->blocks); | 1425 | set_capacity(floppy->disk, UDT->blocks); |
1426 | UD.autoprobe = 1; | 1426 | UD.autoprobe = 1; |
1427 | } | 1427 | } |
@@ -1439,7 +1439,7 @@ repeat: | |||
1439 | goto repeat; | 1439 | goto repeat; |
1440 | } | 1440 | } |
1441 | type = minor2disktype[type].index; | 1441 | type = minor2disktype[type].index; |
1442 | UDT = &disk_type[type]; | 1442 | UDT = &atari_disk_type[type]; |
1443 | set_capacity(floppy->disk, UDT->blocks); | 1443 | set_capacity(floppy->disk, UDT->blocks); |
1444 | UD.autoprobe = 0; | 1444 | UD.autoprobe = 0; |
1445 | } | 1445 | } |
@@ -1505,7 +1505,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, | |||
1505 | if (minor2disktype[type].drive_types > DriveType) | 1505 | if (minor2disktype[type].drive_types > DriveType) |
1506 | return -ENODEV; | 1506 | return -ENODEV; |
1507 | type = minor2disktype[type].index; | 1507 | type = minor2disktype[type].index; |
1508 | dtp = &disk_type[type]; | 1508 | dtp = &atari_disk_type[type]; |
1509 | if (UD.flags & FTD_MSG) | 1509 | if (UD.flags & FTD_MSG) |
1510 | printk (KERN_ERR "floppy%d: found dtp %p name %s!\n", | 1510 | printk (KERN_ERR "floppy%d: found dtp %p name %s!\n", |
1511 | drive, dtp, dtp->name); | 1511 | drive, dtp, dtp->name); |
@@ -1576,7 +1576,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, | |||
1576 | continue; | 1576 | continue; |
1577 | } | 1577 | } |
1578 | setidx = minor2disktype[settype].index; | 1578 | setidx = minor2disktype[settype].index; |
1579 | dtp = &disk_type[setidx]; | 1579 | dtp = &atari_disk_type[setidx]; |
1580 | 1580 | ||
1581 | /* found matching entry ?? */ | 1581 | /* found matching entry ?? */ |
1582 | if ( dtp->blocks == setprm.size | 1582 | if ( dtp->blocks == setprm.size |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 855ce8e5efba..9715be3f2487 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -2630,12 +2630,14 @@ static void do_cciss_request(struct request_queue *q) | |||
2630 | c->Request.CDB[8] = creq->nr_sectors & 0xff; | 2630 | c->Request.CDB[8] = creq->nr_sectors & 0xff; |
2631 | c->Request.CDB[9] = c->Request.CDB[11] = c->Request.CDB[12] = 0; | 2631 | c->Request.CDB[9] = c->Request.CDB[11] = c->Request.CDB[12] = 0; |
2632 | } else { | 2632 | } else { |
2633 | u32 upper32 = upper_32_bits(start_blk); | ||
2634 | |||
2633 | c->Request.CDBLen = 16; | 2635 | c->Request.CDBLen = 16; |
2634 | c->Request.CDB[1]= 0; | 2636 | c->Request.CDB[1]= 0; |
2635 | c->Request.CDB[2]= (start_blk >> 56) & 0xff; //MSB | 2637 | c->Request.CDB[2]= (upper32 >> 24) & 0xff; //MSB |
2636 | c->Request.CDB[3]= (start_blk >> 48) & 0xff; | 2638 | c->Request.CDB[3]= (upper32 >> 16) & 0xff; |
2637 | c->Request.CDB[4]= (start_blk >> 40) & 0xff; | 2639 | c->Request.CDB[4]= (upper32 >> 8) & 0xff; |
2638 | c->Request.CDB[5]= (start_blk >> 32) & 0xff; | 2640 | c->Request.CDB[5]= upper32 & 0xff; |
2639 | c->Request.CDB[6]= (start_blk >> 24) & 0xff; | 2641 | c->Request.CDB[6]= (start_blk >> 24) & 0xff; |
2640 | c->Request.CDB[7]= (start_blk >> 16) & 0xff; | 2642 | c->Request.CDB[7]= (start_blk >> 16) & 0xff; |
2641 | c->Request.CDB[8]= (start_blk >> 8) & 0xff; | 2643 | c->Request.CDB[8]= (start_blk >> 8) & 0xff; |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index b8af22e610df..91ebb007416c 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -973,6 +973,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) | |||
973 | lo->transfer = xfer->transfer; | 973 | lo->transfer = xfer->transfer; |
974 | lo->ioctl = xfer->ioctl; | 974 | lo->ioctl = xfer->ioctl; |
975 | 975 | ||
976 | if ((lo->lo_flags & LO_FLAGS_AUTOCLEAR) != | ||
977 | (info->lo_flags & LO_FLAGS_AUTOCLEAR)) | ||
978 | lo->lo_flags ^= LO_FLAGS_AUTOCLEAR; | ||
979 | |||
976 | lo->lo_encrypt_key_size = info->lo_encrypt_key_size; | 980 | lo->lo_encrypt_key_size = info->lo_encrypt_key_size; |
977 | lo->lo_init[0] = info->lo_init[0]; | 981 | lo->lo_init[0] = info->lo_init[0]; |
978 | lo->lo_init[1] = info->lo_init[1]; | 982 | lo->lo_init[1] = info->lo_init[1]; |
@@ -1331,6 +1335,10 @@ static int lo_release(struct inode *inode, struct file *file) | |||
1331 | 1335 | ||
1332 | mutex_lock(&lo->lo_ctl_mutex); | 1336 | mutex_lock(&lo->lo_ctl_mutex); |
1333 | --lo->lo_refcnt; | 1337 | --lo->lo_refcnt; |
1338 | |||
1339 | if ((lo->lo_flags & LO_FLAGS_AUTOCLEAR) && !lo->lo_refcnt) | ||
1340 | loop_clr_fd(lo, inode->i_bdev); | ||
1341 | |||
1334 | mutex_unlock(&lo->lo_ctl_mutex); | 1342 | mutex_unlock(&lo->lo_ctl_mutex); |
1335 | 1343 | ||
1336 | return 0; | 1344 | return 0; |
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 76096cad798f..8b9549ab4a4e 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c | |||
@@ -660,7 +660,7 @@ static int pt_open(struct inode *inode, struct file *file) | |||
660 | pt_identify(tape); | 660 | pt_identify(tape); |
661 | 661 | ||
662 | err = -ENODEV; | 662 | err = -ENODEV; |
663 | if (!tape->flags & PT_MEDIA) | 663 | if (!(tape->flags & PT_MEDIA)) |
664 | goto out; | 664 | goto out; |
665 | 665 | ||
666 | err = -EROFS; | 666 | err = -EROFS; |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index e9de1712e5a0..674cd66dcaba 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -2212,11 +2212,11 @@ static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed) | |||
2212 | return ret; | 2212 | return ret; |
2213 | } | 2213 | } |
2214 | 2214 | ||
2215 | if (!buf[6] & 0x40) { | 2215 | if (!(buf[6] & 0x40)) { |
2216 | printk(DRIVER_NAME": Disc type is not CD-RW\n"); | 2216 | printk(DRIVER_NAME": Disc type is not CD-RW\n"); |
2217 | return 1; | 2217 | return 1; |
2218 | } | 2218 | } |
2219 | if (!buf[6] & 0x4) { | 2219 | if (!(buf[6] & 0x4)) { |
2220 | printk(DRIVER_NAME": A1 values on media are not valid, maybe not CDRW?\n"); | 2220 | printk(DRIVER_NAME": A1 values on media are not valid, maybe not CDRW?\n"); |
2221 | return 1; | 2221 | return 1; |
2222 | } | 2222 | } |
diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 82f4eecc8699..06e23be70904 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include <linux/backing-dev.h> | 56 | #include <linux/backing-dev.h> |
57 | #include <linux/blkpg.h> | 57 | #include <linux/blkpg.h> |
58 | #include <linux/writeback.h> | 58 | #include <linux/writeback.h> |
59 | #include <linux/log2.h> | ||
59 | 60 | ||
60 | #include <asm/uaccess.h> | 61 | #include <asm/uaccess.h> |
61 | 62 | ||
@@ -450,7 +451,7 @@ static int __init rd_init(void) | |||
450 | err = -ENOMEM; | 451 | err = -ENOMEM; |
451 | 452 | ||
452 | if (rd_blocksize > PAGE_SIZE || rd_blocksize < 512 || | 453 | if (rd_blocksize > PAGE_SIZE || rd_blocksize < 512 || |
453 | (rd_blocksize & (rd_blocksize-1))) { | 454 | !is_power_of_2(rd_blocksize)) { |
454 | printk("RAMDISK: wrong blocksize %d, reverting to defaults\n", | 455 | printk("RAMDISK: wrong blocksize %d, reverting to defaults\n", |
455 | rd_blocksize); | 456 | rd_blocksize); |
456 | rd_blocksize = BLOCK_SIZE; | 457 | rd_blocksize = BLOCK_SIZE; |