linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matias Bjørling" <mb@lightnvm.io>
To: "Jens Axboe" <axboe@kernel.dk>, "Javier González" <jg@lightnvm.io>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Javier González" <javier@javigon.com>,
	"Javier González" <javier@cnexlabs.com>
Subject: Re: [PATCH 4/7] lightnvm: drop reserve and release LUN callbacks
Date: Tue, 1 Nov 2016 01:38:23 +0100	[thread overview]
Message-ID: <846de705-2c2f-c636-39bd-e0ffc877ecaa@lightnvm.io> (raw)
In-Reply-To: <9fc12698-de1b-b535-f8c4-d283a29a6099@kernel.dk>

On 10/31/2016 09:22 PM, Jens Axboe wrote:
> On 10/31/2016 07:08 AM, Matias Bjørling wrote:
>> On 10/27/2016 08:01 PM, Javier González wrote:
>>> From: Javier González <javier@javigon.com>
>>>
>>> On target initialization, targets use callbacks to the media manager to
>>> configure the LUNs they use. In order to simplify the flow, drop this
>>> callbacks and manage everything internally on the media manager.
>>>
>>> By making use of the newly introduce LUN management structure, the media
>>> manager knows which target exclusively owns each target and can
>>> therefore allocate and free all the necessary structures before
>>> initializing the target. Not exclusively owned LUNs belong to the media
>>> manager in any case.
>>>
>>> Adapt rrpc to not use the reserve_lun/release_lun callback functions.
>>>
>>> Signed-off-by: Javier González <javier@cnexlabs.com>
>>> ---
>>>  drivers/lightnvm/gennvm.c | 68
>>> ++++++++++++++++++++++++++++++++++++-----------
>>>  drivers/lightnvm/rrpc.c   | 12 +--------
>>>  include/linux/lightnvm.h  |  5 +---
>>>  3 files changed, 55 insertions(+), 30 deletions(-)
>>>
>>> diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c
>>> index 8bff725..a340685 100644
>>> --- a/drivers/lightnvm/gennvm.c
>>> +++ b/drivers/lightnvm/gennvm.c
>>> @@ -35,6 +35,50 @@ static const struct block_device_operations
>>> gen_fops = {
>>>      .owner        = THIS_MODULE,
>>>  };
>>>
>>> +static int gen_reserve_luns(struct nvm_dev *dev, int lun_begin, int
>>> lun_end,
>>> +                struct nvm_target *t)
>>> +{
>>> +    struct gen_dev *gn = dev->mp;
>>> +    struct gen_lun *lun;
>>> +    int i;
>>> +
>>> +    for (i = lun_begin; i <= lun_end; i++) {
>>> +        if (test_and_set_bit(i, dev->lun_map)) {
>>> +            pr_err("gennvm: lun %d is already allocated\n", i);
>>> +            goto fail;
>>> +        }
>>> +
>>> +        lun = &gn->luns[i];
>>> +        lun->tgt = t;
>>> +        lun->vlun.priv = lun->mgmt;
>>> +    }
>>> +
>>> +    return 0;
>>> +fail:
>>> +    while (--i > lun_begin)
>>> +        clear_bit(i, dev->lun_map);
>>> +
>>> +    return 1;
>>
>> return -EINVAL;
> 
> -EBUSY?
> 
>> Lad os lige snakke lidt om dette her senere også :)
> 
> And probably keep the public emails in English :-)
> 

Haha, will do. Good to spice up the mailing list a bit :)

  reply	other threads:[~2016-11-01  0:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 18:01 [PATCH 0/7] LightNVM patchset V2 Javier González
2016-10-27 18:01 ` [PATCH 1/7] lightnvm: enable to send hint to erase command Javier González
2016-10-27 18:01 ` [PATCH 2/7] lightnvm: do not decide on device blocks Javier González
2016-10-27 18:01 ` [PATCH 3/7] lightnvm: manage block list on LUN owner Javier González
2016-10-27 18:01 ` [PATCH 4/7] lightnvm: drop reserve and release LUN callbacks Javier González
2016-10-31 13:08   ` Matias Bjørling
2016-10-31 20:22     ` Jens Axboe
2016-11-01  0:38       ` Matias Bjørling [this message]
2016-10-27 18:01 ` [PATCH 5/7] lightnvm: export set bad block table Javier González
2016-10-27 18:01 ` [PATCH 6/7] lightnvm: add ECC error codes Javier González
2016-10-27 18:01 ` [PATCH 7/7] lightnvm: rrpc: split bios of size > 256kb Javier González
2016-11-02 16:02 ` [PATCH 0/7] LightNVM patchset V2 Matias Bjørling
  -- strict thread matches above, loose matches on Subject: below --
2016-10-27 14:49 [PATCH 1/7] lightnvm: enable to send hint to erase command Javier González
2016-10-27 14:49 ` [PATCH 4/7] lightnvm: drop reserve and release LUN callbacks Javier González

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=846de705-2c2f-c636-39bd-e0ffc877ecaa@lightnvm.io \
    --to=mb@lightnvm.io \
    --cc=axboe@kernel.dk \
    --cc=javier@cnexlabs.com \
    --cc=javier@javigon.com \
    --cc=jg@lightnvm.io \
    --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;
as well as URLs for NNTP newsgroup(s).