mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
LINUX: Introduce afs_d_path
Move our preprocessor logic around d_path into an osi_compat.h wrapper, called afs_d_path. This just makes it a little easier to use d_path, and moves a tiny bit of #ifdef cruft away from real code. Change-Id: I2032eda3fef18be6e77e3bf362ec5ce641e1d76d Reviewed-on: https://gerrit.openafs.org/13721 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
parent
252b3bcc75
commit
4c4fb6e366
@ -722,4 +722,15 @@ afs_file_write(struct file *filp, char __user *buf, size_t len, loff_t *pos)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline char*
|
||||||
|
afs_d_path(struct dentry *dp, struct vfsmount *mnt, char *buf, int buflen)
|
||||||
|
{
|
||||||
|
#ifdef D_PATH_TAKES_STRUCT_PATH
|
||||||
|
afs_linux_path_t p = { .mnt = mnt, .dentry = dp };
|
||||||
|
return d_path(&p, buf, buflen);
|
||||||
|
#else
|
||||||
|
return d_path(dp, mnt, buf, buflen);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* AFS_LINUX_OSI_COMPAT_H */
|
#endif /* AFS_LINUX_OSI_COMPAT_H */
|
||||||
|
@ -138,13 +138,7 @@ int osi_abspath(char *aname, char *buf, int buflen,
|
|||||||
return -PTR_ERR(name);
|
return -PTR_ERR(name);
|
||||||
code = osi_lookupname_internal(name, followlink, &mnt, &dp);
|
code = osi_lookupname_internal(name, followlink, &mnt, &dp);
|
||||||
if (!code) {
|
if (!code) {
|
||||||
#if defined(D_PATH_TAKES_STRUCT_PATH)
|
path = afs_d_path(dp, mnt, buf, buflen);
|
||||||
afs_linux_path_t p = { .mnt = mnt, .dentry = dp };
|
|
||||||
path = d_path(&p, buf, buflen);
|
|
||||||
#else
|
|
||||||
path = d_path(dp, mnt, buf, buflen);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (IS_ERR(path)) {
|
if (IS_ERR(path)) {
|
||||||
code = -PTR_ERR(path);
|
code = -PTR_ERR(path);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user