Merge branch 'blk-softirq' of git://brick.kernel.dk/data/git/linux-2.6-block
authorLinus Torvalds <torvalds@g5.osdl.org>
Mon, 9 Jan 2006 17:26:40 +0000 (09:26 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 9 Jan 2006 17:26:40 +0000 (09:26 -0800)
Manual merge for trivial #include changes

block/elevator.c
block/ll_rw_blk.c
block/scsi_ioctl.c
drivers/ide/ide-cd.c
fs/bio.c
include/linux/blkdev.h
include/linux/elevator.h

index 39dcccc..99a4d7b 100644 (file)
@@ -64,7 +64,7 @@ inline int elv_rq_merge_ok(struct request *rq, struct bio *bio)
 }
 EXPORT_SYMBOL(elv_rq_merge_ok);
 
-inline int elv_try_merge(struct request *__rq, struct bio *bio)
+static inline int elv_try_merge(struct request *__rq, struct bio *bio)
 {
        int ret = ELEVATOR_NO_MERGE;
 
@@ -80,7 +80,6 @@ inline int elv_try_merge(struct request *__rq, struct bio *bio)
 
        return ret;
 }
-EXPORT_SYMBOL(elv_try_merge);
 
 static struct elevator_type *elevator_find(const char *name)
 {
index 8e13645..8e27d0a 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/writeback.h>
-#include <linux/blkdev.h>
 #include <linux/interrupt.h>
 #include <linux/cpu.h>
 
@@ -2748,30 +2747,6 @@ static inline int attempt_front_merge(request_queue_t *q, struct request *rq)
        return 0;
 }
 
-/**
- * blk_attempt_remerge  - attempt to remerge active head with next request
- * @q:    The &request_queue_t belonging to the device
- * @rq:   The head request (usually)
- *
- * Description:
- *    For head-active devices, the queue can easily be unplugged so quickly
- *    that proper merging is not done on the front request. This may hurt
- *    performance greatly for some devices. The block layer cannot safely
- *    do merging on that first request for these queues, but the driver can
- *    call this function and make it happen any way. Only the driver knows
- *    when it is safe to do so.
- **/
-void blk_attempt_remerge(request_queue_t *q, struct request *rq)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(q->queue_lock, flags);
-       attempt_back_merge(q, rq);
-       spin_unlock_irqrestore(q->queue_lock, flags);
-}
-
-EXPORT_SYMBOL(blk_attempt_remerge);
-
 static void init_request_from_bio(struct request *req, struct bio *bio)
 {
        req->flags |= REQ_CMD;
index c2ac36d..18de84c 100644 (file)
@@ -190,16 +190,21 @@ static int verify_command(struct file *file, unsigned char *cmd)
                safe_for_write(GPCMD_SET_STREAMING),
        };
        unsigned char type = cmd_type[cmd[0]];
+       int has_write_perm = 0;
 
        /* Anybody who can open the device can do a read-safe command */
        if (type & CMD_READ_SAFE)
                return 0;
 
+       /*
+        * file can be NULL from ioctl_by_bdev()...
+        */
+       if (file)
+               has_write_perm = file->f_mode & FMODE_WRITE;
+
        /* Write-safe commands just require a writable open.. */
-       if (type & CMD_WRITE_SAFE) {
-               if (file->f_mode & FMODE_WRITE)
-                       return 0;
-       }
+       if ((type & CMD_WRITE_SAFE) && has_write_perm)
+               return 0;
 
        /* And root can do any command.. */
        if (capable(CAP_SYS_RAWIO))
index d31117e..e4d55ad 100644 (file)
@@ -1332,8 +1332,6 @@ static ide_startstop_t cdrom_start_read (ide_drive_t *drive, unsigned int block)
        if (cdrom_read_from_buffer(drive))
                return ide_stopped;
 
-       blk_attempt_remerge(drive->queue, rq);
-
        /* Clear the local sector buffer. */
        info->nsectors_buffered = 0;
 
@@ -1874,14 +1872,6 @@ static ide_startstop_t cdrom_start_write(ide_drive_t *drive, struct request *rq)
                return ide_stopped;
        }
 
-       /*
-        * for dvd-ram and such media, it's a really big deal to get
-        * big writes all the time. so scour the queue and attempt to
-        * remerge requests, often the plugging will not have had time
-        * to do this properly
-        */
-       blk_attempt_remerge(drive->queue, rq);
-
        info->nsectors_buffered = 0;
 
        /* use dma, if possible. we don't need to check more, since we
index dfe242a..7b30695 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -126,6 +126,7 @@ static void bio_fs_destructor(struct bio *bio)
 inline void bio_init(struct bio *bio)
 {
        bio->bi_next = NULL;
+       bio->bi_bdev = NULL;
        bio->bi_flags = 1 << BIO_UPTODATE;
        bio->bi_rw = 0;
        bio->bi_vcnt = 0;
index 804cc4e..02a585f 100644 (file)
@@ -595,7 +595,6 @@ extern void generic_make_request(struct bio *bio);
 extern void blk_put_request(struct request *);
 extern void __blk_put_request(request_queue_t *, struct request *);
 extern void blk_end_sync_rq(struct request *rq, int error);
-extern void blk_attempt_remerge(request_queue_t *, struct request *);
 extern struct request *blk_get_request(request_queue_t *, int, gfp_t);
 extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
 extern void blk_requeue_request(request_queue_t *, struct request *);
index fb80fa4..4a6f50e 100644 (file)
@@ -114,8 +114,6 @@ extern ssize_t elv_iosched_store(request_queue_t *, const char *, size_t);
 extern int elevator_init(request_queue_t *, char *);
 extern void elevator_exit(elevator_t *);
 extern int elv_rq_merge_ok(struct request *, struct bio *);
-extern int elv_try_merge(struct request *, struct bio *);
-extern int elv_try_last_merge(request_queue_t *, struct bio *);
 
 /*
  * Return values from elevator merger