Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1433242

[PATCH 1/2] dm: update table type check for dax

From Toshi Kani <toshi.kani@hpe.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] dm: update table type check for dax
Date 2016-06-28 21:40 +0200
Message-ID <rP71w-2K4-39@gated-at.bofh.it> (permalink)
References <rP71w-2K4-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Allow table type DM_TYPE_BIO_BASED to extend with
DM_TYPE_DAX_BIO_BASED since DM_TYPE_DAX_BIO_BASED
supports bio-based requests.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
---
 drivers/md/dm-ioctl.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index b59e3459..0f32791 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1267,6 +1267,15 @@ static int populate_table(struct dm_table *table,
 	return dm_table_complete(table);
 }
 
+static bool is_valid_type(unsigned cur, unsigned new)
+{
+	if (cur == new ||
+	    (cur == DM_TYPE_BIO_BASED && new == DM_TYPE_DAX_BIO_BASED))
+		return true;
+
+	return false;
+}
+
 static int table_load(struct dm_ioctl *param, size_t param_size)
 {
 	int r;
@@ -1309,7 +1318,7 @@ static int table_load(struct dm_ioctl *param, size_t param_size)
 			DMWARN("unable to set up device queue for new table.");
 			goto err_unlock_md_type;
 		}
-	} else if (dm_get_md_type(md) != dm_table_get_type(t)) {
+	} else if (!is_valid_type(dm_get_md_type(md), dm_table_get_type(t))) {
 		DMWARN("can't change device type after initial table load.");
 		r = -EINVAL;
 		goto err_unlock_md_type;

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] dm: update table type check for dax Toshi Kani <toshi.kani@hpe.com> - 2016-06-28 21:40 +0200
  Re: [PATCH 1/2] dm: update table type check for dax Mike Snitzer <snitzer@redhat.com> - 2016-06-28 22:10 +0200
    Re: [PATCH 1/2] dm: update table type check for dax "Kani, Toshimitsu" <toshi.kani@hpe.com> - 2016-06-28 22:30 +0200
      Re: [PATCH 1/2] dm: update table type check for dax Mike Snitzer <snitzer@redhat.com> - 2016-06-29 02:50 +0200
        Re: [PATCH 1/2] dm: update table type check for dax "Kani, Toshimitsu" <toshi.kani@hpe.com> - 2016-06-29 17:20 +0200
  Re: [PATCH 1/2] dm: update table type check for dax kbuild test robot <lkp@intel.com> - 2016-06-28 22:40 +0200

csiph-web