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.
Linux 5.18 compat: kobj_type.default_attrs replaced with default_groups
Upstream-commit: cdb4f26a63c391317e335e6e683a614358e70aeb ("kobject: kobj_type: remove default_attrs") Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#13357
- Loading branch information
1 parent
46e8279
commit 3836868
Showing
3 changed files
with
61 additions
and
17 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,37 @@ | ||
dnl # | ||
dnl # Linux 5.2/5.18 API | ||
dnl # | ||
dnl # In cdb4f26a63c391317e335e6e683a614358e70aeb ("kobject: kobj_type: remove default_attrs") | ||
dnl # struct kobj_type.default_attrs | ||
dnl # was finally removed in favour of | ||
dnl # struct kobj_type.default_groups | ||
dnl # | ||
dnl # This was added in aa30f47cf666111f6bbfd15f290a27e8a7b9d854 ("kobject: Add support for default attribute groups to kobj_type"), | ||
dnl # if both are present (5.2-5.17), we prefer default_groups; they're otherwise equivalent | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SYSFS_DEFAULT_GROUPS], [ | ||
ZFS_LINUX_TEST_SRC([sysfs_default_groups], [ | ||
#include <linux/kobject.h> | ||
],[ | ||
struct kobj_type __attribute__ ((unused)) kt = { | ||
.default_groups = (const struct attribute_group **)NULL }; | ||
]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_SYSFS_DEFAULT_GROUPS], [ | ||
AC_MSG_CHECKING([for struct kobj_type.default_groups]) | ||
ZFS_LINUX_TEST_RESULT([sysfs_default_groups],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE([HAVE_SYSFS_DEFAULT_GROUPS], 1, [struct kobj_type has default_groups]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SYSFS], [ | ||
ZFS_AC_KERNEL_SRC_SYSFS_DEFAULT_GROUPS | ||
]) | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_SYSFS], [ | ||
ZFS_AC_KERNEL_SYSFS_DEFAULT_GROUPS | ||
]) |
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