On 10/22/2015 03:16 PM, Christoph Hellwig wrote:
On Tue, Oct 20, 2015 at 02:32:32PM +0200, Andrzej Pietrasiewicz wrote:
From: Krzysztof Opasiak <k.opas...@samsung.com>

This change is necessary for the SCSI target usb gadget composed with
configfs. In this case configfs will be used for two different purposes:
to compose a usb gadget and to configure the target part. If an instance
of tcm function is created in $CONFIGFS_ROOT/usb_gadget/<gadget>/functions
a tpg can be created in $CONFIGFS_ROOT/target/usb_gadget/<wwn>/, but after
a tpg is created the tcm function must not be removed until its
corresponding tpg is gone. While the configfs_depend/undepend_item() are
meant exactly for creating this kind of dependencies, they are not suitable
if the other kernel subsystem happens to be another subsystem in configfs,
so this patch adds unlocked versions meant for configfs callbacks.

configfs_depend_item is a lot of deep magic (which I haven't even tried
to fully understand yet).  Can you explain why your versions is safe
without all that?  Can also please document the precoditions required
for the function in comments, or wherever possible asserts?

Also needs a kerneldoc comment explaining the exact semantics.


Could you please take a look onto v2 version? This patch has been updated due to Joel's remarks and when I was writing this I didn't mean this to be used from other configfs subsystem. Now it is updated and should work fine in all configfs callbacks

+void configfs_undepend_item_unlocked(struct config_item *target)
+{
+       configfs_undepend_item(NULL, target);
+}
+EXPORT_SYMBOL(configfs_undepend_item_unlocked);

And given that configfs_undepend_item ignores the subsys argument this
wrapper clearl isn't needed.  Just send a separate patch to drop the
subsys argument to configfs_undepend_item instead.


Well, here I would not agree. In my opinion subsys argument has been left to make this API symmetric and I think that's a good idea.

Thanks,
--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to