diff options
Diffstat (limited to 'sys/vm')
| -rw-r--r-- | sys/vm/swap_pager.c | 27 | ||||
| -rw-r--r-- | sys/vm/vm_object.c | 3 | ||||
| -rw-r--r-- | sys/vm/vm_param.h | 2 |
3 files changed, 30 insertions, 2 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 76b69e5053e9..2a73acaad666 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -69,6 +69,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_swap.h" #include "opt_vm.h" @@ -2417,10 +2418,24 @@ swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len) return (error); } +#if defined(COMPAT_FREEBSD11) +#define XSWDEV_VERSION_11 1 +struct xswdev11 { + u_int xsw_version; + uint32_t xsw_dev; + int xsw_flags; + int xsw_nblks; + int xsw_used; +}; +#endif + static int sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) { struct xswdev xs; +#if defined(COMPAT_FREEBSD11) + struct xswdev11 xs11; +#endif int error; if (arg2 != 1) /* name length */ @@ -2428,7 +2443,17 @@ sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) error = swap_dev_info(*(int *)arg1, &xs, NULL, 0); if (error != 0) return (error); - error = SYSCTL_OUT(req, &xs, sizeof(xs)); +#if defined(COMPAT_FREEBSD11) + if (req->oldlen == sizeof(xs11)) { + xs11.xsw_version = XSWDEV_VERSION_11; + xs11.xsw_dev = xs.xsw_dev; /* truncation */ + xs11.xsw_flags = xs.xsw_flags; + xs11.xsw_nblks = xs.xsw_nblks; + xs11.xsw_used = xs.xsw_used; + error = SYSCTL_OUT(req, &xs11, sizeof(xs11)); + } else +#endif + error = SYSCTL_OUT(req, &xs, sizeof(xs)); return (error); } diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 022fbd57c882..a751ac6ea2ff 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2342,6 +2342,7 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) kvo.kvo_vn_fileid = 0; kvo.kvo_vn_fsid = 0; + kvo.kvo_vn_fsid_freebsd11 = 0; freepath = NULL; fullpath = ""; vp = NULL; @@ -2383,6 +2384,8 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) if (VOP_GETATTR(vp, &va, curthread->td_ucred) == 0) { kvo.kvo_vn_fileid = va.va_fileid; kvo.kvo_vn_fsid = va.va_fsid; + kvo.kvo_vn_fsid_freebsd11 = va.va_fsid; + /* truncate */ } vput(vp); } diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h index c4d72237fd40..8ca83bf18ddf 100644 --- a/sys/vm/vm_param.h +++ b/sys/vm/vm_param.h @@ -89,7 +89,7 @@ /* * Structure for swap device statistics */ -#define XSWDEV_VERSION 1 +#define XSWDEV_VERSION 2 struct xswdev { u_int xsw_version; dev_t xsw_dev; |
