public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: target-devel <target-devel@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <Linux-scsi@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	Andy Grover <agrover@redhat.com>
Subject: Merging se_dev_entry and se_lun?
Date: Fri, 19 Jun 2015 08:40:23 +0200	[thread overview]
Message-ID: <5583B957.20200@suse.de> (raw)

Hi Nic,

having done the patch to export 'write_protect' for demo-mode LUNs
I've came across one puzzling item:

struct se_lun uses a list to refer to the underlying se_dev_entry
structures. Which I found rather curious, as from my understanding
'se_lun' is the structure for the mapped LUN (ie the LUN visible to
the initiator) and 'se_dev_entry' is the underlying physical device
as visible to the LUN.
As such I would have expected a 1:1 relationship between both, ie a
simple pointer from se_lun to se_dev_entry.

Having a list here implies that 'se_lun' can have _several_
se_dev_entry structure attached to it, which I found rather curious.

Can you give me an example where this might be the case?
Or can we replace the list with a simple pointer or even merge both?

Reason I'm asking is the lun_access / dev_flags field; it really
looks like it being a duplicate (I would judge 'write_protect' to be
a property of the mapped LUN, and not of the underlying device),
but in either case having it in both places requires a
synchronisation between both, as for demo-mode LUNs we can only
change it via se_lun, and for others we have to change it via the
se_dev_entry.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

             reply	other threads:[~2015-06-19  6:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19  6:40 Hannes Reinecke [this message]
2015-06-19  6:56 ` Merging se_dev_entry and se_lun? Christoph Hellwig
2015-06-19 13:21   ` Hannes Reinecke
2015-06-19 13:58     ` Christoph Hellwig

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=5583B957.20200@suse.de \
    --to=hare@suse.de \
    --cc=Linux-scsi@vger.kernel.org \
    --cc=agrover@redhat.com \
    --cc=hch@infradead.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@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