FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 07-24-2010, 04:09 PM
Mike Snitzer
 
Default dm: remove the DM_TARGET_SUPPORTS_DISCARDS feature flag

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;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 12:19 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org