Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23d4ed53 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block layer fixes from Jens Axboe:
 "Final small batch of fixes to be included before -rc1.  Some general
  cleanups in here as well, but some of the blk-mq fixes we need for the
  NVMe conversion and/or scsi-mq.  The pull request contains:

   - Support for not merging across a specified "chunk size", if set by
     the driver.  Some NVMe devices perform poorly for IO that crosses
     such a chunk, so we need to support it generically as part of
     request merging avoid having to do complicated split logic.  From
     me.

   - Bump max tag depth to 10Ki tags.  Some scsi devices have a huge
     shared tag space.  Before we failed with EINVAL if a too large tag
     depth was specified, now we truncate it and pass back the actual
     value.  From me.

   - Various blk-mq rq init fixes from me and others.

   - A fix for enter on a dying queue for blk-mq from Keith.  This is
     needed to prevent oopsing on hot device removal.

   - Fixup for blk-mq timer addition from Ming Lei.

   - Small round of performance fixes for mtip32xx from Sam Bradshaw.

   - Minor stack leak fix from Rickard Strandqvist.

   - Two __init annotations from Fabian Frederick"

* 'for-linus' of git://git.kernel.dk/linux-block:
  block: add __init to blkcg_policy_register
  block: add __init to elv_register
  block: ensure that bio_add_page() always accepts a page for an empty bio
  blk-mq: add timer in blk_mq_start_request
  blk-mq: always initialize request->start_time
  block: blk-exec.c: Cleaning up local variable address returnd
  mtip32xx: minor performance enhancements
  blk-mq: ->timeout should be cleared in blk_mq_rq_ctx_init()
  blk-mq: don't allow queue entering for a dying queue
  blk-mq: bump max tag depth to 10K tags
  block: add blk_rq_set_block_pc()
  block: add notion of a chunk size for request merging
parents e413a19a a2d445d4
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -849,7 +849,13 @@ int bio_add_page(struct bio *bio, struct page *page, unsigned int len,
		 unsigned int offset)
		 unsigned int offset)
{
{
	struct request_queue *q = bdev_get_queue(bio->bi_bdev);
	struct request_queue *q = bdev_get_queue(bio->bi_bdev);
	return __bio_add_page(q, bio, page, len, offset, queue_max_sectors(q));
	unsigned int max_sectors;

	max_sectors = blk_max_size_offset(q, bio->bi_iter.bi_sector);
	if ((max_sectors < (len >> 9)) && !bio->bi_iter.bi_size)
		max_sectors = len >> 9;

	return __bio_add_page(q, bio, page, len, offset, max_sectors);
}
}
EXPORT_SYMBOL(bio_add_page);
EXPORT_SYMBOL(bio_add_page);


+1 −1
Original line number Original line Diff line number Diff line
@@ -1093,7 +1093,7 @@ EXPORT_SYMBOL_GPL(blkcg_deactivate_policy);
 * Register @pol with blkcg core.  Might sleep and @pol may be modified on
 * Register @pol with blkcg core.  Might sleep and @pol may be modified on
 * successful registration.  Returns 0 on success and -errno on failure.
 * successful registration.  Returns 0 on success and -errno on failure.
 */
 */
int blkcg_policy_register(struct blkcg_policy *pol)
int __init blkcg_policy_register(struct blkcg_policy *pol)
{
{
	int i, ret;
	int i, ret;


+2 −2
Original line number Original line Diff line number Diff line
@@ -145,7 +145,7 @@ void blkcg_drain_queue(struct request_queue *q);
void blkcg_exit_queue(struct request_queue *q);
void blkcg_exit_queue(struct request_queue *q);


/* Blkio controller policy registration */
/* Blkio controller policy registration */
int blkcg_policy_register(struct blkcg_policy *pol);
int __init blkcg_policy_register(struct blkcg_policy *pol);
void blkcg_policy_unregister(struct blkcg_policy *pol);
void blkcg_policy_unregister(struct blkcg_policy *pol);
int blkcg_activate_policy(struct request_queue *q,
int blkcg_activate_policy(struct request_queue *q,
			  const struct blkcg_policy *pol);
			  const struct blkcg_policy *pol);
@@ -580,7 +580,7 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { ret
static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
static inline void blkcg_drain_queue(struct request_queue *q) { }
static inline void blkcg_drain_queue(struct request_queue *q) { }
static inline void blkcg_exit_queue(struct request_queue *q) { }
static inline void blkcg_exit_queue(struct request_queue *q) { }
static inline int blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
static inline int __init blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
static inline void blkcg_policy_unregister(struct blkcg_policy *pol) { }
static inline void blkcg_policy_unregister(struct blkcg_policy *pol) { }
static inline int blkcg_activate_policy(struct request_queue *q,
static inline int blkcg_activate_policy(struct request_queue *q,
					const struct blkcg_policy *pol) { return 0; }
					const struct blkcg_policy *pol) { return 0; }
+18 −0
Original line number Original line Diff line number Diff line
@@ -1218,6 +1218,8 @@ struct request *blk_make_request(struct request_queue *q, struct bio *bio,
	if (unlikely(!rq))
	if (unlikely(!rq))
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);


	blk_rq_set_block_pc(rq);

	for_each_bio(bio) {
	for_each_bio(bio) {
		struct bio *bounce_bio = bio;
		struct bio *bounce_bio = bio;
		int ret;
		int ret;
@@ -1234,6 +1236,22 @@ struct request *blk_make_request(struct request_queue *q, struct bio *bio,
}
}
EXPORT_SYMBOL(blk_make_request);
EXPORT_SYMBOL(blk_make_request);


/**
 * blk_rq_set_block_pc - initialize a requeest to type BLOCK_PC
 * @rq:		request to be initialized
 *
 */
void blk_rq_set_block_pc(struct request *rq)
{
	rq->cmd_type = REQ_TYPE_BLOCK_PC;
	rq->__data_len = 0;
	rq->__sector = (sector_t) -1;
	rq->bio = rq->biotail = NULL;
	memset(rq->__cmd, 0, sizeof(rq->__cmd));
	rq->cmd = rq->__cmd;
}
EXPORT_SYMBOL(blk_rq_set_block_pc);

/**
/**
 * blk_requeue_request - put a request back on queue
 * blk_requeue_request - put a request back on queue
 * @q:		request queue where request should be inserted
 * @q:		request queue where request should be inserted
+5 −0
Original line number Original line Diff line number Diff line
@@ -132,6 +132,11 @@ int blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk,
	if (rq->errors)
	if (rq->errors)
		err = -EIO;
		err = -EIO;


	if (rq->sense == sense)	{
		rq->sense = NULL;
		rq->sense_len = 0;
	}

	return err;
	return err;
}
}
EXPORT_SYMBOL(blk_execute_rq);
EXPORT_SYMBOL(blk_execute_rq);
Loading