Skip to content

Commit

Permalink
Merge branch 'tj-block-for-linus' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/tj/misc

* 'tj-block-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc:
  virtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch
  block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel
  ataflop: adjust NULL test
  block: fix failfast merge testing in elv_rq_merge_ok()
  z2ram: Small cleanup for z2ram.c
  • Loading branch information
Linus Torvalds committed Jul 22, 2009
2 parents 1f9758d + 4fbfff7 commit bb184d1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
11 changes: 6 additions & 5 deletions block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ struct queue_sysfs_entry {
};

static ssize_t
queue_var_show(unsigned int var, char *page)
queue_var_show(unsigned long var, char *page)
{
return sprintf(page, "%d\n", var);
return sprintf(page, "%lu\n", var);
}

static ssize_t
Expand Down Expand Up @@ -77,7 +77,8 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count)

static ssize_t queue_ra_show(struct request_queue *q, char *page)
{
int ra_kb = q->backing_dev_info.ra_pages << (PAGE_CACHE_SHIFT - 10);
unsigned long ra_kb = q->backing_dev_info.ra_pages <<
(PAGE_CACHE_SHIFT - 10);

return queue_var_show(ra_kb, (page));
}
Expand Down Expand Up @@ -189,9 +190,9 @@ static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,

static ssize_t queue_rq_affinity_show(struct request_queue *q, char *page)
{
unsigned int set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags);
bool set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags);

return queue_var_show(set != 0, page);
return queue_var_show(set, page);
}

static ssize_t
Expand Down
13 changes: 9 additions & 4 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,16 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio)
return 0;

/*
* Don't merge if failfast settings don't match
* Don't merge if failfast settings don't match.
*
* FIXME: The negation in front of each condition is necessary
* because bio and request flags use different bit positions
* and the accessors return those bits directly. This
* ugliness will soon go away.
*/
if (bio_failfast_dev(bio) != blk_failfast_dev(rq) ||
bio_failfast_transport(bio) != blk_failfast_transport(rq) ||
bio_failfast_driver(bio) != blk_failfast_driver(rq))
if (!bio_failfast_dev(bio) != !blk_failfast_dev(rq) ||
!bio_failfast_transport(bio) != !blk_failfast_transport(rq) ||
!bio_failfast_driver(bio) != !blk_failfast_driver(rq))
return 0;

if (!elv_iosched_allow_merge(rq, bio))
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ataflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode,
drive, dtp->blocks, dtp->spt, dtp->stretch);

/* sanity check */
if (!dtp || setprm.track != dtp->blocks/dtp->spt/2 ||
if (setprm.track != dtp->blocks/dtp->spt/2 ||
setprm.head != 2) {
redo_fd_request();
return -EINVAL;
Expand Down
7 changes: 6 additions & 1 deletion drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,12 @@ static unsigned int features[] = {
VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY
};

static struct virtio_driver virtio_blk = {
/*
* virtio_blk causes spurious section mismatch warning by
* simultaneously referring to a __devinit and a __devexit function.
* Use __refdata to avoid this warning.
*/
static struct virtio_driver __refdata virtio_blk = {
.feature_table = features,
.feature_table_size = ARRAY_SIZE(features),
.driver.name = KBUILD_MODNAME,
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/z2ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ z2_init(void)
static void __exit z2_exit(void)
{
int i, j;
blk_unregister_region(MKDEV(Z2RAM_MAJOR, 0), 256);
blk_unregister_region(MKDEV(Z2RAM_MAJOR, 0), Z2MINOR_COUNT);
unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME);
del_gendisk(z2ram_gendisk);
put_disk(z2ram_gendisk);
Expand Down

0 comments on commit bb184d1

Please sign in to comment.