lkml.org 
[lkml]   [2008]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] exporting capability code/name pairs (try #4)
Andrew G. Morgan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> KaiGai,
>
> Thanks for trying to accommodate me :-)
>
> Kohei KaiGai wrote:
> | In addition, Andrew suggested me to export these translation by symlinks
> | to reduce the number of invocation of system call.
>
> Yes, I wanted to make use of readlink() instead of open()/read()/close()
> to access each unknown capability.
>
> | However, current sysfs interface does not allows to create symlinks with
> | invalid indication.
>
> :-(
>
> | Thus, this patch exports them as regular files.
>
> What about using symlinks for the name files and text content for the
> numeric ones? You could even drop the names/ and codes/ subdirectories too:
>
> $ cat /sys/kernel/capability/20
> cap_sys_pacct
> $ ls -l /sys/kernel/capability/cap_mknod
> lr--r--r-- 1 root root 64 Feb 8 08:26 cap_mknod -> 27
> $ cat /sys/kernel/capability/names/cap_mknod
> cap_mknod

Sysfs does not support to create symbolic links to regular files now.

The sysfs_create_link() is a function to create a symbolic link on sysfs.
However, it requires two kobjects as its arguments. One is to specify its
parent directory, the other is to specify the target of indirection.
It means the indicated target have to be a directory.

At include/linux/sysfs.h:
int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target,
const char *name);

Please tell me, if I have any misunderstandings.

Thanks,
--
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>


\
 
 \ /
  Last update: 2008-02-12 02:03    [from the cache]
©2003-2011 Jasper Spaans