mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Matias Bjørling" <matias@cnexlabs.com>
To: <axboe@fb.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Matias Bjørling" <matias@cnexlabs.com>
Subject: [PATCH 2/2] lightnvm: set default lun range when no luns are specified
Date: Wed, 15 Feb 2017 16:25:33 +0100	[thread overview]
Message-ID: <20170215152533.9712-3-matias@cnexlabs.com> (raw)
In-Reply-To: <20170215152533.9712-1-matias@cnexlabs.com>

The create target ioctl takes a lun begin and lun end parameter, which
defines the range of luns to initialize a target with. If the user does
not set the parameters, it default to only using lun 0. Instead,
defaults to use all luns in the OCSSD, as it is the usual behaviour
users want.

Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
---
 drivers/lightnvm/core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 6ce76c0..5262ba6 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -1102,6 +1102,11 @@ static int __nvm_configure_create(struct nvm_ioctl_create *create)
 	}
 	s = &create->conf.s;
 
+	if (s->lun_begin == -1 && s->lun_end == -1) {
+		s->lun_begin = 0;
+		s->lun_end = dev->geo.nr_luns - 1;
+	}
+
 	if (s->lun_begin > s->lun_end || s->lun_end >= dev->geo.nr_luns) {
 		pr_err("nvm: lun out of bound (%u:%u > %u)\n",
 			s->lun_begin, s->lun_end, dev->geo.nr_luns - 1);
-- 
2.9.3

  parent reply	other threads:[~2017-02-15 15:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 15:25 [PATCH 0/2] Small fixes for LightNVM core Matias Bjørling
2017-02-15 15:25 ` [PATCH 1/2] lightnvm: fix off-by-one error on target initialization Matias Bjørling
2017-02-15 15:25 ` Matias Bjørling [this message]
2017-02-15 15:27 ` [PATCH 0/2] Small fixes for LightNVM core Jens Axboe
2017-02-15 15:28   ` Matias Bjørling

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=20170215152533.9712-3-matias@cnexlabs.com \
    --to=matias@cnexlabs.com \
    --cc=axboe@fb.com \
    --cc=linux-block@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

all inboxes | Powered by JetHome®