5 |
* |
* |
6 |
* Copyright (C) 2005-2008 NTT DATA CORPORATION |
* Copyright (C) 2005-2008 NTT DATA CORPORATION |
7 |
* |
* |
8 |
* Version: 1.6.2 2008/06/25 |
* Version: 1.6.3-pre 2008/07/10 |
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. |
191 |
int ccs_realpath_from_dentry2(struct dentry *dentry, struct vfsmount *mnt, |
int ccs_realpath_from_dentry2(struct dentry *dentry, struct vfsmount *mnt, |
192 |
char *newname, int newname_len) |
char *newname, int newname_len) |
193 |
{ |
{ |
194 |
int error; |
int error = -EINVAL; |
195 |
struct dentry *d_dentry; |
struct dentry *d_dentry; |
196 |
struct vfsmount *d_mnt; |
struct vfsmount *d_mnt; |
197 |
if (!dentry || !mnt || !newname || newname_len <= 2048) |
if (!dentry || !newname || newname_len <= 2048) |
198 |
return -EINVAL; |
goto out; |
199 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) |
200 |
if (dentry->d_op && dentry->d_op->d_dname) { |
if (dentry->d_op && dentry->d_op->d_dname) { |
201 |
/* For "socket:[\$]" and "pipe:[\$]". */ |
/* For "socket:[\$]" and "pipe:[\$]". */ |
235 |
goto out; |
goto out; |
236 |
} |
} |
237 |
#endif |
#endif |
238 |
|
if (!mnt) |
239 |
|
goto out; |
240 |
d_dentry = dget(dentry); |
d_dentry = dget(dentry); |
241 |
d_mnt = mntget(mnt); |
d_mnt = mntget(mnt); |
242 |
/***** CRITICAL SECTION START *****/ |
/***** CRITICAL SECTION START *****/ |
252 |
/***** CRITICAL SECTION END *****/ |
/***** CRITICAL SECTION END *****/ |
253 |
dput(d_dentry); |
dput(d_dentry); |
254 |
mntput(d_mnt); |
mntput(d_mnt); |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) |
|
255 |
out: |
out: |
|
#endif |
|
256 |
if (error) |
if (error) |
257 |
printk(KERN_WARNING "ccs_realpath: Pathname too long.\n"); |
printk(KERN_WARNING "ccs_realpath: Pathname too long. (%d)\n", |
258 |
|
error); |
259 |
return error; |
return error; |
260 |
} |
} |
261 |
|
|