From: Mike Snitzer <snitzer@redhat.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: jaxboe@fusionio.com, msb@chromium.org,
linux-kernel@vger.kernel.org, dm-devel@redhat.com,
"Alasdair G. Kergon" <agk@redhat.com>
Subject: Re: [PATCH 3/3] block: Move discard and secure discard flags to queue limits
Date: Wed, 13 Jul 2011 11:46:37 -0400 [thread overview]
Message-ID: <20110713154637.GA22216@redhat.com> (raw)
In-Reply-To: <yq1fwnvzk0i.fsf@sermon.lab.mkp.net>
On Mon, May 30 2011 at 10:22pm -0400,
Martin K. Petersen <martin.petersen@oracle.com> wrote:
> >>>>> "Mike" == Mike Snitzer <snitzer@redhat.com> writes:
>
> Mike> Most targets do support discards (tgt->num_discard_requests > 0).
> Mike> But if any target doesn't support discards then the entire table
> Mike> doesn't support them.
>
> Would you rather have the stacking policy for discard be | instead of &?
Sorry about letting this slip through the cracks.
I had a look and I think if you just changed the dm-table.c hunk of this
3rd patch to allow DM to override the stacking then we'd be good (some
targets aren't to allow discard even if their component devices would
allow it when stacked), so something like:
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 367a2e0..02c93ab 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1251,16 +1251,17 @@ static void dm_table_set_integrity(struct dm_table *t)
void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
struct queue_limits *limits)
{
+ if (!dm_table_supports_discards(t)) {
+ limits->max_discard_sectors = 0;
+ limits->discard_granularity = 0;
+ limits->secure_discard = 0;
+ }
+
/*
* Copy table's limits to the DM device's request_queue
*/
q->limits = *limits;
- if (!dm_table_supports_discards(t))
- queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q);
- else
- queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
-
dm_table_set_integrity(t);
/*
next prev parent reply other threads:[~2011-07-13 15:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-25 20:50 [PATCH] dm: pass up rotational flag Mandeep Singh Baines
2011-05-26 18:23 ` Mike Snitzer
2011-05-26 18:29 ` Martin K. Petersen
2011-05-26 18:43 ` Mike Snitzer
2011-05-26 18:48 ` Martin K. Petersen
2011-05-26 19:14 ` Jens Axboe
2011-05-27 2:42 ` Martin K. Petersen
2011-05-27 2:42 ` [PATCH 1/3] block: Introduce blk_set_stacking_limits function Martin K. Petersen
2011-05-27 13:03 ` Mike Snitzer
2011-05-27 2:42 ` [PATCH 2/3] block: Move non-rotational flag to queue limits Martin K. Petersen
2011-05-27 13:02 ` Mike Snitzer
2011-05-31 2:19 ` Martin K. Petersen
2011-05-31 12:49 ` Mike Snitzer
2011-05-31 13:14 ` Jens Axboe
2011-05-31 14:28 ` Martin K. Petersen
2011-05-31 14:43 ` Jens Axboe
2011-05-27 2:42 ` [PATCH 3/3] block: Move discard and secure discard flags " Martin K. Petersen
2011-05-27 13:39 ` Mike Snitzer
2011-05-31 2:22 ` Martin K. Petersen
2011-07-13 15:46 ` Mike Snitzer [this message]
2011-05-27 16:20 ` Mandeep Singh Baines
2011-05-26 18:35 ` [PATCH v2] dm: pass up non-rotational flag Mike Snitzer
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=20110713154637.GA22216@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=jaxboe@fusionio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=msb@chromium.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