The branch stable/14 has been updated by zlei:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=611d52a1969892e5d35d5f26ad850a56f351a78e

commit 611d52a1969892e5d35d5f26ad850a56f351a78e
Author:     Zhenlei Huang <zlei.hu...@gmail.com>
AuthorDate: 2024-05-30 16:58:20 +0000
Commit:     Zhenlei Huang <z...@freebsd.org>
CommitDate: 2024-09-20 10:03:36 +0000

    zfs: cherry-pick change from openzfs
    
    Vendor PR:
      #16210 FreeBSD: Add const qualifier to members of struct
             opensolaris_utsname
    
    Obtained from:  OpenZFS
    OpenZFS commit: e2357561b9499296bff758afe4868dbc39735675
    
    Note: this is required by the following up MFC [1]. No functional change.
    
    1. 356be1348dac kernel: Make some compile time constant variables const
---
 sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h | 10 +++++-----
 sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c  |  7 +++----
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h 
b/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h
index 2e4efc60544a..894ccd8bf9b1 100644
--- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h
+++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/misc.h
@@ -45,11 +45,11 @@
 #define        F_SEEK_HOLE     FIOSEEKHOLE
 
 struct opensolaris_utsname {
-       char    *sysname;
-       char    *nodename;
-       char    *release;
-       char    version[32];
-       char    *machine;
+       const char      *sysname;
+       const char      *nodename;
+       const char      *release;
+       char            version[32];
+       const char      *machine;
 };
 
 #define        task_io_account_read(n)
diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c 
b/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c
index e3653167323b..10d3a7772b11 100644
--- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c
+++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_misc.c
@@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/zfs_context.h>
 
 static struct opensolaris_utsname hw_utsname = {
+       .sysname = ostype,
+       .nodename = prison0.pr_hostname,
+       .release = osrelease,
        .machine = MACHINE
 };
 
@@ -52,10 +55,6 @@ utsname(void)
 static void
 opensolaris_utsname_init(void *arg)
 {
-
-       hw_utsname.sysname = ostype;
-       hw_utsname.nodename = prison0.pr_hostname;
-       hw_utsname.release = osrelease;
        snprintf(hw_utsname.version, sizeof (hw_utsname.version),
            "%d", osreldate);
 }

Reply via email to