Commit 25f5b551 authored by Phoebe Buckheister's avatar Phoebe Buckheister 🦎 Committed by Christian Mohrbacher

client: add support for linux 4.10

(cherry picked from commit 8c87018513289982d5be5fe8e84ae812b9425096)
parent a2fb0c98
......@@ -70,6 +70,7 @@ kernel_version:
- x86_64/linux-4.7
- x86_64/linux-4.8
- x86_64/linux-4.9-rc7
- x86_64/linux-4.10
- x86_64/linux-3.10.0-514.el7
- x86/linux-2.6.30.3
- x86_64/linux-4.8-debian
......
......@@ -4,13 +4,27 @@ set -e
CFLAGS="-D__KERNEL__ $LINUXINCLUDE $KBUILD_CFLAGS $KBUILD_CPPFLAGS -DKBUILD_BASENAME=\"beegfs\""
_generate_includes() {
for i in "$@"; do
echo "#include <$i>"
done
}
_marker_if_compiles() {
local marker=$1
shift
if $CC $CFLAGS -x c -o /dev/null -c - 2>/dev/null
then
echo -D$marker
fi
}
_check_struct_field_input() {
local field=$1
shift 1
for i in "$@"; do
echo "#include <$i>"
done
_generate_includes "$@"
cat <<EOF
void want_symbol(void) {
......@@ -25,10 +39,31 @@ check_struct_field() {
local marker=$2
shift 2
if _check_struct_field_input "$field" "$@" | $CC $CFLAGS -x c -o /dev/null -c - 2>/dev/null
then
echo -D$marker
fi
_check_struct_field_input "$field" "$@" | _marker_if_compiles "$marker"
}
_check_function_input() {
local name=$1
local signature=$2
shift 2
_generate_includes "$@"
cat <<EOF
void want_fn(void) {
char predicate[
2 * __builtin_types_compatible_p(__typeof($name), $signature) - 1
];
}
EOF
}
check_function() {
local name=$1
local signature=$2
local marker=$3
shift 3
_check_function_input "$name" "$signature" "$@" | _marker_if_compiles "$marker"
}
cd $srctree
......@@ -38,6 +73,11 @@ check_struct_field \
KERNEL_HAS_LAUNDER_PAGE \
linux/fs.h
check_function \
generic_readlink "int (struct dentry *, char __user *, int)" \
KERNEL_HAS_GENERIC_READLINK \
linux/fs.h
# we have to communicate with the calling makefile somehow. since we can't really use the return
# code of this script, we'll echo a special string at the end of our output for the caller to
# detect and remove again.
......
......@@ -443,7 +443,9 @@ bool __App_initInodeOperations(App* this)
this->fileInodeOps->permission = FhgfsOps_permission;
this->fileInodeOps->setattr = FhgfsOps_setattr;
#ifdef KERNEL_HAS_GENERIC_READLINK
this->symlinkInodeOps->readlink = generic_readlink; // default is fine for us currently
#endif
#ifdef KERNEL_HAS_GET_LINK
this->symlinkInodeOps->get_link = FhgfsOps_get_link;
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment