lkml.org 
[lkml]   [2008]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [TOMOYO #12 (2.6.28-rc2-mm1) 04/11] Introduce d_realpath().
On Tue, 04 Nov 2008 15:08:51 +0900
Kentaro Takeda <takedakn@nttdata.co.jp> wrote:

> + /*
> + * Exception: Use /proc/self/ rather than /proc/\$/
> + * for current process.
> + */
> + name = dentry->d_name.name;
> + name_len = dentry->d_name.len;
> + if (IS_ROOT(parent) &&
> + parent->d_sb->s_magic == PROC_SUPER_MAGIC &&
> + !strict_strtoul(name, 10, &pid)) {

Well that looks like rather a hack.

It would still be a hack, but a better implementation might be to save
the procfs superblock's address in a global then do


#ifdef CONFIG_PROCFS
static inline bool is_procfs_sb(struct super_block *sb)
{
return sb == saved_procfs_sb;
}
#else
static inline bool is_procfs_sb(struct super_block *sb)
{
return false;
}
#endif



\
 
 \ /
  Last update: 2008-11-06 00:15    [W:0.170 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site