dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: dm-devel@redhat.com
Subject: [PATCH v2 03/12] dm: remove the DM_TARGET_SUPPORTS_DISCARDS feature flag
Date: Sat, 24 Jul 2010 12:09:19 -0400	[thread overview]
Message-ID: <1279987768-13275-4-git-send-email-snitzer@redhat.com> (raw)
In-Reply-To: <1279987768-13275-1-git-send-email-snitzer@redhat.com>

Eliminate the DM_TARGET_SUPPORTS_DISCARDS feature flag now that
dm_target's 'num_discard_requests' provides the mechanism to enable
discards on a per target basis.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 drivers/md/dm-linear.c        |    1 -
 drivers/md/dm-table.c         |    2 +-
 drivers/md/dm.c               |    2 +-
 include/linux/device-mapper.h |    1 -
 4 files changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6-block/drivers/md/dm-linear.c
===================================================================
--- linux-2.6-block.orig/drivers/md/dm-linear.c
+++ linux-2.6-block/drivers/md/dm-linear.c
@@ -153,7 +153,6 @@ static struct target_type linear_target 
 	.ioctl  = linear_ioctl,
 	.merge  = linear_merge,
 	.iterate_devices = linear_iterate_devices,
-	.features = DM_TARGET_SUPPORTS_DISCARDS,
 };
 
 int __init dm_linear_init(void)
Index: linux-2.6-block/drivers/md/dm-table.c
===================================================================
--- linux-2.6-block.orig/drivers/md/dm-table.c
+++ linux-2.6-block/drivers/md/dm-table.c
@@ -773,7 +773,7 @@ int dm_table_add_target(struct dm_table 
 
 	t->highs[t->num_targets++] = tgt->begin + tgt->len - 1;
 
-	if (!(tgt->type->features & DM_TARGET_SUPPORTS_DISCARDS))
+	if (!tgt->num_discard_requests)
 		t->discards_supported = 0;
 
 	return 0;
Index: linux-2.6-block/drivers/md/dm.c
===================================================================
--- linux-2.6-block.orig/drivers/md/dm.c
+++ linux-2.6-block/drivers/md/dm.c
@@ -1242,7 +1242,7 @@ static int __clone_and_map_discard(struc
 	 * check was performed.
 	 */
 
-	if (!(ti->type->features & DM_TARGET_SUPPORTS_DISCARDS))
+	if (!ti->num_discard_requests)
 		return -EOPNOTSUPP;
 
 	max = max_io_len(ci->md, ci->sector, ti);
Index: linux-2.6-block/include/linux/device-mapper.h
===================================================================
--- linux-2.6-block.orig/include/linux/device-mapper.h
+++ linux-2.6-block/include/linux/device-mapper.h
@@ -130,7 +130,6 @@ void dm_put_device(struct dm_target *ti,
 /*
  * Target features
  */
-#define DM_TARGET_SUPPORTS_DISCARDS 0x00000001
 
 struct target_type {
 	uint64_t features;

  parent reply	other threads:[~2010-07-24 16:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-24 16:09 [PATCH v2 00/12] dm: enable discard support for more targets Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 01/12] dm: rename map_info flush_request to target_request_nr Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 02/12] dm: introduce num_discard_requests in dm_target structure Mike Snitzer
2010-07-24 16:09 ` Mike Snitzer [this message]
2010-07-24 16:09 ` [PATCH v2 04/12] dm: use common __issue_target_request for flush and discard support Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 05/12] dm: factor max_io_len for code reuse Mike Snitzer
2010-07-26 21:36   ` [PATCH v3 " Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 06/12] dm: split discard requests on target boundaries Mike Snitzer
2010-07-26 21:41   ` [PATCH v3 " Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 07/12] dm zero: silently drop discards too Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 08/12] dm error: return error for " Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 09/12] dm delay: enable discard support Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 10/12] block: update request stacking methods to support discards Mike Snitzer
2010-07-27 14:54   ` Christoph Hellwig
2010-07-24 16:09 ` [PATCH v2 11/12] dm mpath: enable discard support Mike Snitzer
2010-07-26 20:41   ` [PATCH v3 " Mike Snitzer
2010-07-24 16:09 ` [PATCH v2 12/12] dm stripe: enable efficient " Mike Snitzer
2010-07-27 20:32   ` [PATCH v3 " 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=1279987768-13275-4-git-send-email-snitzer@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    /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).