diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index 81dc8a58..46825b3e 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -479,6 +479,16 @@ ifneq (,$(shell grep '^unsigned int stack_trace_save' include/linux/stacktrace.h ccflags-y += -DKC_STACK_TRACE_SAVE endif +# +# v3.14-rc1-7-g4e34e719e457 +# +# .set_acl callback added to struct inode_operations. Most kernels +# we target have it, but el7 (3.10 base) does not, so detect. +# +ifneq (,$(shell grep 'int ..set_acl..struct' include/linux/fs.h)) +ccflags-y += -DKC_HAS_SET_ACL +endif + # # v6.1-rc1-2-g138060ba92b3 # diff --git a/kmod/src/acl.c b/kmod/src/acl.c index 356e3107..c836df19 100644 --- a/kmod/src/acl.c +++ b/kmod/src/acl.c @@ -216,7 +216,8 @@ int scoutfs_set_acl(KC_VFS_NS_DEF { struct inode *inode = dentry->d_inode; #else -int scoutfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) +int scoutfs_set_acl(KC_VFS_NS_DEF + struct inode *inode, struct posix_acl *acl, int type) { #endif struct super_block *sb = inode->i_sb; @@ -309,7 +310,7 @@ int scoutfs_acl_set_xattr(struct dentry *dentry, const char *name, const void *v #ifdef KC_SET_ACL_DENTRY ret = scoutfs_set_acl(KC_VFS_INIT_NS dentry, acl, type); #else - ret = scoutfs_set_acl(dentry->d_inode, acl, type); + ret = scoutfs_set_acl(KC_VFS_INIT_NS dentry->d_inode, acl, type); #endif out: posix_acl_release(acl); diff --git a/kmod/src/acl.h b/kmod/src/acl.h index a5bf21d6..2b64fafa 100644 --- a/kmod/src/acl.h +++ b/kmod/src/acl.h @@ -5,7 +5,8 @@ int scoutfs_set_acl(KC_VFS_NS_DEF struct dentry *dentry, struct posix_acl *acl, int type); #else -int scoutfs_set_acl(struct inode *inode, struct posix_acl *acl, int type); +int scoutfs_set_acl(KC_VFS_NS_DEF + struct inode *inode, struct posix_acl *acl, int type); #endif #ifdef KC_GET_INODE_ACL struct posix_acl *scoutfs_get_acl(struct inode *inode, int type, bool rcu); diff --git a/kmod/src/dir.c b/kmod/src/dir.c index efcdef24..f9729d7d 100644 --- a/kmod/src/dir.c +++ b/kmod/src/dir.c @@ -2063,7 +2063,7 @@ const struct inode_operations scoutfs_dir_iops = { #else .get_acl = scoutfs_get_acl, #endif -#ifdef KC_SET_ACL_DENTRY +#ifdef KC_HAS_SET_ACL .set_acl = scoutfs_set_acl, #endif .symlink = scoutfs_symlink, diff --git a/kmod/src/inode.c b/kmod/src/inode.c index 96376dc0..621833d2 100644 --- a/kmod/src/inode.c +++ b/kmod/src/inode.c @@ -154,7 +154,7 @@ static const struct inode_operations scoutfs_file_iops = { #else .get_acl = scoutfs_get_acl, #endif -#ifdef KC_SET_ACL_DENTRY +#ifdef KC_HAS_SET_ACL .set_acl = scoutfs_set_acl, #endif .fiemap = scoutfs_data_fiemap, @@ -174,7 +174,7 @@ static const struct inode_operations scoutfs_special_iops = { #else .get_acl = scoutfs_get_acl, #endif -#ifdef KC_SET_ACL_DENTRY +#ifdef KC_HAS_SET_ACL .set_acl = scoutfs_set_acl, #endif };