提交 bb184d11 编写于 作者: L Linus Torvalds

Merge branch 'tj-block-for-linus' of git://git.kernel.org/pub/scm/linux/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
......@@ -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
......@@ -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));
}
......@@ -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
......
......@@ -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))
......
......@@ -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;
......
......@@ -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,
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册