-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux 4.11 compat: iops.getattr and friends
In torvalds/linux@a528d35, there are several changes to the getattr family of functions, struct kstat, and the interface of inode_operations .getattr. The inode_operations .getattr interface changed to: int (*getattr) (const struct path *, struct dentry *, struct kstat *, u32 request_mask, unsigned int query_flags) The request_mask argument indicates which field(s) the caller intends to use. Fields the caller has not specified via request_mask may be set in he returned struct anyway, but their values may be approximate. The query_flags argument indicates whether the filesystem must update the attributes from the backing store. Currently both fields are ignored. struct kstat includes new fields: u32 result_mask; /* What fields the user got */ u64 attributes; /* See STATX_ATTR_* flags */ struct timespec btime; /* File creation time */ XXX result_mask is set but may be incorrect. attributes and btime are not set by zfs, may need to be. The interface to simple_getattr() has changed to: int simple_getattr(const struct path *, struct kstat *, u32, unsigned int); Requires-spl: refs/pull/608/head Requires-builders: distro Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
- Loading branch information
Showing
4 changed files
with
140 additions
and
6 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,67 @@ | ||
dnl # | ||
dnl # Linux 4.11 API | ||
dnl # See torvalds/linux@a528d35 | ||
dnl # | ||
AC_DEFUN([ZFS_AC_4ARGS_KERNEL_IOPS_GETATTR], [ | ||
AC_MSG_CHECKING([whether iops->getattr() takes 4 arguments]) | ||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/fs.h> | ||
int test_getattr( | ||
const struct path *p, struct kstat *k, | ||
u32 request_mask, unsigned int query_flags) | ||
{ return 0; } | ||
static const struct inode_operations | ||
iops __attribute__ ((unused)) = { | ||
.getattr = test_getattr, | ||
}; | ||
],[ | ||
],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_4ARGS_IOPS_GETATTR, 1, | ||
[iops->getattr() takes 4 arguments]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) | ||
|
||
|
||
|
||
dnl # | ||
dnl # Linux 3.9 - 4.10 API | ||
dnl # | ||
AC_DEFUN([ZFS_AC_3ARGS_KERNEL_IOPS_GETATTR], [ | ||
AC_MSG_CHECKING([whether iops->getattr() takes 3 arguments]) | ||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/fs.h> | ||
int test_getattr( | ||
struct vfsmount *mnt, struct dentry *d, | ||
struct kstat *k) | ||
{ return 0; } | ||
static const struct inode_operations | ||
iops __attribute__ ((unused)) = { | ||
.getattr = test_getattr, | ||
}; | ||
],[ | ||
],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_3ARGS_IOPS_GETATTR, 1, | ||
[iops->getattr() takes 3 arguments]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) | ||
|
||
|
||
dnl # | ||
dnl # The interface of the getattr callback from the inode_operations | ||
dnl # structure changed. Also, the interface of the simple_getattr() | ||
dnl # function provided by the kernel changed. | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GETATTR], [ | ||
ZFS_AC_4ARGS_KERNEL_IOPS_GETATTR | ||
ZFS_AC_3ARGS_KERNEL_IOPS_GETATTR | ||
]) |
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
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
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