Commit ef40d49b authored by Linus Torvalds's avatar Linus Torvalds

v2.5.0.5 -> v2.5.0.6

- Jens Axboe: more bio stuff
- Coda compile fixes
- Nathan Laredo: stradis driver update
parent cc5979c3
......@@ -1149,6 +1149,16 @@ S: 77 Clarence Mews
S: London SE16 1GD
S: United Kingdom
N: Jan Harkes
E: jaharkes@cs.cmu.edu
W: http://www.coda.cs.cmu.edu/
D: Coda file system
S: Computer Science Department
S: Carnegie Mellon University
S: 5000 Forbes Avenue
S: Pittsburgh, Pennsylvania 15213
S: USA
N: Kai Harrekilde-Petersen
E: kai.harrekilde@get2net.dk
D: Original author of the ftape-HOWTO, i82078 fdc detection code.
......
......@@ -285,6 +285,14 @@ P: Nils Faerber (port to kernel 2.4)
M: Nils Faerber <nils@kernelconcepts.de>
S: Maintained
CODA FILE SYSTEM
P: Jan Harkes
M: jaharkes@cs.cmu.edu
M: coda@cs.cmu.edu
L: codalist@coda.cs.cmu.edu
W: http://www.coda.cs.cmu.edu/
S: Maintained
COMPAQ FIBRE CHANNEL 64-bit/66MHz PCI non-intelligent HBA
P: Amy Vanzant-Hodge
M: Amy Vanzant-Hodge (fibrechannel@compaq.com)
......
VERSION = 2
PATCHLEVEL = 5
SUBLEVEL = 1
EXTRAVERSION =-pre5
EXTRAVERSION =-pre6
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
......
......@@ -525,6 +525,12 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_BIOS_DATE, "05/11/00"), NO_MATCH
} },
{ swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-Z600NE */
MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
MATCH(DMI_BIOS_VERSION, "WME01Z1"),
MATCH(DMI_BIOS_DATE, "08/11/00"), NO_MATCH
} },
{ swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-Z505LS */
MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
MATCH(DMI_BIOS_VERSION, "R0203D0"),
......
......@@ -10,9 +10,9 @@
O_TARGET := block.o
export-objs := elevator.o ll_rw_blk.o blkpg.o loop.o DAC960.o genhd.o
export-objs := elevator.o ll_rw_blk.o blkpg.o loop.o DAC960.o genhd.o block_ioctl.o
obj-y := elevator.o ll_rw_blk.o blkpg.o genhd.o
obj-y := elevator.o ll_rw_blk.o blkpg.o genhd.o block_ioctl.o
obj-$(CONFIG_MAC_FLOPPY) += swim3.o
obj-$(CONFIG_BLK_DEV_FD) += floppy.o
......
......@@ -194,7 +194,7 @@ int blkpg_ioctl(kdev_t dev, struct blkpg_ioctl_arg *arg)
/*
* Common ioctl's for block devices
*/
extern int block_ioctl(kdev_t dev, unsigned int cmd, unsigned long arg);
int blk_ioctl(kdev_t dev, unsigned int cmd, unsigned long arg)
{
request_queue_t *q;
......@@ -205,6 +205,10 @@ int blk_ioctl(kdev_t dev, unsigned int cmd, unsigned long arg)
if (!dev)
return -EINVAL;
intval = block_ioctl(dev, cmd, arg);
if (intval != -ENOTTY)
return intval;
switch (cmd) {
case BLKROSET:
if (!capable(CAP_SYS_ADMIN))
......
/*
* Copyright (C) 2001 Jens Axboe <axboe@suse.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public Licens
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-
*
*/
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/config.h>
#include <linux/locks.h>
#include <linux/swap.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/module.h>
#include <linux/blk.h>
#include <linux/cdrom.h>
int blk_do_rq(request_queue_t *q, struct request *rq)
{
DECLARE_COMPLETION(wait);
int err = 0;
rq->flags |= REQ_BARRIER;
rq->waiting = &wait;
elv_add_request(q, rq);
generic_unplug_device(q);
wait_for_completion(&wait);
/*
* for now, never retry anything
*/
if (rq->errors)
err = -EIO;
return err;
}
int block_ioctl(kdev_t dev, unsigned int cmd, unsigned long arg)
{
request_queue_t *q;
struct request *rq;
int close = 0, err;
q = blk_get_queue(dev);
if (!q)
return -ENXIO;
switch (cmd) {
case CDROMCLOSETRAY:
close = 1;
case CDROMEJECT:
rq = blk_get_request(q, WRITE, __GFP_WAIT);
rq->flags = REQ_BLOCK_PC;
memset(rq->cmd, 0, sizeof(rq->cmd));
rq->cmd[0] = GPCMD_START_STOP_UNIT;
rq->cmd[4] = 0x02 + (close != 0);
err = blk_do_rq(q, rq);
blk_put_request(rq);
break;
default:
err = -ENOTTY;
}
return err;
}
......@@ -1252,9 +1252,9 @@ static void do_cciss_request(request_queue_t *q)
c->Request.Type.Type = TYPE_CMD; // It is a command.
c->Request.Type.Attribute = ATTR_SIMPLE;
c->Request.Type.Direction =
(creq->cmd == READ) ? XFER_READ: XFER_WRITE;
(rq_data_dir(creq) == READ) ? XFER_READ: XFER_WRITE;
c->Request.Timeout = 0; // Don't time out
c->Request.CDB[0] = (creq->cmd == READ) ? CCISS_READ : CCISS_WRITE;
c->Request.CDB[0] = (rq_data_dir(creq) == READ) ? CCISS_READ : CCISS_WRITE;
start_blk = creq->sector;
#ifdef CCISS_DEBUG
printk(KERN_DEBUG "ciss: sector =%d nr_sectors=%d\n",(int) creq->sector,
......@@ -1869,7 +1869,7 @@ static int __init cciss_init_one(struct pci_dev *pdev,
blk_init_queue(q, do_cciss_request);
blk_queue_headactive(q, 0);
blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask);
q->max_segments = MAXSGENTRIES;
blk_queue_max_segments(q, MAXSGENTRIES);
blk_queue_max_sectors(q, 512);
/* fill in the other Kernel structs */
......
......@@ -470,7 +470,7 @@ int __init cpqarray_init(void)
blk_init_queue(q, do_ida_request);
blk_queue_headactive(q, 0);
blk_queue_bounce_limit(q, hba[i]->pci_dev->dma_mask);
q->max_segments = SG_MAX;
blk_queue_max_segments(q, SG_MAX);
blksize_size[MAJOR_NR+i] = ida_blocksizes + (i*256);
read_ahead[MAJOR_NR+i] = READ_AHEAD;
......@@ -898,7 +898,7 @@ DBGPX(
seg = blk_rq_map_sg(q, creq, tmp_sg);
/* Now do all the DMA Mappings */
if (creq->cmd == READ)
if (rq_data_dir(creq) == READ)
dir = PCI_DMA_FROMDEVICE;
else
dir = PCI_DMA_TODEVICE;
......@@ -913,7 +913,7 @@ DBGPX(
DBGPX( printk("Submitting %d sectors in %d segments\n", creq->nr_sectors, seg); );
c->req.hdr.sg_cnt = seg;
c->req.hdr.blk_cnt = creq->nr_sectors;
c->req.hdr.cmd = (creq->cmd == READ) ? IDA_READ : IDA_WRITE;
c->req.hdr.cmd = (rq_data_dir(creq) == READ) ? IDA_READ : IDA_WRITE;
c->type = CMD_RWREQ;
spin_lock_irq(&q->queue_lock);
......
......@@ -58,7 +58,7 @@ inline int bio_rq_in_between(struct bio *bio, struct request *rq,
next_rq = list_entry(next, struct request, queuelist);
BUG_ON(!next_rq->inactive);
BUG_ON(next_rq->flags & REQ_STARTED);
/*
* if the device is different (not a normal case) just check if
......@@ -93,14 +93,21 @@ inline int bio_rq_in_between(struct bio *bio, struct request *rq,
/*
* can we safely merge with this request?
*/
inline int elv_rq_merge_ok(request_queue_t *q, struct request *rq,
struct bio *bio)
inline int elv_rq_merge_ok(struct request *rq, struct bio *bio)
{
if (bio_data_dir(bio) == rq->cmd) {
if (rq->rq_dev == bio->bi_dev && !rq->waiting
&& !rq->special && rq->inactive)
return 1;
}
/*
* different data direction or already started, don't merge
*/
if (bio_data_dir(bio) != rq_data_dir(rq))
return 0;
if (rq->flags & REQ_NOMERGE)
return 0;
/*
* same device and no special stuff set, merge is ok
*/
if (rq->rq_dev == bio->bi_dev && !rq->waiting && !rq->special)
return 1;
return 0;
}
......@@ -124,14 +131,12 @@ int elevator_linus_merge(request_queue_t *q, struct request **req,
*/
if (__rq->elevator_sequence-- <= 0)
break;
if (unlikely(__rq->waiting || __rq->special))
continue;
if (unlikely(!__rq->inactive))
if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
break;
if (!*req && bio_rq_in_between(bio, __rq, &q->queue_head))
*req = __rq;
if (!elv_rq_merge_ok(q, __rq, bio))
if (!elv_rq_merge_ok(__rq, bio))
continue;
if (__rq->elevator_sequence < count)
......@@ -218,11 +223,10 @@ int elevator_noop_merge(request_queue_t *q, struct request **req,
prefetch(list_entry_rq(entry->prev));
if (unlikely(__rq->waiting || __rq->special))
continue;
if (unlikely(!__rq->inactive))
if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
break;
if (!elv_rq_merge_ok(q, __rq, bio))
if (!elv_rq_merge_ok(__rq, bio))
continue;
/*
......
......@@ -2319,7 +2319,7 @@ static void request_done(int uptodate)
DPRINT("request list destroyed in floppy request done\n");
} else {
if (CURRENT->cmd == WRITE) {
if (rq_data_dir(CURRENT) == WRITE) {
/* record write error information */
DRWE->write_errors++;
if (DRWE->write_errors == 1) {
......@@ -2621,10 +2621,10 @@ static int make_raw_rw_request(void)
raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_DISK |
FD_RAW_NEED_SEEK;
raw_cmd->cmd_count = NR_RW;
if (CURRENT->cmd == READ){
if (rq_data_dir(CURRENT) == READ) {
raw_cmd->flags |= FD_RAW_READ;
COMMAND = FM_MODE(_floppy,FD_READ);
} else if (CURRENT->cmd == WRITE){
} else if (rq_data_dir(CURRENT) == WRITE){
raw_cmd->flags |= FD_RAW_WRITE;
COMMAND = FM_MODE(_floppy,FD_WRITE);
} else {
......@@ -2974,7 +2974,7 @@ static void do_fd_request(request_queue_t * q)
if (usage_count == 0) {
printk("warning: usage count=0, CURRENT=%p exiting\n", CURRENT);
printk("sect=%ld cmd=%d\n", CURRENT->sector, CURRENT->cmd);
printk("sect=%ld flags=%lx\n", CURRENT->sector, CURRENT->flags);
return;
}
if (fdc_busy){
......
......@@ -149,7 +149,8 @@ get_partition_list(char *page, char **start, off_t offset, int count)
char buf[64];
int len, n;
len = sprintf(page, "major minor #blocks name\n\n");
len = sprintf(page, "major minor #blocks start_sect nr_sects "
"name\n\n");
read_lock(&gendisk_lock);
for (gp = gendisk_head; gp; gp = gp->next) {
for (n = 0; n < (gp->nr_real << gp->minor_shift); n++) {
......@@ -157,8 +158,10 @@ get_partition_list(char *page, char **start, off_t offset, int count)
continue;
len += snprintf(page + len, 63,
"%4d %4d %10d %s\n",
"%4d %4d %10d %10lu %10lu %s\n",
gp->major, n, gp->sizes[n],
gp->part[n].start_sect,
gp->part[n].nr_sects,
disk_name(gp, n, buf));
if (len < offset)
offset -= len, len = 0;
......
......@@ -67,7 +67,7 @@ typedef struct {
__u8 reserved;
} rhdr_t;
#define SG_MAX 32
#define SG_MAX 31
typedef struct {
rhdr_t hdr;
sg_t sg[SG_MAX];
......
This diff is collapsed.
......@@ -149,30 +149,41 @@ static int nbd_xmit(int send, struct socket *sock, char *buf, int size, int msg_
void nbd_send_req(struct socket *sock, struct request *req)
{
int result;
int result, rw, i, flags;
struct nbd_request request;
unsigned long size = req->nr_sectors << 9;
DEBUG("NBD: sending control, ");
request.magic = htonl(NBD_REQUEST_MAGIC);
request.type = htonl(req->cmd);
request.type = htonl(req->flags);
request.from = cpu_to_be64( (u64) req->sector << 9);
request.len = htonl(size);
memcpy(request.handle, &req, sizeof(req));
result = nbd_xmit(1, sock, (char *) &request, sizeof(request), req->cmd == WRITE ? MSG_MORE : 0);
rw = rq_data_dir(req);
result = nbd_xmit(1, sock, (char *) &request, sizeof(request), rw & WRITE ? MSG_MORE : 0);
if (result <= 0)
FAIL("Sendmsg failed for control.");
if (req->cmd == WRITE) {
struct bio *bio = req->bio;
DEBUG("data, ");
do {
result = nbd_xmit(1, sock, bio_data(bio), bio->bi_size, bio->bi_next == NULL ? 0 : MSG_MORE);
if (result <= 0)
FAIL("Send data failed.");
bio = bio->bi_next;
} while(bio);
if (rw & WRITE) {
struct bio *bio;
/*
* we are really probing at internals to determine
* whether to set MSG_MORE or not...
*/
rq_for_each_bio(bio, req) {
struct bio_vec *bvec;
bio_for_each_segment(bvec, bio, i) {
flags = 0;
if ((i < (bio->bi_vcnt - 1)) || bio->bi_next)
flags = MSG_MORE;
DEBUG("data, ");
result = nbd_xmit(1, sock, page_address(bvec->bv_page) + bvec->bv_offset, bvec->bv_len, flags);
if (result <= 0)
FAIL("Send data failed.");
}
}
}
return;
......@@ -204,7 +215,7 @@ struct request *nbd_read_stat(struct nbd_device *lo)
HARDFAIL("Not enough magic.");
if (ntohl(reply.error))
FAIL("Other side returned error.");
if (req->cmd == READ) {
if (rq_data_dir(req) == READ) {
struct bio *bio = req->bio;
DEBUG("data, ");
do {
......@@ -321,10 +332,13 @@ static void do_nbd_request(request_queue_t * q)
if (dev >= MAX_NBD)
FAIL("Minor too big."); /* Probably can not happen */
#endif
if (!(req->flags & REQ_CMD))
goto error_out;
lo = &nbd_dev[dev];
if (!lo->file)
FAIL("Request when not-ready.");
if ((req->cmd == WRITE) && (lo->flags & NBD_READ_ONLY))
if ((rq_data_dir(req) == WRITE) && (lo->flags & NBD_READ_ONLY))
FAIL("Write on read-only");
#ifdef PARANOIA
if (lo->magic != LO_MAGIC)
......@@ -374,7 +388,7 @@ static int nbd_ioctl(struct inode *inode, struct file *file,
switch (cmd) {
case NBD_DISCONNECT:
printk("NBD_DISCONNECT\n") ;
sreq.cmd=2 ; /* shutdown command */
sreq.flags = REQ_SPECIAL; /* FIXME: interpet as shutdown cmd */
if (!lo->sock) return -EINVAL ;
nbd_send_req(lo->sock,&sreq) ;
return 0 ;
......
......@@ -768,7 +768,7 @@ static void do_pcd_request (request_queue_t * q)
while (1) {
if (QUEUE_EMPTY || (CURRENT->rq_status == RQ_INACTIVE)) return;
INIT_REQUEST;
if (CURRENT->cmd == READ) {
if (rq_data_dir(CURRENT) == READ) {
unit = MINOR(CURRENT->rq_dev);
if (unit != pcd_unit) {
pcd_bufblk = -1;
......
......@@ -858,7 +858,7 @@ static void do_pd_request (request_queue_t * q)
goto repeat;
}
pd_cmd = CURRENT->cmd;
pd_cmd = rq_data_dir(CURRENT);
pd_buf = CURRENT->buffer;
pd_retries = 0;
......@@ -884,7 +884,7 @@ static void pd_next_buf( int unit )
/* paranoia */
if (QUEUE_EMPTY ||
(CURRENT->cmd != pd_cmd) ||
(rq_data_dir(CURRENT) != pd_cmd) ||
(MINOR(CURRENT->rq_dev) != pd_dev) ||
(CURRENT->rq_status == RQ_INACTIVE) ||
(CURRENT->sector != pd_block))
......
......@@ -859,7 +859,7 @@ static void do_pf_request (request_queue_t * q)
goto repeat;
}
pf_cmd = CURRENT->cmd;
pf_cmd = rq_data_dir(CURRENT);
pf_buf = CURRENT->buffer;
pf_retries = 0;
......@@ -885,7 +885,7 @@ static void pf_next_buf( int unit )
/* paranoia */
if (QUEUE_EMPTY ||
(CURRENT->cmd != pf_cmd) ||
(rq_data_dir(CURRENT) != pf_cmd) ||
(DEVICE_NR(CURRENT->rq_dev) != pf_unit) ||
(CURRENT->rq_status == RQ_INACTIVE) ||
(CURRENT->sector != pf_block))
......
......@@ -485,7 +485,6 @@ static struct block_device_operations rd_bd_op = {
ioctl: rd_ioctl,
};
#ifdef MODULE
/* Before freeing the module, invalidate all of the protected buffers! */
static void __exit rd_cleanup (void)
{
......@@ -503,7 +502,6 @@ static void __exit rd_cleanup (void)
unregister_blkdev( MAJOR_NR, "ramdisk" );
blk_clear(MAJOR_NR);
}
#endif
/* This is the registration and initialization section of the RAM disk driver */
int __init rd_init (void)
......
......@@ -247,7 +247,7 @@
/* Define this to remove _all_ the debugging messages */
/* #define ERRLOGMASK CD_NOTHING */
#define ERRLOGMASK (CD_WARNING)
#define ERRLOGMASK CD_WARNING
/* #define ERRLOGMASK (CD_WARNING|CD_OPEN|CD_COUNT_TRACKS|CD_CLOSE) */
/* #define ERRLOGMASK (CD_WARNING|CD_REG_UNREG|CD_DO_IOCTL|CD_OPEN|CD_CLOSE|CD_COUNT_TRACKS) */
......
This diff is collapsed.
......@@ -384,7 +384,7 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsig
#endif /* CONFIG_BLK_DEV_PDC4030 */
#ifdef DEBUG
printk("%s: %sing: LBAsect=%ld, sectors=%ld, buffer=0x%08lx\n",
drive->name, (rq->cmd==READ)?"read":"writ",
drive->name, (rq_data_dir(rq)==READ)?"read":"writ",
block, rq->nr_sectors, (unsigned long) rq->buffer);
#endif
OUT_BYTE(block,IDE_SECTOR_REG);
......@@ -403,7 +403,7 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsig
OUT_BYTE(head|drive->select.all,IDE_SELECT_REG);
#ifdef DEBUG
printk("%s: %sing: CHS=%d/%d/%d, sectors=%ld, buffer=0x%08lx\n",
drive->name, (rq->cmd==READ)?"read":"writ", cyl,
drive->name, (rq_data_dir(rq)==READ)?"read":"writ", cyl,
head, sect, rq->nr_sectors, (unsigned long) rq->buffer);
#endif
}
......@@ -413,7 +413,7 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsig
return do_pdc4030_io (drive, rq);
}
#endif /* CONFIG_BLK_DEV_PDC4030 */
if (rq->cmd == READ) {
if (rq_data_dir(rq) == READ) {
#ifdef CONFIG_BLK_DEV_IDEDMA
if (drive->using_dma && !(HWIF(drive)->dmaproc(ide_dma_read, drive)))
return ide_started;
......@@ -422,7 +422,7 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsig
OUT_BYTE(drive->mult_count ? WIN_MULTREAD : WIN_READ, IDE_COMMAND_REG);
return ide_started;
}
if (rq->cmd == WRITE) {
if (rq_data_dir(rq) == WRITE) {
ide_startstop_t startstop;
#ifdef CONFIG_BLK_DEV_IDEDMA
if (drive->using_dma && !(HWIF(drive)->dmaproc(ide_dma_write, drive)))
......@@ -464,7 +464,7 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsig
}
return ide_started;
}
printk(KERN_ERR "%s: bad command: %d\n", drive->name, rq->cmd);
printk(KERN_ERR "%s: bad command: %lx\n", drive->name, rq->flags);
ide_end_request(0, HWGROUP(drive));
return ide_stopped;
}
......
......@@ -234,7 +234,7 @@ static int ide_build_sglist (ide_hwif_t *hwif, struct request *rq)
if (nents > rq->nr_segments)
printk("ide-dma: received %d segments, build %d\n", rq->nr_segments, nents);
if (rq->cmd == READ)
if (rq_data_dir(rq) == READ)
hwif->sg_dma_direction = PCI_DMA_FROMDEVICE;
else
hwif->sg_dma_direction = PCI_DMA_TODEVICE;
......
......@@ -151,6 +151,7 @@
#include <linux/ide.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/completion.h>
#include <linux/cdrom.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
......@@ -562,8 +563,7 @@ inline int __ide_end_request(ide_hwgroup_t *hwgroup, int uptodate, int nr_secs)
spin_lock_irqsave(&ide_lock, flags);
rq = hwgroup->rq;
if (rq->inactive)
BUG();
BUG_ON(!(rq->flags & REQ_STARTED));
/*
* small hack to eliminate locking from ide_end_request to grab
......@@ -878,7 +878,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err)
spin_lock_irqsave(&ide_lock, flags);
rq = HWGROUP(drive)->rq;
if (rq->cmd == IDE_DRIVE_CMD) {
if (rq->flags & REQ_DRIVE_CMD) {
byte *args = (byte *) rq->buffer;
rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
if (args) {
......@@ -886,7 +886,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err)
args[1] = err;
args[2] = IN_BYTE(IDE_NSECTOR_REG);
}
} else if (rq->cmd == IDE_DRIVE_TASK) {
} else if (rq->flags & REQ_DRIVE_TASK) {
byte *args = (byte *) rq->buffer;
rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
if (args) {
......@@ -901,8 +901,6 @@ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err)
}
spin_lock(DRIVE_LOCK(drive));
if (rq->inactive)
BUG();
blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL;
end_that_request_last(rq);
......@@ -1010,7 +1008,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat)
if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL)
return ide_stopped;
/* retry only "normal" I/O: */
if (rq->cmd == IDE_DRIVE_CMD || rq->cmd == IDE_DRIVE_TASK) {
if (!(rq->flags & REQ_CMD)) {
rq->errors = 1;
ide_end_drive_cmd(drive, stat, err);
return ide_stopped;
......@@ -1030,7 +1028,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat)
else if (err & TRK0_ERR) /* help it find track zero */
rq->errors |= ERROR_RECAL;
}
if ((stat & DRQ_STAT) && rq->cmd != WRITE)
if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ)
try_to_flush_leftover_data(drive);
}
if (GET_STAT() & (BUSY_STAT|DRQ_STAT))
......@@ -1177,7 +1175,7 @@ int ide_wait_stat (ide_startstop_t *startstop, ide_drive_t *drive, byte good, by
static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, struct request *rq)
{
byte *args = rq->buffer;
if (args && rq->cmd == IDE_DRIVE_TASK) {
if (args && (rq->flags & REQ_DRIVE_TASK)) {
byte sel;
#ifdef DEBUG
printk("%s: DRIVE_TASK_CMD data=x%02x cmd=0x%02x fr=0x%02x ns=0x%02x sc=0x%02x lcyl=0x%02x hcyl=0x%02x sel=0x%02x\n",
......@@ -1234,8 +1232,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
unsigned int minor = MINOR(rq->rq_dev), unit = minor >> PARTN_BITS;
ide_hwif_t *hwif = HWIF(drive);
if (rq->inactive)
BUG();
BUG_ON(!(rq->flags & REQ_STARTED));
#ifdef DEBUG
printk("%s: start_request: current=0x%08lx\n", hwif->name, (unsigned long) rq);
......@@ -1259,7 +1256,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
block = rq->sector;
/* Strange disk manager remap */
if ((rq->cmd == READ || rq->cmd == WRITE) &&
if ((rq->flags & REQ_CMD) &&
(drive->media == ide_disk || drive->media == ide_floppy)) {
block += drive->sect0;
}
......@@ -1279,9 +1276,9 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
return startstop;
}
if (!drive->special.all) {
if (rq->cmd == IDE_DRIVE_CMD || rq->cmd == IDE_DRIVE_TASK) {
if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK))
return execute_drive_cmd(drive, rq);
}
if (drive->driver != NULL) {
return (DRIVER(drive)->do_request(drive, rq, block));
}
......@@ -1831,7 +1828,7 @@ ide_drive_t *get_info_ptr (kdev_t i_rdev)
void ide_init_drive_cmd (struct request *rq)
{
memset(rq, 0, sizeof(*rq));
rq->cmd = IDE_DRIVE_CMD;
rq->flags = REQ_DRIVE_CMD;
}
/*
......@@ -2612,7 +2609,7 @@ int ide_wait_cmd_task (ide_drive_t *drive, byte *buf)
struct request rq;
ide_init_drive_cmd(&rq);
rq.cmd = IDE_DRIVE_TASK;
rq.flags = REQ_DRIVE_TASK;
rq.buffer = buf;
return ide_do_drive_cmd(drive, &rq, ide_wait);
}
......@@ -2836,6 +2833,13 @@ static int ide_ioctl (struct inode *inode, struct file *file,
case BLKBSZSET:
return blk_ioctl(inode->i_rdev, cmd, arg);
/*
* uniform packet command handling
*/
case CDROMEJECT:
case CDROMCLOSETRAY:
return block_ioctl(inode->i_rdev, cmd, arg);
case HDIO_GET_BUSSTATE:
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
......
This diff is collapsed.
......@@ -168,7 +168,7 @@ isdn_divert_close(struct inode *ino, struct file *filep)
divert_info_head = divert_info_head->next;
kfree(inf);
}
spin_unlock_irq( &divert_info_lock, flags );
spin_unlock_irqrestore( &divert_info_lock, flags );
return (0);
} /* isdn_divert_close */
......@@ -261,6 +261,7 @@ isdn_divert_ioctl(struct inode *inode, struct file *file,
#ifdef CONFIG_PROC_FS
static struct file_operations isdn_fops =
{
owner: THIS_MODULE,
llseek: no_llseek,
read: isdn_divert_read,
write: isdn_divert_write,
......
......@@ -808,7 +808,9 @@ void DivasDoDpc(void *pData)
while(i--)
{
DivaDoCardDpc(card++);
if (card->state == DIA_RUNNING)
DivaDoCardDpc(card);
card++;
}
}
......
......@@ -1550,7 +1550,7 @@ int eicon_mca_find_card(int type, /* type-idx of eicon-card */
};
};
/* all adapter flavors checked without match, finito with: */
return ENODEV;
return -ENODEV;
};
......@@ -1597,14 +1597,14 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */
membase = cards_membase;
} else {
if (membase != cards_membase)
return ENODEV;
return -ENODEV;
};
cards_irq=irq_array[((adf_pos0 & 0xC)>>2)];
if (irq == -1) {
irq = cards_irq;
} else {
if (irq != cards_irq)
return ENODEV;
return -ENODEV;
};
cards_io= 0xC00 + ((adf_pos0>>4)*0x10);
type = EICON_CTYPE_ISAPRI;
......@@ -1616,14 +1616,14 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */
membase = cards_membase;
} else {
if (membase != cards_membase)
return ENODEV;
return -ENODEV;
};
cards_irq=irq_array[((adf_pos0 & 0xC)>>2)];
if (irq == -1) {
irq = cards_irq;
} else {
if (irq != cards_irq)
return ENODEV;
return -ENODEV;
};
cards_io= 0xC00 + ((adf_pos0>>4)*0x10);
......@@ -1637,12 +1637,12 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */
irq = cards_irq;
} else {
if (irq != cards_irq)
return ENODEV;
return -ENODEV;
};
type = 0;
break;
default:
return ENODEV;
return -ENODEV;
};
/* matching membase & irq */
if ( 1 == eicon_addcard(type, membase, irq, id, 0)) {
......@@ -1661,7 +1661,7 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */
cards->mca_slot+1);
return 0 ; /* eicon_addcard added a card */
} else {
return ENODEV;
return -ENODEV;
};
};
#endif /* CONFIG_MCA */
......
......@@ -533,7 +533,7 @@ static inline void hdlc_xpr_irq(struct fritz_bcs *bcs)
dev_kfree_skb_irq(skb);
}
static void hdlc_irq(struct fritz_bcs *bcs, u32 stat)
static void hdlc_irq_one(struct fritz_bcs *bcs, u32 stat)
{
DBG(0x10, "ch%d stat %#x", bcs->channel, stat);
if (stat & HDLC_INT_RPR) {
......@@ -550,7 +550,7 @@ static void hdlc_irq(struct fritz_bcs *bcs, u32 stat)
}
}
static inline void hdlc_interrupt(struct fritz_adapter *adapter)
static inline void hdlc_irq(struct fritz_adapter *adapter)
{
int nr;
u32 stat;
......@@ -559,7 +559,7 @@ static inline void hdlc_interrupt(struct fritz_adapter *adapter)
stat = adapter->read_hdlc_status(adapter, nr);
DBG(0x10, "HDLC %c stat %#x", 'A' + nr, stat);
if (stat & HDLC_INT_MASK)
hdlc_irq(&adapter->bcs[nr], stat);
hdlc_irq_one(&adapter->bcs[nr], stat);
}
}
......@@ -642,10 +642,10 @@ static void fcpci2_irq(int intno, void *dev, struct pt_regs *regs)
return;
DBG(2, "STATUS0 %#x", val);
if (val & AVM_STATUS0_IRQ_ISAC)
isacsx_interrupt(&adapter->isac);
isacsx_irq(&adapter->isac);
if (val & AVM_STATUS0_IRQ_HDLC)
hdlc_interrupt(adapter);
hdlc_irq(adapter);
}
static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
......@@ -659,10 +659,10 @@ static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
return;
DBG(2, "sval %#x", sval);
if (!(sval & AVM_STATUS0_IRQ_ISAC))
isac_interrupt(&adapter->isac);
isac_irq(&adapter->isac);
if (!(sval & AVM_STATUS0_IRQ_HDLC))
hdlc_interrupt(adapter);
hdlc_irq(adapter);
}
// ----------------------------------------------------------------------
......
......@@ -601,7 +601,7 @@ static inline void isac_exi_interrupt(struct isac *isac)
}
}
void isac_interrupt(struct isac *isac)
void isac_irq(struct isac *isac)
{
unsigned char val;
......@@ -741,7 +741,7 @@ static inline void isacsx_icd_interrupt(struct isac *isac)
}
}
void isacsx_interrupt(struct isac *isac)
void isacsx_irq(struct isac *isac)
{
unsigned char val;
......@@ -887,10 +887,10 @@ EXPORT_SYMBOL(isac_init);
EXPORT_SYMBOL(isac_d_l2l1);
EXPORT_SYMBOL(isacsx_setup);
EXPORT_SYMBOL(isacsx_interrupt);
EXPORT_SYMBOL(isacsx_irq);
EXPORT_SYMBOL(isac_setup);
EXPORT_SYMBOL(isac_interrupt);
EXPORT_SYMBOL(isac_irq);
module_init(hisax_isac_init);
module_exit(hisax_isac_exit);
......@@ -37,9 +37,9 @@ void isac_init(struct isac *isac);
void isac_d_l2l1(struct hisax_if *hisax_d_if, int pr, void *arg);
void isac_setup(struct isac *isac);
void isac_interrupt(struct isac *isac);
void isac_irq(struct isac *isac);
void isacsx_setup(struct isac *isac);
void isacsx_interrupt(struct isac *isac);
void isacsx_irq(struct isac *isac);
#endif
......@@ -275,7 +275,7 @@ static int __devinit st5481_setup_b_out(struct st5481_bcs *bcs)
usb_b_out_complete, bcs);
}
static void __devexit st5481_release_b_out(struct st5481_bcs *bcs)
static void st5481_release_b_out(struct st5481_bcs *bcs)
{
struct st5481_b_out *b_out = &bcs->b_out;
......@@ -316,7 +316,7 @@ int __devinit st5481_setup_b(struct st5481_bcs *bcs)
/*
* Release buffers and URBs for the B channels
*/
void __devexit st5481_release_b(struct st5481_bcs *bcs)
void st5481_release_b(struct st5481_bcs *bcs)
{
DBG(4,"");
......
......@@ -673,7 +673,7 @@ static int __devinit st5481_setup_d_out(struct st5481_adapter *adapter)
usb_d_out_complete, adapter);
}
static void __devexit st5481_release_d_out(struct st5481_adapter *adapter)
static void st5481_release_d_out(struct st5481_adapter *adapter)
{
struct st5481_d_out *d_out = &adapter->d_out;
......@@ -723,7 +723,7 @@ int __devinit st5481_setup_d(struct st5481_adapter *adapter)
return retval;
}
void __devexit st5481_release_d(struct st5481_adapter *adapter)
void st5481_release_d(struct st5481_adapter *adapter)
{
DBG(2,"");
......
......@@ -307,7 +307,7 @@ int __devinit st5481_setup_usb(struct st5481_adapter *adapter)
* Release buffers and URBs for the interrupt and control
* endpoint.
*/
void __devexit st5481_release_usb(struct st5481_adapter *adapter)
void st5481_release_usb(struct st5481_adapter *adapter)
{
struct st5481_intr *intr = &adapter->intr;
struct st5481_ctrl *ctrl = &adapter->ctrl;
......@@ -443,7 +443,7 @@ st5481_setup_isocpipes(struct urb* urb[2], struct usb_device *dev,
return retval;
}
void __devexit st5481_release_isocpipes(struct urb* urb[2])
void st5481_release_isocpipes(struct urb* urb[2])
{
int j;
......@@ -547,7 +547,7 @@ int __devinit st5481_setup_in(struct st5481_in *in)
return retval;
}
void __devexit st5481_release_in(struct st5481_in *in)
void st5481_release_in(struct st5481_in *in)
{
DBG(2,"");
......
This diff is collapsed.
......@@ -74,7 +74,6 @@ struct saa7146
unsigned int nr;
unsigned long irq; /* IRQ used by SAA7146 card */
unsigned short id;
struct i2c_bus i2c;
struct pci_dev *dev;
unsigned char revision;
unsigned char boardcfg[64]; /* 64 bytes of config from eeprom */
......
......@@ -45,7 +45,6 @@
#include <asm/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/videodev.h>
#include <linux/i2c-old.h>
#include "saa7146.h"
#include "saa7146reg.h"
......@@ -142,14 +141,13 @@ static void I2CWipe(struct saa7146 *saa)
!(saaread(SAA7146_MC2) & SAA7146_MC2_UPLD_I2C); i++)
schedule();
}
/* read I2C */
static int I2CRead(struct i2c_bus *bus, unsigned char addr,
static int I2CRead(struct saa7146 *saa, unsigned char addr,
unsigned char subaddr, int dosub)
{
struct saa7146 *saa = (struct saa7146 *) bus->data;
int i;
if (saaread(SAA7146_I2C_STATUS) & 0x3c)
I2CWipe(saa);
for (i = 0; i < 1000 &&
......@@ -194,17 +192,12 @@ static int I2CRead(struct i2c_bus *bus, unsigned char addr,
printk("i2c read timeout\n");
return ((saaread(SAA7146_I2C_TRANSFER) >> 24) & 0xff);
}
static int I2CReadOld(struct i2c_bus *bus, unsigned char addr)
{
return I2CRead(bus, addr, 0, 0);
}
/* set both to write both bytes, reset it to write only b1 */
static int I2CWrite(struct i2c_bus *bus, unsigned char addr, unsigned char b1,
static int I2CWrite(struct saa7146 *saa, unsigned char addr, unsigned char b1,
unsigned char b2, int both)
{
struct saa7146 *saa = (struct saa7146 *) bus->data;
int i;
u32 data;
......@@ -226,15 +219,14 @@ static int I2CWrite(struct i2c_bus *bus, unsigned char addr, unsigned char b1,
return 0;
}
static void attach_inform(struct i2c_bus *bus, int id)
static void attach_inform(struct saa7146 *saa, int id)
{
struct saa7146 *saa = (struct saa7146 *) bus->data;
int i;
DEBUG(printk(KERN_DEBUG "stradis%d: i2c: device found=%02x\n", saa->nr, id));
if (id == 0xa0) { /* we have rev2 or later board, fill in info */
for (i = 0; i < 64; i++)
saa->boardcfg[i] = I2CRead(bus, 0xa0, i, 1);
saa->boardcfg[i] = I2CRead(saa, 0xa0, i, 1);
#ifdef USE_RESCUE_EEPROM_SDM275
if (saa->boardcfg[0] != 0) {
printk("stradis%d: WARNING: EEPROM STORED VALUES HAVE BEEN IGNORED\n", saa->nr);
......@@ -250,35 +242,20 @@ static void attach_inform(struct i2c_bus *bus, int id)
}
}
static void detach_inform(struct i2c_bus *bus, int id)
static void detach_inform(struct saa7146 *saa, int id)
{
struct saa7146 *saa = (struct saa7146 *) bus->data;
int i;
i = saa->nr;
}
static void I2CBusScan(struct i2c_bus *bus)
static void I2CBusScan(struct saa7146 *saa)
{
int i;
for (i = 0; i < 0xff; i += 2)
if ((I2CRead(bus, i, 0, 0)) >= 0)
attach_inform(bus, i);
if ((I2CRead(saa, i, 0, 0)) >= 0)
attach_inform(saa, i);
}
static struct i2c_bus saa7146_i2c_bus_template =
{
"saa7146",
I2C_BUSID_BT848,
NULL,
SPIN_LOCK_UNLOCKED,
attach_inform,
detach_inform,
NULL,
NULL,
I2CReadOld,
I2CWrite,
};
static int debiwait_maxwait = 0;
static int wait_for_debi_done(struct saa7146 *saa)
......@@ -664,10 +641,8 @@ static int ibm_send_command(struct saa7146 *saa,
static void cs4341_setlevel(struct saa7146 *saa, int left, int right)
{
I2CWrite(&(saa->i2c), 0x22, 0x03,
left > 94 ? 94 : left, 2);
I2CWrite(&(saa->i2c), 0x22, 0x04,
right > 94 ? 94 : right, 2);
I2CWrite(saa, 0x22, 0x03, left > 94 ? 94 : left, 2);
I2CWrite(saa, 0x22, 0x04, right > 94 ? 94 : right, 2);
}
static void initialize_cs4341(struct saa7146 *saa)
......@@ -676,15 +651,15 @@ static void initialize_cs4341(struct saa7146 *saa)
for (i = 0; i < 200; i++) {
/* auto mute off, power on, no de-emphasis */
/* I2S data up to 24-bit 64xFs internal SCLK */
I2CWrite(&(saa->i2c), 0x22, 0x01, 0x11, 2);
I2CWrite(saa, 0x22, 0x01, 0x11, 2);
/* ATAPI mixer settings */
I2CWrite(&(saa->i2c), 0x22, 0x02, 0x49, 2);
I2CWrite(saa, 0x22, 0x02, 0x49, 2);
/* attenuation left 3db */
I2CWrite(&(saa->i2c), 0x22, 0x03, 0x00, 2);
I2CWrite(saa, 0x22, 0x03, 0x00, 2);
/* attenuation right 3db */
I2CWrite(&(saa->i2c), 0x22, 0x04, 0x00, 2);
I2CWrite(&(saa->i2c), 0x22, 0x01, 0x10, 2);
if (I2CRead(&(saa->i2c), 0x22, 0x02, 1) == 0x49)
I2CWrite(saa, 0x22, 0x04, 0x00, 2);
I2CWrite(saa, 0x22, 0x01, 0x10, 2);
if (I2CRead(saa, 0x22, 0x02, 1) == 0x49)
break;
schedule();
}
......@@ -701,10 +676,10 @@ static void initialize_cs8420(struct saa7146 *saa, int pro)
else
sequence = mode8420con;
for (i = 0; i < INIT8420LEN; i++)
I2CWrite(&(saa->i2c), 0x20, init8420[i * 2],
I2CWrite(saa, 0x20, init8420[i * 2],
init8420[i * 2 + 1], 2);
for (i = 0; i < MODE8420LEN; i++)
I2CWrite(&(saa->i2c), 0x20, sequence[i * 2],
I2CWrite(saa, 0x20, sequence[i * 2],
sequence[i * 2 + 1], 2);
printk("stradis%d: CS8420 initialized\n", saa->nr);
}
......@@ -722,39 +697,39 @@ static void initialize_saa7121(struct saa7146 *saa, int dopal)
for (i = 0; i < INIT7121LEN; i++) {
if (NewCard) { /* handle new card encoder differences */
if (sequence[i*2] == 0x3a)
I2CWrite(&(saa->i2c), 0x88, 0x3a, 0x13, 2);
I2CWrite(saa, 0x88, 0x3a, 0x13, 2);
else if (sequence[i*2] == 0x6b)
I2CWrite(&(saa->i2c), 0x88, 0x6b, 0x20, 2);
I2CWrite(saa, 0x88, 0x6b, 0x20, 2);
else if (sequence[i*2] == 0x6c)
I2CWrite(&(saa->i2c), 0x88, 0x6c,
I2CWrite(saa, 0x88, 0x6c,
dopal ? 0x09 : 0xf5, 2);
else if (sequence[i*2] == 0x6d)
I2CWrite(&(saa->i2c), 0x88, 0x6d,
I2CWrite(saa, 0x88, 0x6d,
dopal ? 0x20 : 0x00, 2);
else if (sequence[i*2] == 0x7a)
I2CWrite(&(saa->i2c), 0x88, 0x7a,
I2CWrite(saa, 0x88, 0x7a,
dopal ? (PALFirstActive - 1) :
(NTSCFirstActive - 4), 2);
else if (sequence[i*2] == 0x7b)
I2CWrite(&(saa->i2c), 0x88, 0x7b,
I2CWrite(saa, 0x88, 0x7b,
dopal ? PALLastActive :
NTSCLastActive, 2);
else I2CWrite(&(saa->i2c), 0x88, sequence[i * 2],
else I2CWrite(saa, 0x88, sequence[i * 2],
sequence[i * 2 + 1], 2);
} else {
if (sequence[i*2] == 0x6b && mod)
I2CWrite(&(saa->i2c), 0x88, 0x6b,
I2CWrite(saa, 0x88, 0x6b,
(sequence[i * 2 + 1] ^ 0x09), 2);
else if (sequence[i*2] == 0x7a)
I2CWrite(&(saa->i2c), 0x88, 0x7a,
I2CWrite(saa, 0x88, 0x7a,
dopal ? (PALFirstActive - 1) :
(NTSCFirstActive - 4), 2);
else if (sequence[i*2] == 0x7b)
I2CWrite(&(saa->i2c), 0x88, 0x7b,
I2CWrite(saa, 0x88, 0x7b,
dopal ? PALLastActive :
NTSCLastActive, 2);
else
I2CWrite(&(saa->i2c), 0x88, sequence[i * 2],
I2CWrite(saa, 0x88, sequence[i * 2],
sequence[i * 2 + 1], 2);
}
}
......@@ -2060,10 +2035,7 @@ static int configure_saa7146(struct pci_dev *dev, int num)
if (!saa->saa7146_mem)
return -EIO;
memcpy(&(saa->i2c), &saa7146_i2c_bus_template, sizeof(struct i2c_bus));
memcpy(&saa->video_dev, &saa_template, sizeof(saa_template));
sprintf(saa->i2c.name, "stradis%d", num);
saa->i2c.data = saa;
saawrite(0, SAA7146_IER); /* turn off all interrupts */
result = request_irq(saa->irq, saa7146_irq,
SA_SHIRQ | SA_INTERRUPT, "stradis", (void *) saa);
......@@ -2082,10 +2054,6 @@ static int configure_saa7146(struct pci_dev *dev, int num)
iounmap(saa->saa7146_mem);
return -1;
}
#if 0
/* i2c generic interface is currently BROKEN */
i2c_register_bus(&saa->i2c);
#endif
return 0;
}
......@@ -2176,7 +2144,7 @@ static int init_saa7146(int i)
saawrite(4, SAA7146_PAGE2); /* dma direction: read, no byteswap */
saawrite(((SAA7146_MC2_UPLD_DMA2) << 16) | SAA7146_MC2_UPLD_DMA2,
SAA7146_MC2);
I2CBusScan(&(saa->i2c));
I2CBusScan(saa);
return 0;
}
......@@ -2194,10 +2162,6 @@ static void release_saa(void)
saawrite(0, SAA7146_MC2);
saawrite(0, SAA7146_IER);
saawrite(0xffffffffUL, SAA7146_ISR);
#if 0
/* unregister i2c_bus */
i2c_unregister_bus((&saa->i2c));
#endif
/* disable PCI bus-mastering */
pci_read_config_byte(saa->dev, PCI_COMMAND, &command);
......
......@@ -267,7 +267,7 @@ static void idescsi_end_request (byte uptodate, ide_hwgroup_t *hwgroup)
u8 *scsi_buf;
unsigned long flags;
if (rq->cmd != IDESCSI_PC_RQ) {
if (!(rq->flags & REQ_SPECIAL)) {
ide_end_request (uptodate, hwgroup);
return;
}
......@@ -463,10 +463,10 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r
printk (KERN_INFO "sector: %ld, nr_sectors: %ld, current_nr_sectors: %ld\n",rq->sector,rq->nr_sectors,rq->current_nr_sectors);
#endif /* IDESCSI_DEBUG_LOG */
if (rq->cmd == IDESCSI_PC_RQ) {
if (rq->flags & REQ_SPECIAL) {
return idescsi_issue_pc (drive, (idescsi_pc_t *) rq->buffer);
}
printk (KERN_ERR "ide-scsi: %s: unsupported command in request queue (%x)\n", drive->name, rq->cmd);
blk_dump_rq_flags(rq, "ide-scsi: unsup command");
idescsi_end_request (0,HWGROUP (drive));
return ide_stopped;
}
......@@ -804,7 +804,7 @@ int idescsi_queue (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
ide_init_drive_cmd (rq);
rq->buffer = (char *) pc;
rq->bio = idescsi_dma_bio (drive, pc);
rq->cmd = IDESCSI_PC_RQ;
rq->flags = REQ_SPECIAL;
spin_unlock(&cmd->host->host_lock);
(void) ide_do_drive_cmd (drive, rq, ide_end);
spin_lock_irq(&cmd->host->host_lock);
......
......@@ -72,13 +72,12 @@ static void __scsi_insert_special(request_queue_t *q, struct request *rq,
ASSERT_LOCK(&q->queue_lock, 0);
rq->cmd = SPECIAL;
rq->flags = REQ_SPECIAL | REQ_NOMERGE | REQ_BARRIER;
rq->special = data;
rq->q = NULL;
rq->bio = rq->biotail = NULL;
rq->nr_segments = 0;
rq->elevator_sequence = 0;
rq->inactive = 0;
/*
* We have the option of inserting the head or the tail of the queue.
......@@ -262,6 +261,9 @@ void scsi_queue_next_request(request_queue_t * q, Scsi_Cmnd * SCpnt)
* the bad sector.
*/
SCpnt->request.special = (void *) SCpnt;
#if 0
SCpnt->request.flags |= REQ_SPECIAL;
#endif
list_add(&SCpnt->request.queuelist, &q->queue_head);
}
......@@ -544,7 +546,7 @@ void scsi_io_completion(Scsi_Cmnd * SCpnt, int good_sectors,
if (bbpnt) {
for (i = 0; i < SCpnt->use_sg; i++) {
if (bbpnt[i]) {
if (SCpnt->request.cmd == READ) {
if (rq_data_dir(req) == READ) {
memcpy(bbpnt[i],
sgpnt[i].address,
sgpnt[i].length);
......@@ -556,7 +558,7 @@ void scsi_io_completion(Scsi_Cmnd * SCpnt, int good_sectors,
scsi_free(SCpnt->buffer, SCpnt->sglist_len);
} else {
if (SCpnt->buffer != req->buffer) {
if (req->cmd == READ) {
if (rq_data_dir(req) == READ) {
unsigned long flags;
char *to = bio_kmap_irq(req->bio, &flags);
......@@ -901,8 +903,7 @@ void scsi_request_fn(request_queue_t * q)
break;
/*
* get next queueable request. cur_rq would be set if we
* previously had to abort for some reason
* get next queueable request.
*/
req = elv_next_request(q);
......@@ -916,7 +917,7 @@ void scsi_request_fn(request_queue_t * q)
* these two cases differently. We differentiate by looking
* at request.cmd, as this tells us the real story.
*/
if (req->cmd == SPECIAL) {
if (req->flags & REQ_SPECIAL) {
STpnt = NULL;
SCpnt = (Scsi_Cmnd *) req->special;
SRpnt = (Scsi_Request *) req->special;
......@@ -929,7 +930,7 @@ void scsi_request_fn(request_queue_t * q)
scsi_init_cmd_from_req(SCpnt, SRpnt);
}
} else {
} else if (req->flags & REQ_CMD) {
SRpnt = NULL;
STpnt = scsi_get_request_dev(req);
if (!STpnt) {
......@@ -938,7 +939,7 @@ void scsi_request_fn(request_queue_t * q)
/*
* Now try and find a command block that we can use.
*/
if( req->special != NULL ) {
if (req->special) {
SCpnt = (Scsi_Cmnd *) req->special;
/*
* We need to recount the number of
......@@ -959,6 +960,9 @@ void scsi_request_fn(request_queue_t * q)
*/
if (!SCpnt)
break;
} else {
blk_dump_rq_flags(req, "SCSI bad req");
break;
}
/*
......@@ -997,7 +1001,7 @@ void scsi_request_fn(request_queue_t * q)
req = NULL;
spin_unlock_irq(&q->queue_lock);
if (SCpnt->request.cmd != SPECIAL) {
if (SCpnt->request.flags & REQ_CMD) {
/*
* This will do a couple of things:
* 1) Fill in the actual SCSI command.
......@@ -1010,9 +1014,9 @@ void scsi_request_fn(request_queue_t * q)
* some kinds of consistency checking may cause the
* request to be rejected immediately.
*/
if (STpnt == NULL) {
STpnt = scsi_get_request_dev(req);
}
if (STpnt == NULL)
STpnt = scsi_get_request_dev(&SCpnt->request);
/*
* This sets up the scatter-gather table (allocating if
* required). Hosts that need bounce buffers will also
......
......@@ -225,7 +225,7 @@ static inline int scsi_new_mergeable(request_queue_t * q,
static inline int scsi_new_segment(request_queue_t * q,
struct request * req,
struct Scsi_Host *SHpnt)
struct bio *bio)
{
/*
* pci_map_sg won't be able to map these two
......@@ -234,11 +234,11 @@ static inline int scsi_new_segment(request_queue_t * q,
*/
if (req->nr_hw_segments >= q->max_segments)
return 0;
else if (req->nr_segments >= q->max_segments)
else if (req->nr_segments + bio->bi_vcnt > q->max_segments)
return 0;
req->nr_hw_segments++;
req->nr_segments++;
req->nr_hw_segments += bio->bi_vcnt;
req->nr_segments += bio->bi_vcnt;
return 1;
}
......@@ -246,16 +246,16 @@ static inline int scsi_new_segment(request_queue_t * q,
static inline int scsi_new_segment(request_queue_t * q,
struct request * req,
struct Scsi_Host *SHpnt)
struct bio *bio)
{
if (req->nr_segments >= q->max_segments)
if (req->nr_segments + bio->bi_vcnt > q->max_segments)
return 0;
/*
* This will form the start of a new segment. Bump the
* counter.
*/
req->nr_segments++;
req->nr_segments += bio->bi_vcnt;
return 1;
}
#endif
......@@ -297,8 +297,6 @@ __inline static int __scsi_back_merge_fn(request_queue_t * q,
struct bio *bio,
int dma_host)
{
Scsi_Device *SDpnt = q->queuedata;
if (req->nr_sectors + bio_sectors(bio) > q->max_sectors)
return 0;
else if (!BIO_SEG_BOUNDARY(q, req->biotail, bio))
......@@ -306,9 +304,9 @@ __inline static int __scsi_back_merge_fn(request_queue_t * q,
#ifdef DMA_CHUNK_SIZE
if (MERGEABLE_BUFFERS(req->biotail, bio))
return scsi_new_mergeable(q, req, SDpnt->host);
return scsi_new_mergeable(q, req, q->queuedata);
#endif
return scsi_new_segment(q, req, SDpnt->host);
return scsi_new_segment(q, req, bio);
}
__inline static int __scsi_front_merge_fn(request_queue_t * q,
......@@ -316,8 +314,6 @@ __inline static int __scsi_front_merge_fn(request_queue_t * q,
struct bio *bio,
int dma_host)
{
Scsi_Device *SDpnt = q->queuedata;
if (req->nr_sectors + bio_sectors(bio) > q->max_sectors)
return 0;
else if (!BIO_SEG_BOUNDARY(q, bio, req->bio))
......@@ -325,9 +321,9 @@ __inline static int __scsi_front_merge_fn(request_queue_t * q,
#ifdef DMA_CHUNK_SIZE
if (MERGEABLE_BUFFERS(bio, req->bio))
return scsi_new_mergeable(q, req, SDpnt->host);
return scsi_new_mergeable(q, req, q->queuedata);
#endif
return scsi_new_segment(q, req, SDpnt->host);
return scsi_new_segment(q, req, bio);
}
/*
......@@ -686,10 +682,9 @@ __inline static int __init_io(Scsi_Cmnd * SCpnt,
}
break;
}
if (req->cmd == WRITE) {
if (rq_data_dir(req) == WRITE)
memcpy(sgpnt[i].address, bbpnt[i],
sgpnt[i].length);
}
}
}
return 1;
......@@ -778,7 +773,7 @@ __inline static int __init_io(Scsi_Cmnd * SCpnt,
return 0;
}
}
if (req->cmd == WRITE) {
if (rq_data_dir(req) == WRITE) {
unsigned long flags;
char *buf = bio_kmap_irq(bio, &flags);
memcpy(buff, buf, this_count << 9);
......
......@@ -354,21 +354,17 @@ static int sd_init_command(Scsi_Cmnd * SCpnt)
this_count = this_count >> 3;
}
}
switch (SCpnt->request.cmd) {
case WRITE:
if (rq_data_dir(&SCpnt->request) == WRITE) {
if (!dpnt->device->writeable) {
return 0;
}
SCpnt->cmnd[0] = WRITE_6;
SCpnt->sc_data_direction = SCSI_DATA_WRITE;
break;
case READ:
} else if (rq_data_dir(&SCpnt->request) == READ) {
SCpnt->cmnd[0] = READ_6;
SCpnt->sc_data_direction = SCSI_DATA_READ;
break;
default:
panic("Unknown sd command %d\n", SCpnt->request.cmd);
}
} else
panic("Unknown sd command %lx\n", SCpnt->request.flags);
SCSI_LOG_HLQUEUE(2, printk("%s : %s %d/%ld 512 byte blocks.\n",
nbuff,
......
......@@ -388,7 +388,12 @@ static int sr_init_command(Scsi_Cmnd * SCpnt)
return 0;
}
if ((SCpnt->request.cmd == WRITE) && !scsi_CDs[dev].device->writeable)
if (!(SCpnt->request.flags & REQ_CMD)) {
blk_dump_rq_flags(&SCpnt->request, "sr unsup command");
return 0;
}
if (rq_data_dir(&SCpnt->request) == WRITE && !scsi_CDs[dev].device->writeable)
return 0;
/*
......@@ -408,7 +413,18 @@ static int sr_init_command(Scsi_Cmnd * SCpnt)
return 0;
}
block = SCpnt->request.sector / (s_size >> 9);
if (rq_data_dir(&SCpnt->request) == WRITE) {
if (!scsi_CDs[dev].device->writeable)
return 0;
SCpnt->cmnd[0] = WRITE_10;
SCpnt->sc_data_direction = SCSI_DATA_WRITE;
} else if (rq_data_dir(&SCpnt->request) == READ) {
SCpnt->cmnd[0] = READ_10;
SCpnt->sc_data_direction = SCSI_DATA_READ;
} else {
blk_dump_rq_flags(&SCpnt->request, "Unknown sr command");
return 0;
}
/*
* request doesn't start on hw block boundary, add scatter pads
......@@ -419,19 +435,6 @@ static int sr_init_command(Scsi_Cmnd * SCpnt)
this_count = (SCpnt->request_bufflen >> 9) / (s_size >> 9);
switch (SCpnt->request.cmd) {
case WRITE:
SCpnt->cmnd[0] = WRITE_10;
SCpnt->sc_data_direction = SCSI_DATA_WRITE;
break;
case READ:
SCpnt->cmnd[0] = READ_10;
SCpnt->sc_data_direction = SCSI_DATA_READ;
break;
default:
printk("Unknown sr command %d\n", SCpnt->request.cmd);
return 0;
}
SCSI_LOG_HLQUEUE(2, printk("sr%d : %s %d/%ld 512 byte blocks.\n",
devm,
......@@ -441,6 +444,8 @@ static int sr_init_command(Scsi_Cmnd * SCpnt)
SCpnt->cmnd[1] = (SCpnt->device->scsi_level <= SCSI_2) ?
((SCpnt->lun << 5) & 0xe0) : 0;
block = SCpnt->request.sector / (s_size >> 9);
if (this_count > 0xffff)
this_count = 0xffff;
......
......@@ -74,7 +74,7 @@ static inline struct bio *__bio_pool_get(void)
struct bio *bio;
if ((bio = bio_pool)) {
BUG_ON(bio_pool_free <= 0);
BIO_BUG_ON(bio_pool_free <= 0);
bio_pool = bio->bi_next;
bio->bi_next = NULL;
bio_pool_free--;
......@@ -90,7 +90,7 @@ static inline struct bio *bio_pool_get(void)
spin_lock_irqsave(&bio_lock, flags);
bio = __bio_pool_get();
BUG_ON(!bio && bio_pool_free);
BIO_BUG_ON(!bio && bio_pool_free);
spin_unlock_irqrestore(&bio_lock, flags);
return bio;
......@@ -121,8 +121,7 @@ static inline void bio_pool_put(struct bio *bio)
}
}
#define BIO_CAN_WAIT(gfp_mask) \
(((gfp_mask) & (__GFP_WAIT | __GFP_IO)) == (__GFP_WAIT | __GFP_IO))
#define BIO_CAN_WAIT(gfp_mask) ((gfp_mask) & __GFP_WAIT)
static inline struct bio_vec *bvec_alloc(int gfp_mask, int nr, int *idx)
{
......@@ -198,13 +197,15 @@ void bio_destructor(struct bio *bio)
{
struct biovec_pool *bp = &bvec_list[bio->bi_max];
BUG_ON(bio->bi_max >= BIOVEC_NR_POOLS);
BIO_BUG_ON(bio->bi_max >= BIOVEC_NR_POOLS);
/*
* cloned bio doesn't own the veclist
*/
if (!(bio->bi_flags & (1 << BIO_CLONED)))
if (!(bio->bi_flags & (1 << BIO_CLONED))) {
kmem_cache_free(bp->bp_cachep, bio->bi_io_vec);
wake_up_nr(&bp->bp_wait, 1);
}
bio_pool_put(bio);
}
......@@ -212,13 +213,13 @@ void bio_destructor(struct bio *bio)
inline void bio_init(struct bio *bio)
{
bio->bi_next = NULL;
atomic_set(&bio->bi_cnt, 1);
bio->bi_flags = 0;
bio->bi_rw = 0;
bio->bi_vcnt = 0;
bio->bi_idx = 0;
bio->bi_size = 0;
bio->bi_end_io = NULL;
atomic_set(&bio->bi_cnt, 1);
}
static inline struct bio *__bio_alloc(int gfp_mask, bio_destructor_t *dest)
......@@ -301,6 +302,7 @@ struct bio *bio_alloc(int gfp_mask, int nr_iovecs)
*/
static inline void bio_free(struct bio *bio)
{
bio->bi_next = NULL;
bio->bi_destructor(bio);
}
......@@ -314,16 +316,13 @@ static inline void bio_free(struct bio *bio)
**/
void bio_put(struct bio *bio)
{
BUG_ON(!atomic_read(&bio->bi_cnt));
BIO_BUG_ON(!atomic_read(&bio->bi_cnt));
/*
* last put frees it
*/
if (atomic_dec_and_test(&bio->bi_cnt)) {
BUG_ON(bio->bi_next);
if (atomic_dec_and_test(&bio->bi_cnt))
bio_free(bio);
}
}
/**
......@@ -459,33 +458,10 @@ static int bio_end_io_page(struct bio *bio)
static int bio_end_io_kio(struct bio *bio, int nr_sectors)
{
struct kiobuf *kio = (struct kiobuf *) bio->bi_private;
int uptodate, done;
done = 0;
uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
do {
int sectors = bio->bi_io_vec[bio->bi_idx].bv_len >> 9;
nr_sectors -= sectors;
bio->bi_idx++;
done = !end_kio_request(kio, uptodate);
if (bio->bi_idx == bio->bi_vcnt)
done = 1;
} while (!done && nr_sectors > 0);
/*
* all done
*/
if (done) {
bio_put(bio);
return 0;
}
return 1;
end_kio_request(kio, test_bit(BIO_UPTODATE, &bio->bi_flags));
bio_put(bio);
return 0;
}
/*
......@@ -553,7 +529,7 @@ void ll_rw_kio(int rw, struct kiobuf *kio, kdev_t dev, sector_t sector)
max_bytes = get_max_sectors(dev) << 9;
max_segments = get_max_segments(dev);
if ((max_bytes >> PAGE_SHIFT) < (max_segments + 1))
max_segments = (max_bytes >> PAGE_SHIFT) + 1;
max_segments = (max_bytes >> PAGE_SHIFT);
if (max_segments > BIO_MAX_PAGES)
max_segments = BIO_MAX_PAGES;
......@@ -566,14 +542,12 @@ void ll_rw_kio(int rw, struct kiobuf *kio, kdev_t dev, sector_t sector)
offset = kio->offset & ~PAGE_MASK;
size = kio->length;
/*
* set I/O count to number of pages for now
*/
atomic_set(&kio->io_count, total_nr_pages);
atomic_set(&kio->io_count, 1);
map_i = 0;
next_chunk:
atomic_inc(&kio->io_count);
if ((nr_pages = total_nr_pages) > max_segments)
nr_pages = max_segments;
......@@ -638,6 +612,8 @@ void ll_rw_kio(int rw, struct kiobuf *kio, kdev_t dev, sector_t sector)
out:
if (err)
kio->errno = err;
end_kio_request(kio, !err);
}
int bio_endio(struct bio *bio, int uptodate, int nr_sectors)
......
......@@ -29,7 +29,6 @@
void coda_cache_enter(struct inode *inode, int mask)
{
struct coda_inode_info *cii = ITOC(inode);
ENTRY;
if ( !coda_cred_ok(&cii->c_cached_cred) ) {
coda_load_creds(&cii->c_cached_cred);
......@@ -42,7 +41,6 @@ void coda_cache_enter(struct inode *inode, int mask)
void coda_cache_clear_inode(struct inode *inode)
{
struct coda_inode_info *cii = ITOC(inode);
ENTRY;
cii->c_cached_perm = 0;
}
......@@ -53,7 +51,6 @@ void coda_cache_clear_all(struct super_block *sb, struct coda_cred *cred)
struct coda_inode_info *cii;
struct list_head *tmp;
ENTRY;
sbi = coda_sbp(sb);
if (!sbi) BUG();
......@@ -119,7 +116,6 @@ void coda_flag_inode_children(struct inode *inode, int flag)
{
struct dentry *alias_de;
ENTRY;
if ( !inode || !S_ISDIR(inode->i_mode))
return;
......
......@@ -102,8 +102,6 @@ int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb)
struct coda_vattr attr;
int error;
ENTRY;
/* We get inode numbers from Venus -- see venus source */
error = venus_getattr(sb, fid, &attr);
if ( error ) {
......@@ -111,21 +109,18 @@ int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb)
"coda_cnode_make: coda_getvattr returned %d for %s.\n",
error, coda_f2s(fid));
*inode = NULL;
EXIT;
return error;
}
*inode = coda_iget(sb, fid, &attr);
if ( IS_ERR(*inode) ) {
printk("coda_cnode_make: coda_iget failed\n");
EXIT;
return PTR_ERR(*inode);
}
CDEBUG(D_DOWNCALL, "Done making inode: ino %ld, count %d with %s\n",
(*inode)->i_ino, atomic_read(&(*inode)->i_count),
coda_f2s(&ITOC(*inode)->c_fid));
EXIT;
return 0;
}
......@@ -154,7 +149,6 @@ struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb)
ino_t nr;
struct inode *inode;
struct coda_inode_info *cii;
ENTRY;
if ( !sb ) {
printk("coda_fid_to_inode: no sb!\n");
......
......@@ -103,8 +103,6 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry)
const char *name = entry->d_name.name;
size_t length = entry->d_name.len;
ENTRY;
if ( length > CODA_MAXNAMLEN ) {
printk("name too long: lookup, %s (%*s)\n",
coda_i2s(dir), (int)length, name);
......@@ -154,7 +152,6 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry)
d_drop(entry);
coda_flag_inode(res_inode, C_VATTR);
}
EXIT;
return NULL;
}
......@@ -163,7 +160,6 @@ int coda_permission(struct inode *inode, int mask)
{
int error;
ENTRY;
coda_vfs_stat.permission++;
if ( mask == 0 )
......@@ -217,7 +213,6 @@ static int coda_create(struct inode *dir, struct dentry *de, int mode)
struct ViceFid newfid;
struct coda_vattr attrs;
ENTRY;
coda_vfs_stat.create++;
CDEBUG(D_INODE, "name: %s, length %d, mode %o\n", name, length, mode);
......@@ -300,7 +295,6 @@ static int coda_mkdir(struct inode *dir, struct dentry *de, int mode)
int error;
struct ViceFid newfid;
ENTRY;
coda_vfs_stat.mkdir++;
if (coda_isroot(dir) && coda_iscontrol(name, len))
......@@ -344,7 +338,6 @@ static int coda_link(struct dentry *source_de, struct inode *dir_inode,
int len = de->d_name.len;
int error;
ENTRY;
coda_vfs_stat.link++;
if (coda_isroot(dir_inode) && coda_iscontrol(name, len))
......@@ -368,7 +361,6 @@ static int coda_link(struct dentry *source_de, struct inode *dir_inode,
out:
CDEBUG(D_INODE, "link result %d\n",error);
EXIT;
return(error);
}
......@@ -381,7 +373,6 @@ static int coda_symlink(struct inode *dir_inode, struct dentry *de,
int symlen;
int error=0;
ENTRY;
coda_vfs_stat.symlink++;
if (coda_isroot(dir_inode) && coda_iscontrol(name, len))
......@@ -406,7 +397,6 @@ static int coda_symlink(struct inode *dir_inode, struct dentry *de,
coda_dir_changed(dir_inode, 0);
CDEBUG(D_INODE, "in symlink result %d\n",error);
EXIT;
return error;
}
......@@ -417,7 +407,6 @@ int coda_unlink(struct inode *dir, struct dentry *de)
const char *name = de->d_name.name;
int len = de->d_name.len;
ENTRY;
coda_vfs_stat.unlink++;
CDEBUG(D_INODE, " %s in %s, dirino %ld\n", name ,
......@@ -441,7 +430,6 @@ int coda_rmdir(struct inode *dir, struct dentry *de)
int len = de->d_name.len;
int error;
ENTRY;
coda_vfs_stat.rmdir++;
if (!d_unhashed(de))
......@@ -471,7 +459,6 @@ static int coda_rename(struct inode *old_dir, struct dentry *old_dentry,
int link_adjust = 0;
int error;
ENTRY;
coda_vfs_stat.rename++;
CDEBUG(D_INODE, "old: %s, (%d length), new: %s"
......@@ -499,7 +486,6 @@ static int coda_rename(struct inode *old_dir, struct dentry *old_dentry,
CDEBUG(D_INODE, "result %d\n", error);
EXIT;
return error;
}
......@@ -513,7 +499,6 @@ int coda_readdir(struct file *file, void *dirent, filldir_t filldir)
struct file *cfile, fakefile;
struct coda_inode_info *cii = ITOC(inode);
ENTRY;
coda_vfs_stat.readdir++;
cfile = cii->c_container;
......@@ -534,7 +519,6 @@ int coda_readdir(struct file *file, void *dirent, filldir_t filldir)
result = vfs_readdir(file, filldir, dirent);
}
EXIT;
return result;
}
......@@ -549,6 +533,7 @@ static void coda_prepare_fakefile(struct file *coda_file,
fake_file->f_pos = coda_file->f_pos;
fake_file->f_version = coda_file->f_version;
fake_file->f_op = cont_dentry->d_inode->i_fop;
fake_file->f_flags = coda_file->f_flags;
return ;
}
......@@ -577,8 +562,6 @@ static int coda_venus_readdir(struct file *filp, void *getdent,
int string_offset = (int) (&((struct venus_dirent *)(0))->d_name);
int i;
ENTRY;
CODA_ALLOC(buff, char *, DIR_BUFSIZE);
if ( !buff ) {
printk("coda_venus_readdir: out of memory.\n");
......@@ -664,7 +647,6 @@ static int coda_dentry_revalidate(struct dentry *de, int flags)
{
struct inode *inode = de->d_inode;
struct coda_inode_info *cii;
ENTRY;
if (!inode)
return 1;
......@@ -740,7 +722,6 @@ int coda_revalidate_inode(struct dentry *dentry)
struct inode *inode = dentry->d_inode;
struct coda_inode_info *cii = ITOC(inode);
ENTRY;
CDEBUG(D_INODE, "revalidating: %*s/%*s\n",
dentry->d_name.len, dentry->d_name.name,
dentry->d_parent->d_name.len, dentry->d_parent->d_name.name);
......
......@@ -102,7 +102,6 @@ int coda_open(struct inode *i, struct file *f)
struct coda_inode_info *cii;
lock_kernel();
ENTRY;
coda_vfs_stat.open++;
CDEBUG(D_SPECIAL, "OPEN inode number: %ld, count %d, flags %o.\n",
......@@ -140,7 +139,6 @@ int coda_open(struct inode *i, struct file *f)
fh->f_dentry->d_inode->i_ino,
atomic_read(&fh->f_dentry->d_inode->i_count),
fh->f_dentry->d_inode->i_op);
EXIT;
unlock_kernel();
return 0;
}
......@@ -155,7 +153,6 @@ int coda_flush(struct file *file)
struct inode *cinode, *inode;
int err = 0, fcnt;
ENTRY;
coda_vfs_stat.flush++;
/* No need to make an upcall when we have not made any modifications
......@@ -200,7 +197,6 @@ int coda_release(struct inode *i, struct file *f)
int err = 0;
lock_kernel();
ENTRY;
coda_vfs_stat.release++;
if (!use_coda_close) {
......@@ -244,7 +240,6 @@ int coda_fsync(struct file *file, struct dentry *dentry, int datasync)
struct inode *cinode, *inode = dentry->d_inode;
struct coda_inode_info *cii = ITOC(inode);
int err = 0;
ENTRY;
if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
S_ISLNK(inode->i_mode)))
......
......@@ -99,7 +99,6 @@ static struct super_block * coda_read_super(struct super_block *sb,
ViceFid fid;
int error;
int idx;
ENTRY;
idx = get_device_index((struct coda_mount_data *) data);
......@@ -112,19 +111,16 @@ static struct super_block * coda_read_super(struct super_block *sb,
vc = &coda_comms[idx];
if (!vc->vc_inuse) {
printk("coda_read_super: No pseudo device\n");
EXIT;
return NULL;
}
if ( vc->vc_sb ) {
printk("coda_read_super: Device already mounted\n");
EXIT;
return NULL;
}
sbi = kmalloc(sizeof(struct coda_sb_info), GFP_KERNEL);
if(!sbi) {
EXIT;
return NULL;
}
......@@ -159,11 +155,9 @@ static struct super_block * coda_read_super(struct super_block *sb,
printk("coda_read_super: rootinode is %ld dev %d\n",
root->i_ino, root->i_dev);
sb->s_root = d_alloc_root(root);
EXIT;
return sb;
error:
EXIT;
if (sbi) {
kfree(sbi);
if(vc)
......@@ -179,16 +173,12 @@ static void coda_put_super(struct super_block *sb)
{
struct coda_sb_info *sbi;
ENTRY;
sbi = coda_sbp(sb);
sbi->sbi_vcomm->vc_sb = NULL;
list_del_init(&sbi->sbi_cihead);
printk("Coda: Bye bye.\n");
kfree(sbi);
EXIT;
}
/* all filling in of inodes postponed until lookup */
......@@ -196,7 +186,6 @@ static void coda_read_inode(struct inode *inode)
{
struct coda_sb_info *sbi = coda_sbp(inode->i_sb);
struct coda_inode_info *cii;
ENTRY;
if (!sbi) BUG();
......@@ -229,7 +218,6 @@ static void coda_clear_inode(struct inode *inode)
{
struct coda_inode_info *cii = ITOC(inode);
ENTRY;
CDEBUG(D_SUPER, " inode->ino: %ld, count: %d\n",
inode->i_ino, atomic_read(&inode->i_count));
CDEBUG(D_DOWNCALL, "clearing inode: %ld, %x\n", inode->i_ino, cii->c_flags);
......@@ -244,8 +232,6 @@ static void coda_clear_inode(struct inode *inode)
cii_free(inode->u.generic_ip);
inode->u.generic_ip = NULL;
#endif
EXIT;
}
int coda_notify_change(struct dentry *de, struct iattr *iattr)
......@@ -254,7 +240,6 @@ int coda_notify_change(struct dentry *de, struct iattr *iattr)
struct coda_vattr vattr;
int error;
ENTRY;
memset(&vattr, 0, sizeof(vattr));
coda_iattr_to_vattr(iattr, &vattr);
......@@ -270,7 +255,6 @@ int coda_notify_change(struct dentry *de, struct iattr *iattr)
}
CDEBUG(D_SUPER, "inode.i_mode %o, error %d\n", inode->i_mode, error);
EXIT;
return error;
}
......
......@@ -45,8 +45,6 @@ struct file_operations coda_ioctl_operations = {
/* the coda pioctl inode ops */
static int coda_ioctl_permission(struct inode *inode, int mask)
{
ENTRY;
return 0;
}
......@@ -59,7 +57,6 @@ static int coda_pioctl(struct inode * inode, struct file * filp,
struct inode *target_inode = NULL;
struct coda_inode_info *cnp;
ENTRY;
/* get the Pioctl data arguments from user space */
if (copy_from_user(&data, (int *)user_data, sizeof(data))) {
return -EINVAL;
......
......@@ -292,7 +292,6 @@ static int coda_psdev_open(struct inode * inode, struct file * file)
{
struct venus_comm *vcp;
int idx;
ENTRY;
lock_kernel();
idx = MINOR(inode->i_rdev);
......@@ -319,7 +318,6 @@ static int coda_psdev_open(struct inode * inode, struct file * file)
CDEBUG(D_PSDEV, "device %i - inuse: %d\n", idx, vcp->vc_inuse);
EXIT;
unlock_kernel();
return 0;
}
......@@ -330,7 +328,6 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
struct venus_comm *vcp = (struct venus_comm *) file->private_data;
struct upc_req *req;
struct list_head *lh, *next;
ENTRY;
lock_kernel();
if ( !vcp->vc_inuse ) {
......@@ -371,7 +368,6 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
}
CDEBUG(D_PSDEV, "Done.\n");
EXIT;
unlock_kernel();
return 0;
}
......@@ -410,6 +406,7 @@ static int init_coda_psdev(void)
MODULE_AUTHOR("Peter J. Braam <braam@cs.cmu.edu>");
MODULE_LICENSE("GPL");
static int __init init_coda(void)
{
......@@ -436,8 +433,6 @@ static void __exit exit_coda(void)
{
int err;
ENTRY;
err = unregister_filesystem(&coda_fs_type);
if ( err != 0 ) {
printk("coda: failed to unregister filesystem\n");
......
......@@ -359,7 +359,6 @@ int coda_upcall_stats_get_info( char * buffer, char ** start, off_t offset,
char tmpbuf[80];
int tmplen = 0;
ENTRY;
/* this works as long as we are below 1024 characters! */
if ( offset < 80 )
len += sprintf( buffer,"%-79s\n", "Coda upcall statistics");
......@@ -392,7 +391,7 @@ int coda_upcall_stats_get_info( char * buffer, char ** start, off_t offset,
len = length;
if ( len < 0 )
len = 0;
EXIT;
return len;
}
......
......@@ -80,7 +80,6 @@ int venus_rootfid(struct super_block *sb, ViceFid *fidp)
union inputArgs *inp;
union outputArgs *outp;
int insize, outsize, error;
ENTRY;
insize = SIZE(root);
UPARG(CODA_ROOT);
......@@ -96,7 +95,6 @@ int venus_rootfid(struct super_block *sb, ViceFid *fidp)
}
CODA_FREE(inp, insize);
EXIT;
return error;
}
......@@ -106,7 +104,6 @@ int venus_getattr(struct super_block *sb, struct ViceFid *fid,
union inputArgs *inp;
union outputArgs *outp;
int insize, outsize, error;
ENTRY;
insize = SIZE(getattr);
UPARG(CODA_GETATTR);
......@@ -117,7 +114,6 @@ int venus_getattr(struct super_block *sb, struct ViceFid *fid,
*attr = outp->coda_getattr.attr;
CODA_FREE(inp, insize);
EXIT;
return error;
}
......@@ -432,7 +428,6 @@ int venus_readlink(struct super_block *sb, struct ViceFid *fid,
}
CDEBUG(D_INODE, " result %d\n",error);
EXIT;
CODA_FREE(inp, insize);
return error;
}
......@@ -462,7 +457,6 @@ int venus_link(struct super_block *sb, struct ViceFid *fid,
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
CDEBUG(D_INODE, " result %d\n",error);
EXIT;
CODA_FREE(inp, insize);
return error;
}
......@@ -499,7 +493,6 @@ int venus_symlink(struct super_block *sb, struct ViceFid *fid,
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
CDEBUG(D_INODE, " result %d\n",error);
EXIT;
CODA_FREE(inp, insize);
return error;
}
......@@ -536,7 +529,6 @@ int venus_access(struct super_block *sb, struct ViceFid *fid, int mask)
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
CODA_FREE(inp, insize);
EXIT;
return error;
}
......@@ -633,7 +625,6 @@ int venus_statfs(struct super_block *sb, struct statfs *sfs)
}
CDEBUG(D_INODE, " result %d\n",error);
EXIT;
CODA_FREE(inp, insize);
return error;
}
......@@ -722,8 +713,6 @@ static int coda_upcall(struct coda_sb_info *sbi,
struct upc_req *req;
int error = 0;
ENTRY;
vcommp = sbi->sbi_vcomm;
if ( !vcommp->vc_inuse ) {
printk("No pseudo device in upcall comms at %p\n", vcommp);
......
......@@ -26,6 +26,7 @@
#include <linux/types.h>
#include <asm/unaligned.h>
#include <asm/byteorder.h>
#include <linux/pagemap.h>
#include <linux/genhd.h>
#include <linux/blkdev.h>
#include <linux/slab.h>
......
......@@ -37,6 +37,13 @@ struct bio_vec {
unsigned int bv_offset;
};
/*
* weee, c forward decl...
*/
struct bio;
typedef int (bio_end_io_t) (struct bio *, int);
typedef void (bio_destructor_t) (struct bio *);
/*
* main unit of I/O for the block layer and lower layers (ie drivers and
* stacking drivers)
......@@ -44,14 +51,13 @@ struct bio_vec {
struct bio {
sector_t bi_sector;
struct bio *bi_next; /* request queue link */
atomic_t bi_cnt; /* pin count */
kdev_t bi_dev; /* will be block device */
unsigned long bi_flags; /* status, command, etc */
unsigned long bi_rw; /* bottom bits READ/WRITE,
* top bits priority
*/
unsigned int bi_vcnt; /* how may bio_vec's */
unsigned int bi_vcnt; /* how many bio_vec's */
unsigned int bi_idx; /* current index into bvl_vec */
unsigned int bi_size; /* total size in bytes */
unsigned int bi_max; /* max bvl_vecs we can hold,
......@@ -59,10 +65,12 @@ struct bio {
struct bio_vec *bi_io_vec; /* the actual vec list */
int (*bi_end_io)(struct bio *bio, int nr_sectors);
bio_end_io_t *bi_end_io;
atomic_t bi_cnt; /* pin count */
void *bi_private;
void (*bi_destructor)(struct bio *); /* destructor */
bio_destructor_t *bi_destructor; /* destructor */
};
/*
......@@ -83,13 +91,13 @@ struct bio {
*/
#define BIO_RW 0
#define BIO_RW_AHEAD 1
#define BIO_BARRIER 2
#define BIO_RW_BARRIER 2
/*
* various member access, note that bio_data should of course not be used
* on highmem page vectors
*/
#define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(bio)->bi_idx]))
#define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(idx)]))
#define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_idx)
#define bio_page(bio) bio_iovec((bio))->bv_page
#define __bio_offset(bio, idx) bio_iovec_idx((bio), (idx))->bv_offset
......@@ -118,17 +126,14 @@ struct bio {
/*
* merge helpers etc
*/
#define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_idx - 1)
#define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1)
#define BIO_CONTIG(bio, nxt) \
(bvec_to_phys(__BVEC_END((bio)) + (bio)->bi_size) == bio_to_phys((nxt)))
(bvec_to_phys(__BVEC_END((bio))) + (bio)->bi_size == bio_to_phys((nxt)))
#define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \
(((addr1) | (mask)) == (((addr2) - 1) | (mask)))
#define BIO_SEG_BOUNDARY(q, b1, b2) \
__BIO_SEG_BOUNDARY(bvec_to_phys(__BVEC_END((b1))), bio_to_phys((b2)) + (b2)->bi_size, (q)->seg_boundary_mask)
typedef int (bio_end_io_t) (struct bio *, int);
typedef void (bio_destructor_t) (struct bio *);
#define bio_io_error(bio) bio_endio((bio), 0, bio_sectors((bio)))
#define bio_for_each_segment(bvl, bio, i) \
......
......@@ -8,56 +8,12 @@
#include <linux/compiler.h>
/*
* Initialization functions.
* get rid of this next...
*/
extern int isp16_init(void);
extern int cdu31a_init(void);
extern int acsi_init(void);
extern int mcd_init(void);
extern int mcdx_init(void);
extern int sbpcd_init(void);
extern int aztcd_init(void);
extern int sony535_init(void);
extern int gscd_init(void);
extern int cm206_init(void);
extern int optcd_init(void);
extern int sjcd_init(void);
extern int cdi_init(void);
extern int hd_init(void);
extern int ide_init(void);
extern int xd_init(void);
extern int mfm_init(void);
extern int loop_init(void);
extern int md_init(void);
extern int ap_init(void);
extern int ddv_init(void);
extern int z2_init(void);
extern int swim3_init(void);
extern int swimiop_init(void);
extern int amiga_floppy_init(void);
extern int atari_floppy_init(void);
extern int ez_init(void);
extern int bpcd_init(void);
extern int ps2esdi_init(void);
extern int jsfd_init(void);
extern int viodasd_init(void);
extern int viocd_init(void);
#if defined(CONFIG_ARCH_S390)
extern int dasd_init(void);
extern int xpram_init(void);
extern int tapeblock_init(void);
#endif /* CONFIG_ARCH_S390 */
extern void set_device_ro(kdev_t dev,int flag);
void add_blkdev_randomness(int major);
extern int floppy_init(void);
extern void rd_load(void);
extern int rd_init(void);
extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */
extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */
extern int rd_image_start; /* starting block # of image */
extern void add_blkdev_randomness(int major);
#ifdef CONFIG_BLK_DEV_INITRD
......@@ -69,8 +25,6 @@ extern int initrd_below_start_ok; /* 1 if it is not an error if initrd_start < m
void initrd_init(void);
#endif
/*
* end_request() and friends. Must be called with the request queue spinlock
* acquired. All functions called within end_request() _must_be_ atomic.
......@@ -81,13 +35,50 @@ void initrd_init(void);
* code duplication in drivers.
*/
extern int end_that_request_first(struct request *, int, int);
extern void end_that_request_last(struct request *);
static inline void blkdev_dequeue_request(struct request *req)
{
list_del(&req->queuelist);
}
int end_that_request_first(struct request *, int uptodate, int nr_sectors);
void end_that_request_last(struct request *);
#define __elv_next_request(q) (q)->elevator.elevator_next_req_fn((q))
extern inline struct request *elv_next_request(request_queue_t *q)
{
struct request *rq;
while ((rq = __elv_next_request(q))) {
rq->flags |= REQ_STARTED;
if ((rq->flags & REQ_DONTPREP) || !q->prep_rq_fn)
break;
/*
* all ok, break and return it
*/
if (!q->prep_rq_fn(q, rq))
break;
/*
* prep said no-go, kill it
*/
blkdev_dequeue_request(rq);
if (end_that_request_first(rq, 0, rq->nr_sectors))
BUG();
end_that_request_last(rq);
}
return rq;
}
extern inline void elv_add_request(request_queue_t *q, struct request *rq)
{
blk_plug_device(q);
q->elevator.elevator_add_req_fn(q, rq, q->queue_head.prev);
}
#if defined(MAJOR_NR) || defined(IDE_DRIVER)
......@@ -364,15 +355,15 @@ static void (DEVICE_REQUEST)(request_queue_t *);
#define CLEAR_INTR
#endif
#define INIT_REQUEST \
if (QUEUE_EMPTY) { \
CLEAR_INTR; \
return; \
} \
if (MAJOR(CURRENT->rq_dev) != MAJOR_NR) \
panic(DEVICE_NAME ": request list destroyed"); \
if (!CURRENT->bio) \
panic(DEVICE_NAME ": no bio"); \
#define INIT_REQUEST \
if (QUEUE_EMPTY) { \
CLEAR_INTR; \
return; \
} \
if (MAJOR(CURRENT->rq_dev) != MAJOR_NR) \
panic(DEVICE_NAME ": request list destroyed"); \
if (!CURRENT->bio) \
panic(DEVICE_NAME ": no bio"); \
#endif /* !defined(IDE_DRIVER) */
......
......@@ -15,21 +15,32 @@ typedef struct request_queue request_queue_t;
struct elevator_s;
typedef struct elevator_s elevator_t;
struct request_list {
unsigned int count;
struct list_head free;
wait_queue_head_t wait;
};
struct request {
struct list_head queuelist; /* looking for ->queue? you must _not_
* access it directly, use
* blkdev_dequeue_request! */
int elevator_sequence;
int inactive; /* driver hasn't seen it yet */
unsigned char cmd[16];
unsigned long flags; /* see REQ_ bits below */
int rq_status; /* should split this into a few status bits */
kdev_t rq_dev;
int cmd; /* READ or WRITE */
int errors;
sector_t sector;
unsigned long nr_sectors;
unsigned long hard_sector, hard_nr_sectors;
unsigned long hard_sector; /* the hard_* are block layer
* internals, no driver should
* touch them
*/
unsigned long hard_nr_sectors;
unsigned short nr_segments;
unsigned short nr_hw_segments;
unsigned int current_nr_sectors;
......@@ -39,8 +50,49 @@ struct request {
struct completion *waiting;
struct bio *bio, *biotail;
request_queue_t *q;
struct request_list *rl;
};
/*
* first three bits match BIO_RW* bits, important
*/
enum rq_flag_bits {
__REQ_RW, /* not set, read. set, write */
__REQ_RW_AHEAD, /* READA */
__REQ_BARRIER, /* may not be passed */
__REQ_CMD, /* is a regular fs rw request */
__REQ_NOMERGE, /* don't touch this for merging */
__REQ_STARTED, /* drive already may have started this one */
__REQ_DONTPREP, /* don't call prep for this one */
/*
* for IDE
*/
__REQ_DRIVE_CMD,
__REQ_DRIVE_TASK,
__REQ_PC, /* packet command (special) */
__REQ_BLOCK_PC, /* queued down pc from block layer */
__REQ_SENSE, /* sense retrival */
__REQ_SPECIAL, /* driver special command */
__REQ_NR_BITS, /* stops here */
};
#define REQ_RW (1 << __REQ_RW)
#define REQ_RW_AHEAD (1 << __REQ_RW_AHEAD)
#define REQ_BARRIER (1 << __REQ_BARRIER)
#define REQ_CMD (1 << __REQ_CMD)
#define REQ_NOMERGE (1 << __REQ_NOMERGE)
#define REQ_STARTED (1 << __REQ_STARTED)
#define REQ_DONTPREP (1 << __REQ_DONTPREP)
#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)
#define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK)
#define REQ_PC (1 << __REQ_PC)
#define REQ_SENSE (1 << __REQ_SENSE)
#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
#define REQ_SPECIAL (1 << __REQ_SPECIAL)
#include <linux/elevator.h>
typedef int (merge_request_fn) (request_queue_t *, struct request *,
......@@ -50,6 +102,7 @@ typedef int (merge_requests_fn) (request_queue_t *, struct request *,
typedef void (request_fn_proc) (request_queue_t *q);
typedef request_queue_t * (queue_proc) (kdev_t dev);
typedef int (make_request_fn) (request_queue_t *q, struct bio *bio);
typedef int (prep_rq_fn) (request_queue_t *, struct request *);
typedef void (unplug_device_fn) (void *q);
enum blk_queue_state {
......@@ -63,12 +116,6 @@ enum blk_queue_state {
*/
#define QUEUE_NR_REQUESTS 8192
struct request_list {
unsigned int count;
struct list_head free;
wait_queue_head_t wait;
};
struct request_queue
{
/*
......@@ -82,17 +129,18 @@ struct request_queue
struct list_head queue_head;
elevator_t elevator;
request_fn_proc * request_fn;
merge_request_fn * back_merge_fn;
merge_request_fn * front_merge_fn;
merge_requests_fn * merge_requests_fn;
make_request_fn * make_request_fn;
request_fn_proc *request_fn;
merge_request_fn *back_merge_fn;
merge_request_fn *front_merge_fn;
merge_requests_fn *merge_requests_fn;
make_request_fn *make_request_fn;
prep_rq_fn *prep_rq_fn;
/*
* The queue owner gets to use this for whatever they like.
* ll_rw_blk doesn't touch it.
*/
void * queuedata;
void *queuedata;
/*
* queue needs bounce pages for pages above this limit
......@@ -138,13 +186,12 @@ struct request_queue
#define QUEUE_FLAG_CLUSTER 2 /* cluster several segments into 1 */
#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
#define blk_mark_plugged(q) set_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
#define blk_queue_empty(q) elv_queue_empty(q)
#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
#define rq_data_dir(rq) ((rq)->flags & 1)
/*
* noop, requests are automagically marked as active/inactive by I/O
* scheduler -- see elv_next_request
......@@ -153,20 +200,6 @@ struct request_queue
extern unsigned long blk_max_low_pfn, blk_max_pfn;
#define __elv_next_request(q) (q)->elevator.elevator_next_req_fn((q))
extern inline struct request *elv_next_request(request_queue_t *q)
{
struct request *rq = __elv_next_request(q);
if (rq) {
rq->inactive = 0;
wmb();
}
return rq;
}
#define BLK_BOUNCE_HIGH (blk_max_low_pfn << PAGE_SHIFT)
#define BLK_BOUNCE_ANY (blk_max_pfn << PAGE_SHIFT)
......@@ -186,7 +219,8 @@ extern inline void blk_queue_bounce(request_queue_t *q, struct bio **bio)
#endif /* CONFIG_HIGHMEM */
#define rq_for_each_bio(bio, rq) \
for (bio = (rq)->bio; bio; bio = bio->bi_next)
if ((rq->bio)) \
for (bio = (rq)->bio; bio; bio = bio->bi_next)
struct blk_dev_struct {
/*
......@@ -219,6 +253,11 @@ extern void generic_make_request(struct bio *bio);
extern inline request_queue_t *blk_get_queue(kdev_t dev);
extern void blkdev_release_request(struct request *);
extern void blk_attempt_remerge(request_queue_t *, struct request *);
extern struct request *blk_get_request(request_queue_t *, int, int);
extern void blk_put_request(struct request *);
extern void blk_plug_device(request_queue_t *);
extern int block_ioctl(kdev_t, unsigned int, unsigned long);
/*
* Access functions for manipulating queue properties
......@@ -233,6 +272,7 @@ extern void blk_queue_max_segment_size(request_queue_t *q, unsigned int);
extern void blk_queue_hardsect_size(request_queue_t *q, unsigned short);
extern void blk_queue_segment_boundary(request_queue_t *q, unsigned long);
extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *);
extern void blk_dump_rq_flags(struct request *, char *);
extern void generic_unplug_device(void *);
extern int * blk_size[MAX_BLKDEV];
......@@ -256,8 +296,7 @@ extern int * max_readahead[MAX_BLKDEV];
#define blkdev_next_request(req) blkdev_entry_to_request((req)->queuelist.next)
#define blkdev_prev_request(req) blkdev_entry_to_request((req)->queuelist.prev)
extern void drive_stat_acct (kdev_t dev, int rw,
unsigned long nr_sectors, int new_io);
extern void drive_stat_acct(struct request *, int, int);
extern inline void blk_clear(int major)
{
......
......@@ -92,12 +92,6 @@ void coda_sysctl_clean(void);
printk(format, ## a); } \
} while (0)
#define ENTRY \
if(coda_print_entry) printk("Process %d entered %s\n",current->pid,__FUNCTION__)
#define EXIT \
if(coda_print_entry) printk("Process %d leaving %s\n",current->pid,__FUNCTION__)
#define CODA_ALLOC(ptr, cast, size) \
do { \
if (size < PAGE_SIZE) { \
......
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