3 |
* |
* |
4 |
* Get the canonicalized absolute pathnames. The basis for SAKURA and TOMOYO. |
* Get the canonicalized absolute pathnames. The basis for SAKURA and TOMOYO. |
5 |
* |
* |
6 |
* Copyright (C) 2005-2007 NTT DATA CORPORATION |
* Copyright (C) 2005-2008 NTT DATA CORPORATION |
7 |
* |
* |
8 |
* Version: 1.5.3-pre 2007/12/03 |
* Version: 1.6.0-pre 2008/02/16 |
9 |
* |
* |
10 |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
11 |
* See README.ccs for ChangeLog. |
* See README.ccs for ChangeLog. |
193 |
{ |
{ |
194 |
struct nameidata nd; |
struct nameidata nd; |
195 |
if (pathname && path_lookup(pathname, lookup_flags, &nd) == 0) { |
if (pathname && path_lookup(pathname, lookup_flags, &nd) == 0) { |
196 |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,25) |
197 |
|
char *buf = realpath_from_dentry(nd.path.dentry, nd.path.mnt); |
198 |
|
path_put(&nd.path); |
199 |
|
#else |
200 |
char *buf = realpath_from_dentry(nd.dentry, nd.mnt); |
char *buf = realpath_from_dentry(nd.dentry, nd.mnt); |
201 |
path_release(&nd); |
path_release(&nd); |
202 |
|
#endif |
203 |
return buf; |
return buf; |
204 |
} |
} |
205 |
return NULL; |
return NULL; |
209 |
{ |
{ |
210 |
struct nameidata nd; |
struct nameidata nd; |
211 |
if (pathname && path_lookup(pathname, lookup_flags ^ LOOKUP_FOLLOW, &nd) == 0) { |
if (pathname && path_lookup(pathname, lookup_flags ^ LOOKUP_FOLLOW, &nd) == 0) { |
212 |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,25) |
213 |
|
char *buf = realpath_from_dentry(nd.path.dentry, nd.path.mnt); |
214 |
|
path_put(&nd.path); |
215 |
|
#else |
216 |
char *buf = realpath_from_dentry(nd.dentry, nd.mnt); |
char *buf = realpath_from_dentry(nd.dentry, nd.mnt); |
217 |
path_release(&nd); |
path_release(&nd); |
218 |
|
#endif |
219 |
return buf; |
return buf; |
220 |
} |
} |
221 |
return NULL; |
return NULL; |