Date: Sun, 17 Feb 2019 09:56:12 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r344228 - stable/12/sys/vm Message-ID: <201902170956.x1H9uC6E028915@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Feb 17 09:56:11 2019 New Revision: 344228 URL: https://svnweb.freebsd.org/changeset/base/344228 Log: MFC r343966: struct xswdev on amd64 requires compat32 shims after ino64. Modified: stable/12/sys/vm/swap_pager.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/swap_pager.c ============================================================================== --- stable/12/sys/vm/swap_pager.c Sun Feb 17 03:52:44 2019 (r344227) +++ stable/12/sys/vm/swap_pager.c Sun Feb 17 09:56:11 2019 (r344228) @@ -2475,10 +2475,23 @@ struct xswdev11 { }; #endif +#if defined(__amd64__) && defined(COMPAT_FREEBSD32) +struct xswdev32 { + u_int xsw_version; + u_int xsw_dev1, xsw_dev2; + int xsw_flags; + int xsw_nblks; + int xsw_used; +}; +#endif + static int sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) { struct xswdev xs; +#if defined(__amd64__) && defined(COMPAT_FREEBSD32) + struct xswdev32 xs32; +#endif #if defined(COMPAT_FREEBSD11) struct xswdev11 xs11; #endif @@ -2489,6 +2502,18 @@ sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) error = swap_dev_info(*(int *)arg1, &xs, NULL, 0); if (error != 0) return (error); +#if defined(__amd64__) && defined(COMPAT_FREEBSD32) + if (req->oldlen == sizeof(xs32)) { + xs32.xsw_version = XSWDEV_VERSION; + xs32.xsw_dev1 = xs.xsw_dev; + xs32.xsw_dev2 = xs.xsw_dev >> 32; + xs32.xsw_flags = xs.xsw_flags; + xs32.xsw_nblks = xs.xsw_nblks; + xs32.xsw_used = xs.xsw_used; + error = SYSCTL_OUT(req, &xs32, sizeof(xs32)); + return (error); + } +#endif #if defined(COMPAT_FREEBSD11) if (req->oldlen == sizeof(xs11)) { xs11.xsw_version = XSWDEV_VERSION_11; @@ -2497,9 +2522,10 @@ sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) xs11.xsw_nblks = xs.xsw_nblks; xs11.xsw_used = xs.xsw_used; error = SYSCTL_OUT(req, &xs11, sizeof(xs11)); - } else + return (error); + } #endif - error = SYSCTL_OUT(req, &xs, sizeof(xs)); + error = SYSCTL_OUT(req, &xs, sizeof(xs)); return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902170956.x1H9uC6E028915>