Skip to content

Commit

Permalink
Revert "Linux 6.5 compat: register_sysctl_table removed"
Browse files Browse the repository at this point in the history
This reverts commit b35374f as there
are error messages when loading the SPL module. Errors seemed to be tied
to duplicate a duplicate entry.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Brian Atkinson <batkinson@lanl.gov>
Closes #15134
  • Loading branch information
bwatkinson authored Aug 1, 2023
1 parent 12373b0 commit a5fdba1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 52 deletions.
27 changes: 0 additions & 27 deletions config/kernel-register_sysctl_table.m4

This file was deleted.

2 changes: 0 additions & 2 deletions config/kernel.m4
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
ZFS_AC_KERNEL_SRC_FILEMAP
ZFS_AC_KERNEL_SRC_WRITEPAGE_T
ZFS_AC_KERNEL_SRC_RECLAIMED
ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE
case "$host_cpu" in
powerpc*)
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
Expand Down Expand Up @@ -300,7 +299,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
ZFS_AC_KERNEL_FILEMAP
ZFS_AC_KERNEL_WRITEPAGE_T
ZFS_AC_KERNEL_RECLAIMED
ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE
case "$host_cpu" in
powerpc*)
ZFS_AC_KERNEL_CPU_HAS_FEATURE
Expand Down
26 changes: 3 additions & 23 deletions module/os/linux/spl/spl-proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ static struct ctl_table spl_table[] = {
.mode = 0644,
.proc_handler = &proc_dohostid,
},
#ifdef HAVE_REGISTER_SYSCTL_TABLE
{
.procname = "kmem",
.mode = 0555,
Expand All @@ -635,11 +634,9 @@ static struct ctl_table spl_table[] = {
.mode = 0555,
.child = spl_kstat_table,
},
#endif
{},
};

#ifdef HAVE_REGISTER_SYSCTL_TABLE
static struct ctl_table spl_dir[] = {
{
.procname = "spl",
Expand All @@ -651,38 +648,21 @@ static struct ctl_table spl_dir[] = {

static struct ctl_table spl_root[] = {
{
.procname = "kernel",
.mode = 0555,
.child = spl_dir,
.procname = "kernel",
.mode = 0555,
.child = spl_dir,
},
{}
};
#endif

int
spl_proc_init(void)
{
int rc = 0;

#ifdef HAVE_REGISTER_SYSCTL_TABLE
spl_header = register_sysctl_table(spl_root);
if (spl_header == NULL)
return (-EUNATCH);
#else
spl_header = register_sysctl("kernel/spl", spl_table);
if (spl_header == NULL)
return (-EUNATCH);

if (register_sysctl("kernel/spl/kmem", spl_kmem_table) == NULL) {
rc = -EUNATCH;
goto out;
}

if (register_sysctl("kernel/spl/kstat", spl_kstat_table) == NULL) {
rc = -EUNATCH;
goto out;
}
#endif

proc_spl = proc_mkdir("spl", NULL);
if (proc_spl == NULL) {
Expand Down

0 comments on commit a5fdba1

Please sign in to comment.