[PATCH] [ConfigFS]: Allow symbolic links from a SysFS structkobject source.

From: Nicholas A. Bellinger
Date: Fri Oct 17 2008 - 02:56:21 EST

Hi Joel, Greg and Co,

Here is the the first working code for allowing configfs to handle
symlinks from sysfs struct kobject based code. Here is the commit:
passing struct kobject into generic target_core_mod subsystem plugins
for locating struct block_device and struct scsi_device..


In struct configfs_item_operations, added allow_link_kobject() and
drop_link_kobject() to allow struct kobject to be passed through
the configfs API. The code for kobject symlink source sits along side
the exist configfs symlink code, and does not break existing apps that use
allow_link() or drop_link().

Also, there is two large FIXMEs with the first commit, in
fs/configfs/symlink.c:configfs_symlink() related to comparing
struct nameidata nd.path.dentry->d_sb == sysfs_sb.

The 2nd is when doing a 'ls -la' inside of the config group directory
containg the symlink source from sysfs, the source link does not currently
appear.. I will be following up these two items..

Signed-off-by: Nicholas A. Bellinger
fs/configfs/configfs_internal.h | 3 +-
fs/configfs/symlink.c | 168 +++++++++++++++++++++++++++------------
include/linux/configfs.h | 6 +-
3 files changed, 123 insertions(+), 54 deletions(-)

the following commit can be found at:


Comments..? I will send along my patch to
drivers/lio-core/target_core_configfs.c in a moment to demonstrate how
to pull it all together with struct config_item_operations
allow_link_kobject() and drop_link_kobject()..

Attachment: 0001-ConfigFS-Allow-symbolic-links-from-a-SysFS-struct.patch
Description: application/mbox