linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Kent Overstreet <kmo@daterainc.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	axboe@kernel.dk
Subject: Re: [PATCH 4/5] blk-lib.c: generic_make_request() handles large bios now
Date: Wed, 27 Nov 2013 04:54:05 -0800	[thread overview]
Message-ID: <20131127125405.GA21086@infradead.org> (raw)
In-Reply-To: <1385418633-9753-5-git-send-email-kmo@daterainc.com>

>  int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
>  		sector_t nr_sects, gfp_t gfp_mask, unsigned long flags)
>  {
> -	DECLARE_COMPLETION_ONSTACK(wait);
>  	struct request_queue *q = bdev_get_queue(bdev);
>  	int type = REQ_WRITE | REQ_DISCARD;
> -	unsigned int max_discard_sectors, granularity;
> -	int alignment;
> -	struct bio_batch bb;
>  	struct bio *bio;
>  	int ret = 0;
> -	struct blk_plug plug;
>  
>  	if (!q)
>  		return -ENXIO;
> @@ -56,78 +34,28 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
>  	if (!blk_queue_discard(q))
>  		return -EOPNOTSUPP;
>  
> -	/* Zero-sector (unknown) and one-sector granularities are the same.  */
> -	granularity = max(q->limits.discard_granularity >> 9, 1U);
> -	alignment = (bdev_discard_alignment(bdev) >> 9) % granularity;
> -
> -	/*
> -	 * Ensure that max_discard_sectors is of the proper
> -	 * granularity, so that requests stay aligned after a split.
> -	 */
> -	max_discard_sectors = min(q->limits.max_discard_sectors, UINT_MAX >> 9);
> -	max_discard_sectors -= max_discard_sectors % granularity;

Seems like this is also missing the code to trim down the request to
be properly aligned to the device limit.  I don't think our low-level
drivers are ready to handle this, and even if they were it should be a
separate change.

  reply	other threads:[~2013-11-27 12:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 22:30 [PATCH] Make generic_make_request() handle arbitrary size bios Kent Overstreet
2013-11-25 22:30 ` [PATCH 1/5] block: Make generic_make_request handle arbitrary sized bios Kent Overstreet
2013-11-26  6:09   ` Christoph Hellwig
2013-11-26  7:21     ` Kent Overstreet
2013-11-25 22:30 ` [PATCH 2/5] mtip32xx: handle arbitrary size bios Kent Overstreet
2013-11-26  6:10   ` Christoph Hellwig
2013-11-26  7:32     ` Kent Overstreet
2013-11-25 22:30 ` [PATCH 3/5] block: Gut bio_add_page() Kent Overstreet
2013-11-25 22:30 ` [PATCH 4/5] blk-lib.c: generic_make_request() handles large bios now Kent Overstreet
2013-11-27 12:54   ` Christoph Hellwig [this message]
2013-11-27 21:34     ` Kent Overstreet
2013-11-25 22:30 ` [PATCH 5/5] bcache: " Kent Overstreet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131127125405.GA21086@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=kmo@daterainc.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).