forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor inode_owner_or_capable() autotools check
We need inode_owner_or_capable() for ZFS file attributes in addition to xattrs, so it should go into its own file. This moves it into its own file and changes it to be more comprehensive. It will now fail if no known good API is detected. Signed-off-by: Richard Yao <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
dnl # | ||
dnl # 2.6.39 API change, | ||
dnl # The is_owner_or_cap() macro was renamed to inode_owner_or_capable(), | ||
dnl # This is used for permission checks in the xattr and file attribute call | ||
dnl # paths. | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [ | ||
AC_MSG_CHECKING([whether inode_owner_or_capable() exists]) | ||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/fs.h> | ||
],[ | ||
struct inode *ip = NULL; | ||
inode_owner_or_capable(ip); | ||
],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1, [inode_owner_or_capable() exists]) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
],[ | ||
AC_MSG_RESULT(no) | ||
AC_MSG_CHECKING([whether is_owner_or_cap() exists]) | ||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/fs.h> | ||
],[ | ||
struct inode *ip = NULL; | ||
is_owner_or_cap(ip); | ||
],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_IS_OWNER_OR_CAP, 1, [is_owner_or_cap() exists]) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
],[ | ||
AC_MSG_ERROR(no; file a bug report with ZFSOnLinux) | ||
This comment has been minimized.
Sorry, something went wrong.
behlendorf
|
||
]) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mind the 80 char limit.