diff options
author | Michael Laß | 2021-05-02 14:10:32 +0200 |
---|---|---|
committer | Michael Laß | 2021-05-02 14:10:32 +0200 |
commit | 2c0fcd8e9b26cae95bf9fbd92508beedb4c629b7 (patch) | |
tree | 44a0ceb94c494b6604c37eea1918e551ef08f7d5 /0009-LINUX-Introduce-afs_d_path.patch | |
parent | 6e12ff010a73c6f610c37dc72668a001c710cab9 (diff) | |
download | aur-2c0fcd8e9b26cae95bf9fbd92508beedb4c629b7.tar.gz |
Prepare for Linux 5.12
Diffstat (limited to '0009-LINUX-Introduce-afs_d_path.patch')
-rw-r--r-- | 0009-LINUX-Introduce-afs_d_path.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/0009-LINUX-Introduce-afs_d_path.patch b/0009-LINUX-Introduce-afs_d_path.patch new file mode 100644 index 000000000000..e289942fd807 --- /dev/null +++ b/0009-LINUX-Introduce-afs_d_path.patch @@ -0,0 +1,67 @@ +From e4d3ce24f759d6f099b5523fd34501b496fb88a5 Mon Sep 17 00:00:00 2001 +From: Andrew Deason <adeason@sinenomine.net> +Date: Tue, 23 Jul 2019 13:50:31 -0500 +Subject: [PATCH 09/11] 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. + +Reviewed-on: https://gerrit.openafs.org/13721 +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +(cherry picked from commit 4c4fb6e36634e5663c8be25acd4a1ac872e4738c) + +Change-Id: I08763c71006e4ac6f2bf88d8ac71941fc44e6ab8 +Reviewed-on: https://gerrit.openafs.org/14563 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> +--- + src/afs/LINUX/osi_compat.h | 11 +++++++++++ + src/afs/LINUX/osi_misc.c | 8 +------- + 2 files changed, 12 insertions(+), 7 deletions(-) + +diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h +index 620b3730c..a1e7f21fb 100644 +--- a/src/afs/LINUX/osi_compat.h ++++ b/src/afs/LINUX/osi_compat.h +@@ -737,4 +737,15 @@ afs_file_write(struct file *filp, char __user *buf, size_t len, loff_t *pos) + #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 */ +diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c +index 0e9336db6..aa5d5fc93 100644 +--- a/src/afs/LINUX/osi_misc.c ++++ b/src/afs/LINUX/osi_misc.c +@@ -138,13 +138,7 @@ int osi_abspath(char *aname, char *buf, int buflen, + return -PTR_ERR(name); + code = osi_lookupname_internal(name, followlink, &mnt, &dp); + if (!code) { +-#if defined(D_PATH_TAKES_STRUCT_PATH) +- afs_linux_path_t p = { .mnt = mnt, .dentry = dp }; +- path = d_path(&p, buf, buflen); +-#else +- path = d_path(dp, mnt, buf, buflen); +-#endif +- ++ path = afs_d_path(dp, mnt, buf, buflen); + if (IS_ERR(path)) { + code = -PTR_ERR(path); + } else { +-- +2.31.1 + |