CVS commit: src/sbin/swapctl
Module Name:src Committed By: pgoyette Date: Mon Jul 8 09:23:51 UTC 2024 Modified Files: src/sbin/swapctl: swapctl.8 Log Message: s/point mount/mount point/ To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sbin/swapctl/swapctl.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/swapctl/swapctl.8 diff -u src/sbin/swapctl/swapctl.8:1.45 src/sbin/swapctl/swapctl.8:1.46 --- src/sbin/swapctl/swapctl.8:1.45 Sun Feb 4 05:43:06 2024 +++ src/sbin/swapctl/swapctl.8 Mon Jul 8 09:23:50 2024 @@ -1,4 +1,4 @@ -.\" $NetBSD: swapctl.8,v 1.45 2024/02/04 05:43:06 mrg Exp $ +.\" $NetBSD: swapctl.8,v 1.46 2024/07/08 09:23:50 pgoyette Exp $ .\" .\" Copyright (c) 1997 Matthew R. Green .\" All rights reserved. @@ -316,7 +316,7 @@ This option is useful for swapping to NF It specifies the local mount point to mount an NFS filesystem. The mount point must exist as a directory. Typically, once this mount has succeeded, the file to be used for swapping -on will be available under this point mount. +on will be available under this mount point. For example: .Bd -literal server:/export/swap/client none swap sw,nfsmntpt=/swap
CVS commit: src/sbin/swapctl
Module Name:src Committed By: pgoyette Date: Mon Jul 8 09:23:51 UTC 2024 Modified Files: src/sbin/swapctl: swapctl.8 Log Message: s/point mount/mount point/ To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sbin/swapctl/swapctl.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/swapctl
Module Name:src Committed By: mlelstv Date: Mon Dec 11 12:47:24 UTC 2023 Modified Files: src/sbin/swapctl: swaplist.c Log Message: Avoid overflow of totals. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sbin/swapctl/swaplist.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/swapctl/swaplist.c diff -u src/sbin/swapctl/swaplist.c:1.18 src/sbin/swapctl/swaplist.c:1.19 --- src/sbin/swapctl/swaplist.c:1.18 Tue May 31 09:34:25 2016 +++ src/sbin/swapctl/swaplist.c Mon Dec 11 12:47:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: swaplist.c,v 1.18 2016/05/31 09:34:25 pgoyette Exp $ */ +/* $NetBSD: swaplist.c,v 1.19 2023/12/11 12:47:24 mlelstv Exp $ */ /* * Copyright (c) 1997 Matthew R. Green @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: swaplist.c,v 1.18 2016/05/31 09:34:25 pgoyette Exp $"); +__RCSID("$NetBSD: swaplist.c,v 1.19 2023/12/11 12:47:24 mlelstv Exp $"); #endif @@ -61,8 +61,9 @@ list_swap(int pri, int kflag, int pflag, char szbuf[5], usbuf[5], avbuf[5]; /* size, used, avail */ const char *header, *suff; size_t l; - int hlen, totalsize, size, totalinuse, inuse, ncounted, pathmax; + int hlen, size, inuse, ncounted, pathmax; int rnswap, nswap = swapctl(SWAP_NSWAP, 0, 0), i; + int64_t totalsize, totalinuse; if (nswap < 1) { puts("no swap devices configured");
CVS commit: src/sbin/swapctl
Module Name:src Committed By: mlelstv Date: Mon Dec 11 12:47:24 UTC 2023 Modified Files: src/sbin/swapctl: swaplist.c Log Message: Avoid overflow of totals. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sbin/swapctl/swaplist.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/swapctl
Module Name:src Committed By: kre Date: Wed Mar 1 15:18:18 UTC 2023 Modified Files: src/sbin/swapctl: swapctl.c Log Message: Fix a typo in a newly added comment. Someone please tell me why these things become obvious only after the code has been committed! NFC To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sbin/swapctl/swapctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/swapctl/swapctl.c diff -u src/sbin/swapctl/swapctl.c:1.42 src/sbin/swapctl/swapctl.c:1.43 --- src/sbin/swapctl/swapctl.c:1.42 Wed Mar 1 15:15:56 2023 +++ src/sbin/swapctl/swapctl.c Wed Mar 1 15:18:18 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: swapctl.c,v 1.42 2023/03/01 15:15:56 kre Exp $ */ +/* $NetBSD: swapctl.c,v 1.43 2023/03/01 15:18:18 kre Exp $ */ /* * Copyright (c) 1996, 1997, 1999, 2015 Matthew R. Green @@ -64,7 +64,7 @@ #include #ifndef lint -__RCSID("$NetBSD: swapctl.c,v 1.42 2023/03/01 15:15:56 kre Exp $"); +__RCSID("$NetBSD: swapctl.c,v 1.43 2023/03/01 15:18:18 kre Exp $"); #endif @@ -734,7 +734,7 @@ do_fstab(int add) char *spec, *fsspec; /* - * Ignore any ewtries which are not related to swapping + * Ignore any entries which are not related to swapping */ if (strcmp(fp->fs_type, "sw") != 0 && strcmp(fp->fs_type, "dp") != 0)
CVS commit: src/sbin/swapctl
Module Name:src Committed By: kre Date: Wed Mar 1 15:18:18 UTC 2023 Modified Files: src/sbin/swapctl: swapctl.c Log Message: Fix a typo in a newly added comment. Someone please tell me why these things become obvious only after the code has been committed! NFC To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sbin/swapctl/swapctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/swapctl
Module Name:src Committed By: kre Date: Wed Mar 1 15:15:56 UTC 2023 Modified Files: src/sbin/swapctl: swapctl.c Log Message: When processing swapon -a (or swapctl -A, or swapctl -U) ignore lines in fstab that have nothing to do with swapping (fs_type is neither "sw" nor "dp") before running getfsspecname() on the fs_spec field of the line. This avoids entries like this: NAME=OFTEN_UNCONNECTED /local/archived ffs rw,log,noauto0 0 in fstab from generating spurious error messages when the wedge named is not currently connected to the system - that is the drive on which the wedge exists is not connected, or not powered on. "noauto" handles that for some other uses, the "0"s in fs_freq and fs_passno work for other uses, but swap{on,ctl} never look at those fields (not for this purpose). Non "sw"/"dp" lines were being ignored anyway, but not until (a little) later. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sbin/swapctl/swapctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/swapctl/swapctl.c diff -u src/sbin/swapctl/swapctl.c:1.41 src/sbin/swapctl/swapctl.c:1.42 --- src/sbin/swapctl/swapctl.c:1.41 Mon Apr 4 19:33:44 2022 +++ src/sbin/swapctl/swapctl.c Wed Mar 1 15:15:56 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: swapctl.c,v 1.41 2022/04/04 19:33:44 andvar Exp $ */ +/* $NetBSD: swapctl.c,v 1.42 2023/03/01 15:15:56 kre Exp $ */ /* * Copyright (c) 1996, 1997, 1999, 2015 Matthew R. Green @@ -64,7 +64,7 @@ #include #ifndef lint -__RCSID("$NetBSD: swapctl.c,v 1.41 2022/04/04 19:33:44 andvar Exp $"); +__RCSID("$NetBSD: swapctl.c,v 1.42 2023/03/01 15:15:56 kre Exp $"); #endif @@ -733,6 +733,13 @@ do_fstab(int add) char buf[MAXPATHLEN]; char *spec, *fsspec; + /* + * Ignore any ewtries which are not related to swapping + */ + if (strcmp(fp->fs_type, "sw") != 0 && + strcmp(fp->fs_type, "dp") != 0) + continue; + if (getfsspecname(buf, sizeof(buf), fp->fs_spec) == NULL) { warn("%s", buf); continue; @@ -745,9 +752,6 @@ do_fstab(int add) continue; } - if (strcmp(fp->fs_type, "sw") != 0) - continue; - /* handle dp as mnt option */ if (strstr(fp->fs_mntops, "dp") && add) set_dumpdev1(spec);
CVS commit: src/sbin/swapctl
Module Name:src Committed By: kre Date: Wed Mar 1 15:15:56 UTC 2023 Modified Files: src/sbin/swapctl: swapctl.c Log Message: When processing swapon -a (or swapctl -A, or swapctl -U) ignore lines in fstab that have nothing to do with swapping (fs_type is neither "sw" nor "dp") before running getfsspecname() on the fs_spec field of the line. This avoids entries like this: NAME=OFTEN_UNCONNECTED /local/archived ffs rw,log,noauto0 0 in fstab from generating spurious error messages when the wedge named is not currently connected to the system - that is the drive on which the wedge exists is not connected, or not powered on. "noauto" handles that for some other uses, the "0"s in fs_freq and fs_passno work for other uses, but swap{on,ctl} never look at those fields (not for this purpose). Non "sw"/"dp" lines were being ignored anyway, but not until (a little) later. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sbin/swapctl/swapctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.