CVS commit: src/libexec/lfs_cleanerd

2019-08-31 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Aug 31 07:49:48 UTC 2019

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.8

Log Message:
New sentence, new line. Punctuation improvements.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/libexec/lfs_cleanerd/lfs_cleanerd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/libexec/lfs_cleanerd

2019-08-31 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Aug 31 07:49:48 UTC 2019

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.8

Log Message:
New sentence, new line. Punctuation improvements.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/libexec/lfs_cleanerd/lfs_cleanerd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/lfs_cleanerd/lfs_cleanerd.8
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.19 src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.20
--- src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.19	Fri Aug 30 23:37:23 2019
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.8	Sat Aug 31 07:49:48 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: lfs_cleanerd.8,v 1.19 2019/08/30 23:37:23 brad Exp $
+.\"	$NetBSD: lfs_cleanerd.8,v 1.20 2019/08/31 07:49:48 wiz Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -98,9 +98,9 @@ This option is used by
 and should not be specified on the command line.
 .It Fl J Ar raw device
 Specify the raw device that the cleaner is to work against rather than
-trying to figure it out from the mount point.  This is mostly useful
-when the cleaner is compiled into
-.Xr rump_lfs 8 ,
+trying to figure it out from the mount point.
+This is mostly useful when the cleaner is compiled into
+.Xr rump_lfs 8
 and the ATF test framework.
 .It Fl l Ar load-threshhold
 Clean more aggressively when the system load is below the given threshhold.
@@ -122,11 +122,11 @@ Give an efficiency report after every
 times through the main loop.
 .It Fl S Ar semaphore address
 When the cleaner code is compiled into
-.Xr rump_lfs 8 ,
+.Xr rump_lfs 8
 and the ATF frame work, this option allows for a synchronization
-semaphore to be specified.  This option is not available in the
-stand alone
-.Xr lfs_cleanerd 8 .
+semaphore to be specified.
+This option is not available in the stand-alone
+.Nm .
 .It Fl s
 When cleaning the file system,
 send only a few blocks through lfs_markv at a time.
@@ -148,7 +148,7 @@ to a low value.
 .Xr lfs_markv 2 ,
 .Xr lfs_segwait 2 ,
 .Xr mount_lfs 8 ,
-.Xr rump_lfs 8 .
+.Xr rump_lfs 8
 .Sh HISTORY
 The
 .Nm



CVS commit: src/libexec/lfs_cleanerd

2019-08-30 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Fri Aug 30 23:37:23 UTC 2019

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.8 lfs_cleanerd.c

Log Message:
Add support for passing the raw device name separate from the
filesystem.  This is useful in the case where the cleaner is compiled
into code, such as rump_lfs and the ATF tests.  This helps to fix
bin/54488


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/libexec/lfs_cleanerd/lfs_cleanerd.8
cvs rdiff -u -r1.59 -r1.60 src/libexec/lfs_cleanerd/lfs_cleanerd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/lfs_cleanerd/lfs_cleanerd.8
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.18 src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.19
--- src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.18	Thu Aug  6 21:18:54 2009
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.8	Fri Aug 30 23:37:23 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: lfs_cleanerd.8,v 1.18 2009/08/06 21:18:54 wiz Exp $
+.\"	$NetBSD: lfs_cleanerd.8,v 1.19 2019/08/30 23:37:23 brad Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -39,9 +39,11 @@
 .Nm
 .Op Fl bcDdfmqs
 .Op Fl i Ar segment-number
+.Op Fl J Ar raw-device
 .Op Fl l Ar load-threshhold
 .Op Fl n Ar number-of-segments
 .Op Fl r Ar report-frequency
+.Op Fl S Ar semaphore-address
 .Op Fl t Ar timeout
 .Pa node
 .Sh DESCRIPTION
@@ -94,6 +96,12 @@ Invalidate the segment with segment numb
 This option is used by
 .Xr resize_lfs 8 ,
 and should not be specified on the command line.
+.It Fl J Ar raw device
+Specify the raw device that the cleaner is to work against rather than
+trying to figure it out from the mount point.  This is mostly useful
+when the cleaner is compiled into
+.Xr rump_lfs 8 ,
+and the ATF test framework.
 .It Fl l Ar load-threshhold
 Clean more aggressively when the system load is below the given threshhold.
 The default threshhold is 0.2.
@@ -112,6 +120,13 @@ Quit after cleaning once.
 Give an efficiency report after every
 .Ar report-frequency
 times through the main loop.
+.It Fl S Ar semaphore address
+When the cleaner code is compiled into
+.Xr rump_lfs 8 ,
+and the ATF frame work, this option allows for a synchronization
+semaphore to be specified.  This option is not available in the
+stand alone
+.Xr lfs_cleanerd 8 .
 .It Fl s
 When cleaning the file system,
 send only a few blocks through lfs_markv at a time.
@@ -132,7 +147,8 @@ to a low value.
 .Xr lfs_bmapv 2 ,
 .Xr lfs_markv 2 ,
 .Xr lfs_segwait 2 ,
-.Xr mount_lfs 8
+.Xr mount_lfs 8 ,
+.Xr rump_lfs 8 .
 .Sh HISTORY
 The
 .Nm

Index: src/libexec/lfs_cleanerd/lfs_cleanerd.c
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.59 src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.60
--- src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.59	Thu Aug 22 20:28:08 2019
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.c	Fri Aug 30 23:37:23 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_cleanerd.c,v 1.59 2019/08/22 20:28:08 brad Exp $	 */
+/* $NetBSD: lfs_cleanerd.c,v 1.60 2019/08/30 23:37:23 brad Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -76,6 +76,7 @@ int segwait_timeout;	/* Time to wait in 
 int do_quit;		/* Quit after one cleaning loop */
 int do_coalesce;	/* Coalesce filesystem */
 int do_small;		/* Use small writes through markv */
+char *do_asdevice;  /* Use this as the raw device */
 char *copylog_filename; /* File to use for fs debugging analysis */
 int inval_segment;	/* Segment to invalidate */
 int stat_report;	/* Report statistics for this period of cycles */
@@ -165,7 +166,7 @@ init_unmounted_fs(struct clfs *fs, char 
 {
 	struct lfs *disc_fs;
 	int i;
-	
+
 	fs->clfs_dev = fsname;
 	if ((fs->clfs_devfd = kops.ko_open(fs->clfs_dev, O_RDWR)) < 0) {
 		syslog(LOG_ERR, "couldn't open device %s read/write",
@@ -215,26 +216,34 @@ init_fs(struct clfs *fs, char *fsname)
 	void *sbuf;
 	size_t mlen;
 
-	/*
-	 * Get the raw device from the block device.
-	 * XXX this is ugly.  Is there a way to discover the raw device
-	 * XXX for a given mount point?
-	 */
-	if (kops.ko_statvfs(fsname, &sf, ST_WAIT) < 0)
-		return -1;
-	mlen = strlen(sf.f_mntfromname) + 2;
-	fs->clfs_dev = malloc(mlen);
-	if (fs->clfs_dev == NULL) {
-		syslog(LOG_ERR, "couldn't malloc device name string: %m");
-		return -1;
-	}
-	if (getdiskrawname(fs->clfs_dev, mlen, sf.f_mntfromname) == NULL) {
-		syslog(LOG_ERR, "couldn't convert '%s' ro raw name: %m",
-		sf.f_mntfromname);
-		return -1;
+	if (do_asdevice != NULL) {
+		fs->clfs_dev = strndup(do_asdevice,strlen(do_asdevice) + 2);
+		if (fs->clfs_dev == NULL) {
+			syslog(LOG_ERR, "couldn't malloc device name string: %m");
+			return -1;
+		}
+	} else {
+		/*
+		 * Get the raw device from the block device.
+		 * XXX this is ugly.  Is there a way to discover the raw device
+		 * XXX for a given mount point?
+		 */
+		if (kops.ko_statvfs(fsname, &sf, ST_WAIT) < 0)
+			return -

CVS commit: src/libexec/lfs_cleanerd

2019-08-30 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Fri Aug 30 23:37:23 UTC 2019

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.8 lfs_cleanerd.c

Log Message:
Add support for passing the raw device name separate from the
filesystem.  This is useful in the case where the cleaner is compiled
into code, such as rump_lfs and the ATF tests.  This helps to fix
bin/54488


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/libexec/lfs_cleanerd/lfs_cleanerd.8
cvs rdiff -u -r1.59 -r1.60 src/libexec/lfs_cleanerd/lfs_cleanerd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/libexec/lfs_cleanerd

2019-08-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Aug 22 20:28:08 UTC 2019

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.c

Log Message:
Use getdiskrawname to find the device name

Reviewed by Christos


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/libexec/lfs_cleanerd/lfs_cleanerd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/libexec/lfs_cleanerd

2019-08-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Aug 22 20:28:08 UTC 2019

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.c

Log Message:
Use getdiskrawname to find the device name

Reviewed by Christos


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/libexec/lfs_cleanerd/lfs_cleanerd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/lfs_cleanerd/lfs_cleanerd.c
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.58 src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.59
--- src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.58	Fri Mar 18 10:10:21 2016
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.c	Thu Aug 22 20:28:08 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_cleanerd.c,v 1.58 2016/03/18 10:10:21 mrg Exp $	 */
+/* $NetBSD: lfs_cleanerd.c,v 1.59 2019/08/22 20:28:08 brad Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -213,7 +213,7 @@ init_fs(struct clfs *fs, char *fsname)
 	int rootfd;
 	int i;
 	void *sbuf;
-	char *bn;
+	size_t mlen;
 
 	/*
 	 * Get the raw device from the block device.
@@ -222,16 +222,17 @@ init_fs(struct clfs *fs, char *fsname)
 	 */
 	if (kops.ko_statvfs(fsname, &sf, ST_WAIT) < 0)
 		return -1;
-	fs->clfs_dev = malloc(strlen(sf.f_mntfromname) + 2);
+	mlen = strlen(sf.f_mntfromname) + 2;
+	fs->clfs_dev = malloc(mlen);
 	if (fs->clfs_dev == NULL) {
 		syslog(LOG_ERR, "couldn't malloc device name string: %m");
 		return -1;
 	}
-	bn = strrchr(sf.f_mntfromname, '/');
-	bn = bn ? bn+1 : sf.f_mntfromname;
-	strlcpy(fs->clfs_dev, sf.f_mntfromname, bn - sf.f_mntfromname + 1);
-	strcat(fs->clfs_dev, "r");
-	strcat(fs->clfs_dev, bn);
+	if (getdiskrawname(fs->clfs_dev, mlen, sf.f_mntfromname) == NULL) {
+		syslog(LOG_ERR, "couldn't convert '%s' ro raw name: %m",
+		sf.f_mntfromname);
+		return -1;
+	}
 	if ((fs->clfs_devfd = kops.ko_open(fs->clfs_dev, O_RDONLY, 0)) < 0) {
 		syslog(LOG_ERR, "couldn't open device %s for reading",
 			fs->clfs_dev);



CVS commit: src/libexec/lfs_cleanerd

2010-02-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Feb 16 23:13:13 UTC 2010

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.c

Log Message:
Read the padded superblocks to avoid problems with disks that have
larger sectors than 512 Bytes.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/libexec/lfs_cleanerd/lfs_cleanerd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.