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


Groups > linux.kernel > #1512858

Re: [PATCH 4/7] lightnvm: drop reserve and release LUN callbacks

From Jens Axboe <axboe@kernel.dk>
Newsgroups linux.kernel
Subject Re: [PATCH 4/7] lightnvm: drop reserve and release LUN callbacks
Date 2016-10-31 21:30 +0100
Message-ID <syrns-7fi-33@gated-at.bofh.it> (permalink)
References <swXhL-5la-13@gated-at.bofh.it> <swXhM-5la-19@gated-at.bofh.it> <sykvD-2PE-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 :-)

-- 
Jens Axboe

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


Thread

[PATCH 4/7] lightnvm: drop reserve and release LUN callbacks "Javier González" <jg@lightnvm.io> - 2016-10-27 20:10 +0200
  Re: [PATCH 4/7] lightnvm: drop reserve and release LUN callbacks Matias Bjørling <mb@lightnvm.io> - 2016-10-31 14:10 +0100
    Re: [PATCH 4/7] lightnvm: drop reserve and release LUN callbacks Jens Axboe <axboe@kernel.dk> - 2016-10-31 21:30 +0100
      Re: [PATCH 4/7] lightnvm: drop reserve and release LUN callbacks Matias Bjørling <mb@lightnvm.io> - 2016-11-01 01:50 +0100

csiph-web