aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2014-03-28 12:59:36 +0800
committerBrian Behlendorf <[email protected]>2014-04-10 14:27:03 -0700
commit408ec0d2e13188f6f500f7010b5bc5bc5bf5bb9c (patch)
tree676aa1a36122af179ce424eaed6441d055e867a6
parent443c3f73321d18d0092b11390e628e3de9d15d7c (diff)
Linux 3.14 compat: posix_acl_{create,chmod}
posix_acl_{create,chmod} is changed to __posix_acl_{create_chmod} Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #2124
-rw-r--r--config/kernel-acl.m416
-rw-r--r--include/linux/vfs_compat.h11
-rw-r--r--module/zfs/zpl_xattr.c4
3 files changed, 26 insertions, 5 deletions
diff --git a/config/kernel-acl.m4 b/config/kernel-acl.m4
index e9a254780..a03ee5bff 100644
--- a/config/kernel-acl.m4
+++ b/config/kernel-acl.m4
@@ -44,6 +44,9 @@ dnl # 3.1 API change,
dnl # posix_acl_chmod_masq() is not exported anymore and posix_acl_chmod()
dnl # was introduced to replace it.
dnl #
+dnl # 3.14 API change,
+dnl # posix_acl_chmod() is changed to __posix_acl_chmod()
+dnl #
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
AC_MSG_CHECKING([whether posix_acl_chmod exists])
ZFS_LINUX_TRY_COMPILE([
@@ -57,6 +60,19 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
],[
AC_MSG_RESULT(no)
])
+
+ AC_MSG_CHECKING([whether __posix_acl_chmod exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ #include <linux/posix_acl.h>
+ ],[
+ __posix_acl_chmod(NULL, 0, 0)
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1, [__posix_acl_chmod() exists])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
])
dnl #
diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h
index 4778491fa..4358cd288 100644
--- a/include/linux/vfs_compat.h
+++ b/include/linux/vfs_compat.h
@@ -263,9 +263,13 @@ zpl_forget_cached_acl(struct inode *ip, int type) {
#define zpl_inode_owner_or_capable(ip) is_owner_or_cap(ip)
#endif /* HAVE_INODE_OWNER_OR_CAPABLE */
-#ifndef HAVE_POSIX_ACL_CHMOD
+#ifndef HAVE___POSIX_ACL_CHMOD
+#ifdef HAVE_POSIX_ACL_CHMOD
+#define __posix_acl_chmod(acl, gfp, mode) posix_acl_chmod(acl, gfp, mode)
+#define __posix_acl_create(acl, gfp, mode) posix_acl_create(acl, gfp, mode)
+#else
static inline int
-posix_acl_chmod(struct posix_acl **acl, int flags, umode_t umode) {
+__posix_acl_chmod(struct posix_acl **acl, int flags, umode_t umode) {
struct posix_acl *oldacl = *acl;
mode_t mode = umode;
int error;
@@ -286,7 +290,7 @@ posix_acl_chmod(struct posix_acl **acl, int flags, umode_t umode) {
}
static inline int
-posix_acl_create(struct posix_acl **acl, int flags, umode_t *umodep) {
+__posix_acl_create(struct posix_acl **acl, int flags, umode_t *umodep) {
struct posix_acl *oldacl = *acl;
mode_t mode = *umodep;
int error;
@@ -308,6 +312,7 @@ posix_acl_create(struct posix_acl **acl, int flags, umode_t *umodep) {
return (error);
}
#endif /* HAVE_POSIX_ACL_CHMOD */
+#endif /* HAVE___POSIX_ACL_CHMOD */
#ifndef HAVE_CURRENT_UMASK
static inline int
diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c
index 9334ae7d1..c5c15a2dd 100644
--- a/module/zfs/zpl_xattr.c
+++ b/module/zfs/zpl_xattr.c
@@ -924,7 +924,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
}
mode = ip->i_mode;
- error = posix_acl_create(&acl, GFP_KERNEL, &mode);
+ error = __posix_acl_create(&acl, GFP_KERNEL, &mode);
if (error >= 0) {
ip->i_mode = mode;
mark_inode_dirty(ip);
@@ -954,7 +954,7 @@ zpl_chmod_acl(struct inode *ip)
if (IS_ERR(acl) || !acl)
return (PTR_ERR(acl));
- error = posix_acl_chmod(&acl, GFP_KERNEL, ip->i_mode);
+ error = __posix_acl_chmod(&acl, GFP_KERNEL, ip->i_mode);
if (!error)
error = zpl_set_acl(ip, ACL_TYPE_ACCESS, acl);