Re: [PATCH 2/5] tcm: Unify INQUIRY subsystem plugin handling

From: Nicholas A. Bellinger
Date: Wed Oct 13 2010 - 16:24:42 EST


On Wed, 2010-10-13 at 13:06 +0200, Christoph Hellwig wrote:
> On Wed, Oct 13, 2010 at 01:48:01AM -0700, Nicholas A. Bellinger wrote:
> > From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> >
> > This patch adds the following two struct se_subsystem_api function pointer
> > ops for INQUIRY emulation reponse payload Product and Product Rev:
>
> FYI, I'd wonder if it wouldn't be easier to store this and the number
> of blocks data directly in struct se_device instead of adding methods.
>
> That means they just need to be initialized once at device creation time
> and the code in the backends becomes simpler again. This also applies
> to many of the get_ prefix methods, e.g. get_max_cdb_len, get_blocksize,
> etc.

I should point out that the majority of values mentioned here (other
than the two INQUIRY strings) are already present in struct
se_dev_attrib and which appear as configfs attributes under
under /sys/kernel/config/target/core/$HBA/$DEV/attrib/. This means that
the struct se_subsystem_api calls only really used by during init
target_core_device.c:se_dev_set_default_attribs() and
DEV_ATTRIB(dev)->block_size, etc are used in TCM Core code.

I am happy to include the two INQUIRY strings needed for emulation into
struct se_subsystem_api directly, but I would still prefer to keep the
function pointers for extracting values from subsystem specific code for
the initial device attribute setup.

--nab


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/