Skip to content

Commit

Permalink
Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block
Browse files Browse the repository at this point in the history
* 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits)
  block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n
  xen-blkfront: fix missing out label
  blkdev: fix blkdev_issue_zeroout return value
  block: update request stacking methods to support discards
  block: fix missing export of blk_types.h
  writeback: fix bad _bh spinlock nesting
  drbd: revert "delay probes", feature is being re-implemented differently
  drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
  drbd: Disable delay probes for the upcomming release
  writeback: cleanup bdi_register
  writeback: add new tracepoints
  writeback: remove unnecessary init_timer call
  writeback: optimize periodic bdi thread wakeups
  writeback: prevent unnecessary bdi threads wakeups
  writeback: move bdi threads exiting logic to the forker thread
  writeback: restructure bdi forker loop a little
  writeback: move last_active to bdi
  writeback: do not remove bdi from bdi_list
  writeback: simplify bdi code a little
  writeback: do not lose wake-ups in bdi threads
  ...

Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and
drivers/scsi/scsi_error.c as per Jens.
  • Loading branch information
torvalds committed Aug 10, 2010
2 parents 7ae0dea + de75d60 commit 2f9e825
Show file tree
Hide file tree
Showing 154 changed files with 4,286 additions and 3,211 deletions.
2 changes: 0 additions & 2 deletions arch/alpha/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (~0UL)

#endif /* !(_ALPHA_SCATTERLIST_H) */
2 changes: 0 additions & 2 deletions arch/avr32/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0xffffffff)

#endif /* __ASM_AVR32_SCATTERLIST_H */
2 changes: 0 additions & 2 deletions arch/blackfin/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0xffffffff)

#endif /* !(_BLACKFIN_SCATTERLIST_H) */
2 changes: 0 additions & 2 deletions arch/cris/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0x1fffffff)

#endif /* !(__ASM_CRIS_SCATTERLIST_H) */
2 changes: 0 additions & 2 deletions arch/frv/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0xffffffffUL)

#endif /* !_ASM_SCATTERLIST_H */
2 changes: 0 additions & 2 deletions arch/h8300/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0xffffffff)

#endif /* !(_H8300_SCATTERLIST_H) */
9 changes: 0 additions & 9 deletions arch/ia64/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
#define _ASM_IA64_SCATTERLIST_H

#include <asm-generic/scatterlist.h>
/*
* It used to be that ISA_DMA_THRESHOLD had something to do with the
* DMA-limits of ISA-devices. Nowadays, its only remaining use (apart
* from the aha1542.c driver, which isn't 64-bit clean anyhow) is to
* tell the block-layer (via BLK_BOUNCE_ISA) what the max. physical
* address of a page is that is allocated with GFP_DMA. On IA-64,
* that's 4GB - 1.
*/
#define ISA_DMA_THRESHOLD 0xffffffff
#define ARCH_HAS_SG_CHAIN

#endif /* _ASM_IA64_SCATTERLIST_H */
2 changes: 0 additions & 2 deletions arch/m32r/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0x1fffffff)

#endif /* _ASM_M32R_SCATTERLIST_H */
3 changes: 0 additions & 3 deletions arch/m68k/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@

#include <asm-generic/scatterlist.h>

/* This is bogus and should go away. */
#define ISA_DMA_THRESHOLD (0x00ffffff)

#endif /* !(_M68K_SCATTERLIST_H) */
2 changes: 0 additions & 2 deletions arch/microblaze/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (~0UL)
2 changes: 0 additions & 2 deletions arch/mips/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0x00ffffffUL)

#endif /* __ASM_SCATTERLIST_H */
2 changes: 0 additions & 2 deletions arch/mn10300/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0x00ffffff)

#endif /* _ASM_SCATTERLIST_H */
1 change: 0 additions & 1 deletion arch/parisc/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <asm/types.h>
#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (~0UL)
#define sg_virt_addr(sg) ((unsigned long)sg_virt(sg))

#endif /* _ASM_PARISC_SCATTERLIST_H */
3 changes: 0 additions & 3 deletions arch/powerpc/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
#include <asm/dma.h>
#include <asm-generic/scatterlist.h>

#ifdef __powerpc64__
#define ISA_DMA_THRESHOLD (~0UL)
#endif
#define ARCH_HAS_SG_CHAIN

#endif /* _ASM_POWERPC_SCATTERLIST_H */
2 changes: 0 additions & 2 deletions arch/s390/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
#define ISA_DMA_THRESHOLD (~0UL)

#include <asm-generic/scatterlist.h>
2 changes: 0 additions & 2 deletions arch/score/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _ASM_SCORE_SCATTERLIST_H
#define _ASM_SCORE_SCATTERLIST_H

#define ISA_DMA_THRESHOLD (~0UL)

#include <asm-generic/scatterlist.h>

#endif /* _ASM_SCORE_SCATTERLIST_H */
2 changes: 0 additions & 2 deletions arch/sh/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef __ASM_SH_SCATTERLIST_H
#define __ASM_SH_SCATTERLIST_H

#define ISA_DMA_THRESHOLD phys_addr_mask()

#include <asm-generic/scatterlist.h>

#endif /* __ASM_SH_SCATTERLIST_H */
1 change: 0 additions & 1 deletion arch/sparc/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (~0UL)
#define ARCH_HAS_SG_CHAIN

#endif /* !(_SPARC_SCATTERLIST_H) */
7 changes: 6 additions & 1 deletion arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "linux/mm.h"
#include "linux/slab.h"
#include "linux/vmalloc.h"
#include "linux/smp_lock.h"
#include "linux/blkpg.h"
#include "linux/genhd.h"
#include "linux/spinlock.h"
Expand Down Expand Up @@ -1098,6 +1099,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
struct ubd *ubd_dev = disk->private_data;
int err = 0;

lock_kernel();
if(ubd_dev->count == 0){
err = ubd_open_dev(ubd_dev);
if(err){
Expand All @@ -1115,16 +1117,19 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
if(--ubd_dev->count == 0) ubd_close_dev(ubd_dev);
err = -EROFS;
}*/
out:
out:
unlock_kernel();
return err;
}

static int ubd_release(struct gendisk *disk, fmode_t mode)
{
struct ubd *ubd_dev = disk->private_data;

lock_kernel();
if(--ubd_dev->count == 0)
ubd_close_dev(ubd_dev);
unlock_kernel();
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (0x00ffffff)
#define ARCH_HAS_SG_CHAIN

#endif /* _ASM_X86_SCATTERLIST_H */
2 changes: 0 additions & 2 deletions arch/xtensa/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

#include <asm-generic/scatterlist.h>

#define ISA_DMA_THRESHOLD (~0UL)

#endif /* _XTENSA_SCATTERLIST_H */
35 changes: 18 additions & 17 deletions block/blk-barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* blk_queue_ordered - does this queue support ordered writes
* @q: the request queue
* @ordered: one of QUEUE_ORDERED_*
* @prepare_flush_fn: rq setup helper for cache flush ordered writes
*
* Description:
* For journalled file systems, doing ordered writes on a commit
Expand All @@ -22,15 +21,8 @@
* feature should call this function and indicate so.
*
**/
int blk_queue_ordered(struct request_queue *q, unsigned ordered,
prepare_flush_fn *prepare_flush_fn)
int blk_queue_ordered(struct request_queue *q, unsigned ordered)
{
if (!prepare_flush_fn && (ordered & (QUEUE_ORDERED_DO_PREFLUSH |
QUEUE_ORDERED_DO_POSTFLUSH))) {
printk(KERN_ERR "%s: prepare_flush_fn required\n", __func__);
return -EINVAL;
}

if (ordered != QUEUE_ORDERED_NONE &&
ordered != QUEUE_ORDERED_DRAIN &&
ordered != QUEUE_ORDERED_DRAIN_FLUSH &&
Expand All @@ -44,7 +36,6 @@ int blk_queue_ordered(struct request_queue *q, unsigned ordered,

q->ordered = ordered;
q->next_ordered = ordered;
q->prepare_flush_fn = prepare_flush_fn;

return 0;
}
Expand Down Expand Up @@ -79,7 +70,7 @@ unsigned blk_ordered_req_seq(struct request *rq)
*
* http://thread.gmane.org/gmane.linux.kernel/537473
*/
if (!blk_fs_request(rq))
if (rq->cmd_type != REQ_TYPE_FS)
return QUEUE_ORDSEQ_DRAIN;

if ((rq->cmd_flags & REQ_ORDERED_COLOR) ==
Expand Down Expand Up @@ -143,10 +134,10 @@ static void queue_flush(struct request_queue *q, unsigned which)
}

blk_rq_init(q, rq);
rq->cmd_flags = REQ_HARDBARRIER;
rq->rq_disk = q->bar_rq.rq_disk;
rq->cmd_type = REQ_TYPE_FS;
rq->cmd_flags = REQ_HARDBARRIER | REQ_FLUSH;
rq->rq_disk = q->orig_bar_rq->rq_disk;
rq->end_io = end_io;
q->prepare_flush_fn(q, rq);

elv_insert(q, rq, ELEVATOR_INSERT_FRONT);
}
Expand Down Expand Up @@ -203,7 +194,7 @@ static inline bool start_ordered(struct request_queue *q, struct request **rqp)
/* initialize proxy request and queue it */
blk_rq_init(q, rq);
if (bio_data_dir(q->orig_bar_rq->bio) == WRITE)
rq->cmd_flags |= REQ_RW;
rq->cmd_flags |= REQ_WRITE;
if (q->ordered & QUEUE_ORDERED_DO_FUA)
rq->cmd_flags |= REQ_FUA;
init_request_from_bio(rq, q->orig_bar_rq->bio);
Expand Down Expand Up @@ -236,7 +227,8 @@ static inline bool start_ordered(struct request_queue *q, struct request **rqp)
bool blk_do_ordered(struct request_queue *q, struct request **rqp)
{
struct request *rq = *rqp;
const int is_barrier = blk_fs_request(rq) && blk_barrier_rq(rq);
const int is_barrier = rq->cmd_type == REQ_TYPE_FS &&
(rq->cmd_flags & REQ_HARDBARRIER);

if (!q->ordseq) {
if (!is_barrier)
Expand All @@ -261,7 +253,7 @@ bool blk_do_ordered(struct request_queue *q, struct request **rqp)
*/

/* Special requests are not subject to ordering rules. */
if (!blk_fs_request(rq) &&
if (rq->cmd_type != REQ_TYPE_FS &&
rq != &q->pre_flush_rq && rq != &q->post_flush_rq)
return true;

Expand Down Expand Up @@ -319,6 +311,15 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
if (!q)
return -ENXIO;

/*
* some block devices may not have their queue correctly set up here
* (e.g. loop device without a backing file) and so issuing a flush
* here will panic. Ensure there is a request function before issuing
* the barrier.
*/
if (!q->make_request_fn)
return -ENXIO;

bio = bio_alloc(gfp_mask, 0);
bio->bi_end_io = bio_end_empty_barrier;
bio->bi_bdev = bdev;
Expand Down
Loading

0 comments on commit 2f9e825

Please sign in to comment.