Date: Mon, 17 Feb 2020 15:11:07 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358026 - in head: lib/libkvm sys/vm Message-ID: <202002171511.01HFB7Z5080884@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Feb 17 15:11:07 2020 New Revision: 358026 URL: https://svnweb.freebsd.org/changeset/base/358026 Log: Remove swblk_t. It was used only to store the bounds of each swap device. However, since swblk_t is a signed 32-bit int and daddr_t is a signed 64-bit int, swp_pager_isondev() may return an invalid result if swap devices are repeatedly added and removed and sw_end for a device ends up becoming a negative number. Note that the removed comment about maximum swap size still applies. Reviewed by: jeff, kib Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23666 Modified: head/lib/libkvm/kvm_getswapinfo.c head/sys/vm/swap_pager.c head/sys/vm/swap_pager.h Modified: head/lib/libkvm/kvm_getswapinfo.c ============================================================================== --- head/lib/libkvm/kvm_getswapinfo.c Mon Feb 17 15:10:41 2020 (r358025) +++ head/lib/libkvm/kvm_getswapinfo.c Mon Feb 17 15:11:07 2020 (r358026) @@ -115,8 +115,7 @@ int kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int i; - swblk_t ttl; + int i, ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; struct kvm_swap tot; @@ -167,8 +166,7 @@ int kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int ti; - swblk_t ttl; + int ti, ttl; size_t mibi, len; int soid[SWI_MAXMIB]; struct xswdev xsd; Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Feb 17 15:10:41 2020 (r358025) +++ head/sys/vm/swap_pager.c Mon Feb 17 15:11:07 2020 (r358026) @@ -2334,7 +2334,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl sw_strategy_t *strategy, sw_close_t *close, dev_t dev, int flags) { struct swdevt *sp, *tsp; - swblk_t dvbase; + daddr_t dvbase; u_long mblocks; /* Modified: head/sys/vm/swap_pager.h ============================================================================== --- head/sys/vm/swap_pager.h Mon Feb 17 15:10:41 2020 (r358025) +++ head/sys/vm/swap_pager.h Mon Feb 17 15:11:07 2020 (r358026) @@ -38,14 +38,9 @@ */ #ifndef _VM_SWAP_PAGER_H_ -#define _VM_SWAP_PAGER_H_ 1 +#define _VM_SWAP_PAGER_H_ -typedef int32_t swblk_t; /* - * swap offset. This is the type used to - * address the "virtual swap device" and - * therefore the maximum swap space is - * 2^32 pages. - */ +#include <sys/_types.h> struct buf; struct swdevt; @@ -62,8 +57,8 @@ struct swdevt { dev_t sw_dev; struct vnode *sw_vp; void *sw_id; - swblk_t sw_first; - swblk_t sw_end; + __daddr_t sw_first; + __daddr_t sw_end; struct blist *sw_blist; TAILQ_ENTRY(swdevt) sw_list; sw_strategy_t *sw_strategy;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002171511.01HFB7Z5080884>