CVS commit: src/sbin/fsck_lfs

2018-06-12 Thread Zafer Aydogan
Module Name:src
Committed By:   zafer
Date:   Tue Jun 12 20:12:22 UTC 2018

Modified Files:
src/sbin/fsck_lfs: lfs.c

Log Message:
Remove duplicate assignments.
Fixes PR bin/51512 by Jose Luis Rodriguez Garcia


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sbin/fsck_lfs/lfs.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.73 src/sbin/fsck_lfs/lfs.c:1.74
--- src/sbin/fsck_lfs/lfs.c:1.73	Sat Jun 10 08:13:15 2017
+++ src/sbin/fsck_lfs/lfs.c	Tue Jun 12 20:12:21 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.73 2017/06/10 08:13:15 pgoyette Exp $ */
+/* $NetBSD: lfs.c,v 1.74 2018/06/12 20:12:21 zafer Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -363,9 +363,7 @@ lfs_raw_vget(struct lfs * fs, ino_t ino,
 	ip->inode_ext.lfs = ecalloc(1, sizeof(*ip->inode_ext.lfs));
 	vp->v_data = ip;
 	/* ip->i_vnode = vp; */
-	ip->i_number = ino;
 	ip->i_lockf = 0;
-	ip->i_lfs_effnblks = 0;
 	ip->i_state = 0;
 
 	/* Load inode block and find inode */



CVS commit: src/sbin/fsck_lfs

2018-03-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 30 12:56:46 UTC 2018

Modified Files:
src/sbin/fsck_lfs: bufcache.c bufcache.h

Log Message:
PR/51418: Jose Luis Rodriguez Garcia: Fix incore src/sbin/fsck_lfs/bufcache.c
XXX: pullup-8, pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sbin/fsck_lfs/bufcache.c
cvs rdiff -u -r1.13 -r1.14 src/sbin/fsck_lfs/bufcache.h

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

Modified files:

Index: src/sbin/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.19 src/sbin/fsck_lfs/bufcache.c:1.20
--- src/sbin/fsck_lfs/bufcache.c:1.19	Thu Aug 25 03:43:18 2016
+++ src/sbin/fsck_lfs/bufcache.c	Fri Mar 30 08:56:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.19 2016/08/25 07:43:18 christos Exp $ */
+/* $NetBSD: bufcache.c,v 1.20 2018/03/30 12:56:46 christos Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -191,7 +191,7 @@ bremfree(struct ubuf * bp)
 
 /* Return a buffer if it is in the cache, otherwise return NULL. */
 struct ubuf *
-incore(struct uvnode * vp, int lbn)
+incore(struct uvnode * vp, daddr_t lbn)
 {
 	struct ubuf *bp;
 	int hash, depth;

Index: src/sbin/fsck_lfs/bufcache.h
diff -u src/sbin/fsck_lfs/bufcache.h:1.13 src/sbin/fsck_lfs/bufcache.h:1.14
--- src/sbin/fsck_lfs/bufcache.h:1.13	Thu Aug 18 04:08:02 2016
+++ src/sbin/fsck_lfs/bufcache.h	Fri Mar 30 08:56:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufcache.h,v 1.13 2016/08/18 08:08:02 christos Exp $	*/
+/*	$NetBSD: bufcache.h,v 1.14 2018/03/30 12:56:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -115,7 +115,7 @@ void bufrehash(int);
 void bufstats(void);
 void buf_destroy(struct ubuf *);
 void bremfree(struct ubuf *);
-struct ubuf *incore(struct uvnode *, int);
+struct ubuf *incore(struct uvnode *, daddr_t);
 struct ubuf *getblk(struct uvnode *, daddr_t, int);
 void bwrite(struct ubuf *);
 void brelse(struct ubuf *, int);



CVS commit: src/sbin/fsck_lfs

2017-06-10 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jun 10 08:13:15 UTC 2017

Modified Files:
src/sbin/fsck_lfs: inode.c lfs.c pass6.c segwrite.c

Log Message:
Update inode member i_flag --> i_state to keep up with kernel changes


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sbin/fsck_lfs/inode.c
cvs rdiff -u -r1.72 -r1.73 src/sbin/fsck_lfs/lfs.c
cvs rdiff -u -r1.49 -r1.50 src/sbin/fsck_lfs/pass6.c
cvs rdiff -u -r1.45 -r1.46 src/sbin/fsck_lfs/segwrite.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/fsck_lfs/inode.c
diff -u src/sbin/fsck_lfs/inode.c:1.68 src/sbin/fsck_lfs/inode.c:1.69
--- src/sbin/fsck_lfs/inode.c:1.68	Mon Sep 21 01:24:23 2015
+++ src/sbin/fsck_lfs/inode.c	Sat Jun 10 08:13:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.68 2015/09/21 01:24:23 dholland Exp $	 */
+/* $NetBSD: inode.c,v 1.69 2017/06/10 08:13:15 pgoyette Exp $	 */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -436,7 +436,7 @@ inocleanup(void)
 void
 inodirty(struct inode *ip)
 {
-	ip->i_flag |= IN_MODIFIED;
+	ip->i_state |= IN_MODIFIED;
 }
 
 void

Index: src/sbin/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.72 src/sbin/fsck_lfs/lfs.c:1.73
--- src/sbin/fsck_lfs/lfs.c:1.72	Fri Sep 16 11:13:47 2016
+++ src/sbin/fsck_lfs/lfs.c	Sat Jun 10 08:13:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.72 2016/09/16 11:13:47 christos Exp $ */
+/* $NetBSD: lfs.c,v 1.73 2017/06/10 08:13:15 pgoyette Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -366,7 +366,7 @@ lfs_raw_vget(struct lfs * fs, ino_t ino,
 	ip->i_number = ino;
 	ip->i_lockf = 0;
 	ip->i_lfs_effnblks = 0;
-	ip->i_flag = 0;
+	ip->i_state = 0;
 
 	/* Load inode block and find inode */
 	if (daddr > 0) {
@@ -952,7 +952,7 @@ extend_ifile(struct lfs *fs)
 	lfs_balloc(vp, lfs_dino_getsize(fs, ip->i_din), lfs_sb_getbsize(fs), &bp);
 	lfs_dino_setsize(fs, ip->i_din,
 	lfs_dino_getsize(fs, ip->i_din) + lfs_sb_getbsize(fs));
-	ip->i_flag |= IN_MODIFIED;
+	ip->i_state |= IN_MODIFIED;
 	
 	i = (blkno - lfs_sb_getsegtabsz(fs) - lfs_sb_getcleansz(fs)) *
 		lfs_sb_getifpb(fs);
@@ -1058,7 +1058,7 @@ lfs_balloc(struct uvnode *vp, off_t star
 		(bpp ? &bp : NULL
 return (error);
 			lfs_dino_setsize(fs, ip->i_din, (lastblock + 1) * lfs_sb_getbsize(fs));
-			ip->i_flag |= IN_CHANGE | IN_UPDATE;
+			ip->i_state |= IN_CHANGE | IN_UPDATE;
 			if (bpp)
 (void) VOP_BWRITE(bp);
 		}
@@ -1252,7 +1252,7 @@ lfs_fragextend(struct uvnode *vp, int os
 
 	lfs_sb_subbfree(fs, frags);
 	ip->i_lfs_effnblks += frags;
-	ip->i_flag |= IN_CHANGE | IN_UPDATE;
+	ip->i_state |= IN_CHANGE | IN_UPDATE;
 
 	if (bpp) {
 		(*bpp)->b_data = erealloc((*bpp)->b_data, nsize);

Index: src/sbin/fsck_lfs/pass6.c
diff -u src/sbin/fsck_lfs/pass6.c:1.49 src/sbin/fsck_lfs/pass6.c:1.50
--- src/sbin/fsck_lfs/pass6.c:1.49	Sat Oct  3 08:29:21 2015
+++ src/sbin/fsck_lfs/pass6.c	Sat Jun 10 08:13:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.49 2015/10/03 08:29:21 dholland Exp $	 */
+/* $NetBSD: pass6.c,v 1.50 2017/06/10 08:13:15 pgoyette Exp $	 */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@ rfw_update_single(struct uvnode *vp, dad
 	u_int32_t oldsn, sn;
 
 	ip = VTOI(vp);
-	ip->i_flag |= IN_MODIFIED;
+	ip->i_state |= IN_MODIFIED;
 
 	error = ulfs_bmaparray(fs, vp, lbn, &daddr, a, &num);
 	if (error)

Index: src/sbin/fsck_lfs/segwrite.c
diff -u src/sbin/fsck_lfs/segwrite.c:1.45 src/sbin/fsck_lfs/segwrite.c:1.46
--- src/sbin/fsck_lfs/segwrite.c:1.45	Sat Oct  3 08:28:15 2015
+++ src/sbin/fsck_lfs/segwrite.c	Sat Jun 10 08:13:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: segwrite.c,v 1.45 2015/10/03 08:28:15 dholland Exp $ */
+/* $NetBSD: segwrite.c,v 1.46 2017/06/10 08:13:15 pgoyette Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -1027,7 +1027,7 @@ lfs_writevnodes(struct lfs *fs, struct s
 		/*
 		 * Write the inode/file if dirty and it's not the IFILE.
 		 */
-		if (ip->i_flag & IN_ALLMOD || !LIST_EMPTY(&vp->v_dirtyblkhd)) {
+		if (ip->i_state & IN_ALLMOD || !LIST_EMPTY(&vp->v_dirtyblkhd)) {
 			if (ip->i_number != LFS_IFILE_INUM)
 lfs_writefile(fs, sp, vp);
 			(void) lfs_writeinode(fs, sp, ip);



CVS commit: src/sbin/fsck_lfs

2017-06-08 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Fri Jun  9 00:13:09 UTC 2017

Modified Files:
src/sbin/fsck_lfs: vnode.h

Log Message:
this file uses the  macros so it should include
that header itself, rather than relying on getting it indirectly
by including some other header.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sbin/fsck_lfs/vnode.h

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

Modified files:

Index: src/sbin/fsck_lfs/vnode.h
diff -u src/sbin/fsck_lfs/vnode.h:1.4 src/sbin/fsck_lfs/vnode.h:1.5
--- src/sbin/fsck_lfs/vnode.h:1.4	Mon Apr 28 20:23:08 2008
+++ src/sbin/fsck_lfs/vnode.h	Fri Jun  9 00:13:08 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vnode.h,v 1.4 2008/04/28 20:23:08 martin Exp $ */
+/* $NetBSD: vnode.h,v 1.5 2017/06/09 00:13:08 chs Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,6 +28,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include 
+
 #define VNODE_HASH_MAX   1024 /* Must be a PO2 */
 #define VNODE_CACHE_SIZE 1024 /* Need not be a PO2 */
 



CVS commit: src/sbin/fsck_lfs

2016-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 16 11:13:47 UTC 2016

Modified Files:
src/sbin/fsck_lfs: lfs.c

Log Message:
PR/51478: Jose Luis Rodriguez Garcia: Fix leak mem fsck_lfs/lfs.c


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sbin/fsck_lfs/lfs.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.71 src/sbin/fsck_lfs/lfs.c:1.72
--- src/sbin/fsck_lfs/lfs.c:1.71	Sun Mar 20 00:24:46 2016
+++ src/sbin/fsck_lfs/lfs.c	Fri Sep 16 07:13:47 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.71 2016/03/20 04:24:46 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.72 2016/09/16 11:13:47 christos Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -376,6 +376,8 @@ lfs_raw_vget(struct lfs * fs, ino_t ino,
 		dip = lfs_ifind(fs, ino, bp);
 		if (dip == NULL) {
 			brelse(bp, 0);
+			free(ip->i_din);
+			free(ip->inode_ext.lfs);
 			free(ip);
 			free(vp);
 			return NULL;



CVS commit: src/sbin/fsck_lfs

2016-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 25 07:43:18 UTC 2016

Modified Files:
src/sbin/fsck_lfs: bufcache.c

Log Message:
PR/51440: Jose Luis Rodriguez Garcia: Use the standard queue.h macro instead
of playing with the TAILQ's entrails.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sbin/fsck_lfs/bufcache.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/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.18 src/sbin/fsck_lfs/bufcache.c:1.19
--- src/sbin/fsck_lfs/bufcache.c:1.18	Thu Aug 18 04:08:02 2016
+++ src/sbin/fsck_lfs/bufcache.c	Thu Aug 25 03:43:18 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.18 2016/08/18 08:08:02 christos Exp $ */
+/* $NetBSD: bufcache.c,v 1.19 2016/08/25 07:43:18 christos Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -173,8 +173,6 @@ bremfree(struct ubuf * bp)
 	 * We only calculate the head of the freelist when removing
 	 * the last element of the list as that is the only time that
 	 * it is needed (e.g. to reset the tail pointer).
-	 *
-	 * NB: This makes an assumption about how tailq's are implemented.
 	 */
 	if (bp->b_flags & B_LOCKED) {
 		locked_queue_bytes -= bp->b_bcount;
@@ -182,7 +180,7 @@ bremfree(struct ubuf * bp)
 	}
 	if (TAILQ_NEXT(bp, b_freelist) == NULL) {
 		for (dp = bufqueues; dp < &bufqueues[BQUEUES]; dp++)
-			if (dp->tqh_last == &bp->b_freelist.tqe_next)
+			if (TAILQ_LAST(dp, bqueues) == bp)
 break;
 		if (dp == &bufqueues[BQUEUES])
 			errx(1, "bremfree: lost tail");



CVS commit: src/sbin/fsck_lfs

2016-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 18 08:08:02 UTC 2016

Modified Files:
src/sbin/fsck_lfs: bufcache.c bufcache.h

Log Message:
PR/51422: Jose Luis Rodriguez Garcia: completely remove B_NEEDCOMMIT


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sbin/fsck_lfs/bufcache.c
cvs rdiff -u -r1.12 -r1.13 src/sbin/fsck_lfs/bufcache.h

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

Modified files:

Index: src/sbin/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.17 src/sbin/fsck_lfs/bufcache.c:1.18
--- src/sbin/fsck_lfs/bufcache.c:1.17	Thu Aug 18 04:04:28 2016
+++ src/sbin/fsck_lfs/bufcache.c	Thu Aug 18 04:08:02 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.17 2016/08/18 08:04:28 christos Exp $ */
+/* $NetBSD: bufcache.c,v 1.18 2016/08/18 08:08:02 christos Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -230,7 +230,6 @@ getblk(struct uvnode * vp, daddr_t lbn, 
 	 * the buffer, its contents are invalid; but shrinking is okay.
 	 */
 	if ((bp = incore(vp, lbn)) != NULL) {
-		assert(!(bp->b_flags & B_NEEDCOMMIT));
 		assert(!(bp->b_flags & B_BUSY));
 		bp->b_flags |= B_BUSY;
 		bremfree(bp);
@@ -308,7 +307,6 @@ brelse(struct ubuf * bp, int set)
 {
 	int age;
 
-	assert(!(bp->b_flags & B_NEEDCOMMIT));
 	assert(bp->b_flags & B_BUSY);
 
 	bp->b_flags |= set;

Index: src/sbin/fsck_lfs/bufcache.h
diff -u src/sbin/fsck_lfs/bufcache.h:1.12 src/sbin/fsck_lfs/bufcache.h:1.13
--- src/sbin/fsck_lfs/bufcache.h:1.12	Sun Mar 29 15:35:58 2015
+++ src/sbin/fsck_lfs/bufcache.h	Thu Aug 18 04:08:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufcache.h,v 1.12 2015/03/29 19:35:58 chopps Exp $	*/
+/*	$NetBSD: bufcache.h,v 1.13 2016/08/18 08:08:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -92,7 +92,6 @@ struct ubuf {
  * These flags are kept in b_flags.
  */
 #define	B_AGE		0x0001	/* Move to age queue when I/O done. */
-#define	B_NEEDCOMMIT	0x0002	/* Needs committing to stable storage */
 #define	B_BUSY		0x0010	/* I/O in progress. */
 #define	B_DELWRI	0x0080	/* Delay I/O until buffer reused. */
 #define	B_DONE		0x0200	/* I/O completed. */



CVS commit: src/sbin/fsck_lfs

2016-08-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 18 08:04:28 UTC 2016

Modified Files:
src/sbin/fsck_lfs: bufcache.c

Log Message:
PR/51422: Jose Luis Rodriguez Garcia: Remove unnecessary assignment.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sbin/fsck_lfs/bufcache.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/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.16 src/sbin/fsck_lfs/bufcache.c:1.17
--- src/sbin/fsck_lfs/bufcache.c:1.16	Sun Jul 31 14:27:26 2016
+++ src/sbin/fsck_lfs/bufcache.c	Thu Aug 18 04:04:28 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.16 2016/07/31 18:27:26 dholland Exp $ */
+/* $NetBSD: bufcache.c,v 1.17 2016/08/18 08:04:28 christos Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -155,7 +155,6 @@ bufstats(void)
 void
 buf_destroy(struct ubuf * bp)
 {
-	bp->b_flags |= B_NEEDCOMMIT;
 	LIST_REMOVE(bp, b_vnbufs);
 	LIST_REMOVE(bp, b_hash);
 	if (!(bp->b_flags & B_DONTFREE))



CVS commit: src/sbin/fsck_lfs

2016-07-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 31 18:27:27 UTC 2016

Modified Files:
src/sbin/fsck_lfs: bufcache.c

Log Message:
PR 51264 Jose Luis Rodriguez Garcia: lfs userland bufcache rehash is broken


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/fsck_lfs/bufcache.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/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.15 src/sbin/fsck_lfs/bufcache.c:1.16
--- src/sbin/fsck_lfs/bufcache.c:1.15	Sun Mar 29 19:35:58 2015
+++ src/sbin/fsck_lfs/bufcache.c	Sun Jul 31 18:27:26 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.15 2015/03/29 19:35:58 chopps Exp $ */
+/* $NetBSD: bufcache.c,v 1.16 2016/07/31 18:27:26 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -101,17 +101,19 @@ bufinit(int max)
 /* Widen the hash table. */
 void bufrehash(int max)
 {
-	int i, newhashmax, newhashmask;
+	int i, newhashmax;
 	struct ubuf *bp, *nbp;
 	struct bufhash_struct *np;
 
-	if (max < 0 || max < hashmax)
+	if (max < 0 || max <= hashmax)
 		return;
 
 	/* Round up to a power of two */
 	for (newhashmax = 1; newhashmax < max; newhashmax <<= 1)
 		;
-	newhashmask = newhashmax - 1;
+
+	/* update the mask right away so vl_hash() uses it */
+	hashmask = newhashmax - 1;
 
 	/* Allocate new empty hash table, if we can */
 	np = emalloc(newhashmax * sizeof(*bufhash));
@@ -134,7 +136,6 @@ void bufrehash(int max)
 	free(bufhash);
 	bufhash = np;
 	hashmax = newhashmax;
-	hashmask = newhashmask;
 }
 
 /* Print statistics of buffer cache usage */



CVS commit: src/sbin/fsck_lfs

2016-03-19 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 20 04:24:46 UTC 2016

Modified Files:
src/sbin/fsck_lfs: lfs.c

Log Message:
Comment out unused logic. PR 50973


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sbin/fsck_lfs/lfs.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.70 src/sbin/fsck_lfs/lfs.c:1.71
--- src/sbin/fsck_lfs/lfs.c:1.70	Fri Feb 19 03:53:46 2016
+++ src/sbin/fsck_lfs/lfs.c	Sun Mar 20 04:24:46 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.70 2016/02/19 03:53:46 riastradh Exp $ */
+/* $NetBSD: lfs.c,v 1.71 2016/03/20 04:24:46 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -288,7 +288,7 @@ ulfs_getlbns(struct lfs * fs, struct uvn
 			break;
 
 		lbc -= lognindir;
-		blockcnt = (int64_t) 1 << lbc;
+		/*blockcnt = (int64_t) 1 << lbc;*/
 		off = (bn >> lbc) & (lfs_sb_getnindir(fs) - 1);
 
 		++numlevels;



CVS commit: src/sbin/fsck_lfs

2016-03-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 17 18:56:14 UTC 2016

Modified Files:
src/sbin/fsck_lfs: setup.c

Log Message:
PR/50974: David Binderman: Remove unused code.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sbin/fsck_lfs/setup.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/fsck_lfs/setup.c
diff -u src/sbin/fsck_lfs/setup.c:1.60 src/sbin/fsck_lfs/setup.c:1.61
--- src/sbin/fsck_lfs/setup.c:1.60	Sat Oct  3 04:29:21 2015
+++ src/sbin/fsck_lfs/setup.c	Thu Mar 17 14:56:14 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.60 2015/10/03 08:29:21 dholland Exp $ */
+/* $NetBSD: setup.c,v 1.61 2016/03/17 18:56:14 christos Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -163,7 +163,9 @@ extern time_t write_time;
 int
 setup(const char *dev)
 {
+#ifndef VERBOSE_BLOCKMAP
 	long bmapsize;
+#endif
 	struct stat statb;
 	int doskipclean;
 	u_int64_t maxfilesize;
@@ -444,7 +446,6 @@ setup(const char *dev)
 	bmapsize = roundup(howmany(maxfsblock, NBBY), sizeof(int16_t));
 	blockmap = ecalloc(bmapsize, sizeof(char));
 #else
-	bmapsize = maxfsblock * sizeof(ino_t);
 	blockmap = ecalloc(maxfsblock, sizeof(ino_t));
 #endif
 	statemap = ecalloc(maxino, sizeof(char));



CVS commit: src/sbin/fsck_lfs

2016-02-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 19 03:53:47 UTC 2016

Modified Files:
src/sbin/fsck_lfs: lfs.c

Log Message:
Need  for true/false.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sbin/fsck_lfs/lfs.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.69 src/sbin/fsck_lfs/lfs.c:1.70
--- src/sbin/fsck_lfs/lfs.c:1.69	Thu Oct 15 06:24:55 2015
+++ src/sbin/fsck_lfs/lfs.c	Fri Feb 19 03:53:46 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.69 2015/10/15 06:24:55 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.70 2016/02/19 03:53:46 riastradh Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -80,6 +80,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/sbin/fsck_lfs

2015-10-14 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Oct 15 06:24:55 UTC 2015

Modified Files:
src/sbin/fsck_lfs: lfs.c

Log Message:
Enable lfs64 in fsck_lfs.
(and in everything else that uses this code)


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sbin/fsck_lfs/lfs.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.68 src/sbin/fsck_lfs/lfs.c:1.69
--- src/sbin/fsck_lfs/lfs.c:1.68	Sat Oct 10 22:34:09 2015
+++ src/sbin/fsck_lfs/lfs.c	Thu Oct 15 06:24:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.68 2015/10/10 22:34:09 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.69 2015/10/15 06:24:55 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -437,14 +437,29 @@ check_sb(struct lfs *fs)
 	/* we can read the magic out of either the 32-bit or 64-bit dlfs */
 	magic = fs->lfs_dlfs_u.u_32.dlfs_magic;
 
-	if (magic != LFS_MAGIC) {
+	switch (magic) {
+	case LFS_MAGIC:
+		fs->lfs_is64 = false;
+		fs->lfs_dobyteswap = false;
+		break;
+	case LFS_MAGIC_SWAPPED:
+		fs->lfs_is64 = false;
+		fs->lfs_dobyteswap = true;
+		break;
+	case LFS64_MAGIC:
+		fs->lfs_is64 = true;
+		fs->lfs_dobyteswap = false;
+		break;
+	case LFS64_MAGIC_SWAPPED:
+		fs->lfs_is64 = true;
+		fs->lfs_dobyteswap = true;
+		break;
+	default:
 		printf("Superblock magic number (0x%lx) does not match "
 		   "expected 0x%lx\n", (unsigned long) magic,
 		   (unsigned long) LFS_MAGIC);
 		return 1;
 	}
-	fs->lfs_is64 = 0; /* XXX notyet */
-	fs->lfs_dobyteswap = 0; /* XXX notyet */
 
 	/* checksum */
 	checksum = lfs_sb_cksum(fs);



CVS commit: src/sbin/fsck_lfs

2015-10-03 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Oct  3 08:30:02 UTC 2015

Modified Files:
src/sbin/fsck_lfs: fsck.h

Log Message:
Use daddr_t instead of uint32_t for the in-memory copy of the inode
block pointers.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sbin/fsck_lfs/fsck.h

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

Modified files:

Index: src/sbin/fsck_lfs/fsck.h
diff -u src/sbin/fsck_lfs/fsck.h:1.24 src/sbin/fsck_lfs/fsck.h:1.25
--- src/sbin/fsck_lfs/fsck.h:1.24	Sat Oct  3 08:29:06 2015
+++ src/sbin/fsck_lfs/fsck.h	Sat Oct  3 08:30:02 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fsck.h,v 1.24 2015/10/03 08:29:06 dholland Exp $	 */
+/* $NetBSD: fsck.h,v 1.25 2015/10/03 08:30:02 dholland Exp $	 */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -150,8 +150,7 @@ struct inoinfo {
 	ino_t i_dotdot;		/* inode number of `..' */
 	size_t i_isize;		/* size of inode */
 	u_int i_numblks;	/* size of block array in bytes */
-	/* XXX ondisk32 */
-	int32_t i_blks[1];	/* actually longer */
+	daddr_t i_blks[1];	/* actually longer */
 } **inphead, **inpsort;
 
 #ifndef VERBOSE_BLOCKMAP



CVS commit: src/sbin/fsck_lfs

2015-10-03 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Oct  3 08:30:13 UTC 2015

Modified Files:
src/sbin/fsck_lfs: fsck.h pass1.c

Log Message:
The per-inode state 'id_entryno' is used by pass1 for a block count,
so widen it to 'long long'. pass2 uses it for the number of entries in
a directory (IIUC) which does not need to be wider than int, but for
now let's not try to split into two fields. FUTURE...


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sbin/fsck_lfs/fsck.h
cvs rdiff -u -r1.44 -r1.45 src/sbin/fsck_lfs/pass1.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/fsck_lfs/fsck.h
diff -u src/sbin/fsck_lfs/fsck.h:1.25 src/sbin/fsck_lfs/fsck.h:1.26
--- src/sbin/fsck_lfs/fsck.h:1.25	Sat Oct  3 08:30:02 2015
+++ src/sbin/fsck_lfs/fsck.h	Sat Oct  3 08:30:13 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fsck.h,v 1.25 2015/10/03 08:30:02 dholland Exp $	 */
+/* $NetBSD: fsck.h,v 1.26 2015/10/03 08:30:13 dholland Exp $	 */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@ struct inodesc {
 	int id_numfrags;	/* number of frags contained in block */
 	off_t id_filesize;	/* for DATA nodes, the size of the directory */
 	int id_loc;		/* for DATA nodes, current location in dir */
-	int id_entryno;		/* for DATA nodes, current entry number */
+	long long id_entryno;	/* for DATA nodes, current entry number */
 	LFS_DIRHEADER *id_dirp;	/* for DATA nodes, ptr to current entry */
 	const char *id_name;	/* for DATA nodes, name to find or enter */
 	char id_type;		/* type of descriptor, DATA or ADDR */

Index: src/sbin/fsck_lfs/pass1.c
diff -u src/sbin/fsck_lfs/pass1.c:1.44 src/sbin/fsck_lfs/pass1.c:1.45
--- src/sbin/fsck_lfs/pass1.c:1.44	Tue Sep  1 06:15:02 2015
+++ src/sbin/fsck_lfs/pass1.c	Sat Oct  3 08:30:13 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pass1.c,v 1.44 2015/09/01 06:15:02 dholland Exp $	 */
+/* $NetBSD: pass1.c,v 1.45 2015/10/03 08:30:13 dholland Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -325,7 +325,7 @@ checkinode(ino_t inumber, struct inodesc
 	idesc->id_number = inumber;
 	(void) ckinode(VTOD(vp), idesc);
 	if (lfs_dino_getblocks(fs, dp) != idesc->id_entryno) {
-		pwarn("INCORRECT BLOCK COUNT I=%llu (%ju SHOULD BE %d)",
+		pwarn("INCORRECT BLOCK COUNT I=%llu (%ju SHOULD BE %lld)",
 		(unsigned long long)inumber, lfs_dino_getblocks(fs, dp),
 		idesc->id_entryno);
 		if (preen)



CVS commit: src/sbin/fsck_lfs

2015-10-03 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Oct  3 08:29:21 UTC 2015

Modified Files:
src/sbin/fsck_lfs: lfs.c pass6.c setup.c

Log Message:
Fix hardwired 32-bit stuff in fsck:
   - compute the maximum file size using LFS_BLKPTRSIZE()
   - use the new IINFO in pass 6 instead of uint32_t pointers
   - use accessors to read and write indirect blocks


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sbin/fsck_lfs/lfs.c
cvs rdiff -u -r1.48 -r1.49 src/sbin/fsck_lfs/pass6.c
cvs rdiff -u -r1.59 -r1.60 src/sbin/fsck_lfs/setup.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.64 src/sbin/fsck_lfs/lfs.c:1.65
--- src/sbin/fsck_lfs/lfs.c:1.64	Sat Oct  3 08:28:46 2015
+++ src/sbin/fsck_lfs/lfs.c	Sat Oct  3 08:29:21 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.64 2015/10/03 08:28:46 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.65 2015/10/03 08:29:21 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -1137,12 +1137,12 @@ lfs_balloc(struct uvnode *vp, off_t star
  * If that is the case mark it UNWRITTEN to
  * keep the accounting straight.
  */
-/* XXX ondisk32 */
-if (((int32_t *)ibp->b_data)[indirs[i].in_off] == 0)
-	((int32_t *)ibp->b_data)[indirs[i].in_off] =
-		UNWRITTEN;
-/* XXX ondisk32 */
-idaddr = ((int32_t *)ibp->b_data)[indirs[i].in_off];
+if (lfs_iblock_get(fs, ibp->b_data,
+		indirs[i].in_off) == 0)
+	lfs_iblock_set(fs, ibp->b_data,
+		indirs[i].in_off, UNWRITTEN);
+idaddr = lfs_iblock_get(fs, ibp->b_data,
+		indirs[i].in_off);
 if ((error = VOP_BWRITE(ibp)))
 	return error;
 			}
@@ -1183,7 +1183,6 @@ lfs_balloc(struct uvnode *vp, off_t star
 			if (bread(vp, idp->in_lbn, lfs_sb_getbsize(fs), 0, &ibp))
 panic("lfs_balloc: bread bno %lld",
 (long long)idp->in_lbn);
-			/* XXX ondisk32 */
 			lfs_iblock_set(fs, ibp->b_data, idp->in_off,
    UNWRITTEN);
 			VOP_BWRITE(ibp);

Index: src/sbin/fsck_lfs/pass6.c
diff -u src/sbin/fsck_lfs/pass6.c:1.48 src/sbin/fsck_lfs/pass6.c:1.49
--- src/sbin/fsck_lfs/pass6.c:1.48	Tue Sep  1 06:15:02 2015
+++ src/sbin/fsck_lfs/pass6.c	Sat Oct  3 08:29:21 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.48 2015/09/01 06:15:02 dholland Exp $	 */
+/* $NetBSD: pass6.c,v 1.49 2015/10/03 08:29:21 dholland Exp $	 */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -547,7 +547,7 @@ void
 pass6(void)
 {
 	daddr_t daddr, ibdaddr, odaddr, lastgood;
-	uint32_t *idaddrp; /* XXX ondisk32 */
+	IINFO *iip;
 	struct uvnode *vp, *devvp;
 	CLEANERINFO *cip;
 	SEGUSE *sup;
@@ -649,13 +649,13 @@ pass6(void)
 			LFS_INOPB(fs)) *
 		lfs_sb_getibsize(fs)));
 		}
-		// XXX ondisk32
-		idaddrp = ((uint32_t *)((char *)bp->b_data + lfs_sb_getsumsize(fs)));
+		iip = SEGSUM_IINFOSTART(fs, bp->b_data);
 		for (i = 0; i < howmany(lfs_ss_getninos(fs, sp), LFS_INOPB(fs)); i++) {
 			ino_t *inums;
 			
 			inums = ecalloc(LFS_INOPB(fs) + 1, sizeof(*inums));
-			ibdaddr = *--idaddrp;
+			ibdaddr = lfs_ii_getblock(fs, iip);
+			iip = NEXTLOWER_IINFO(fs, iip);
 			lfs_sb_subbfree(fs, lfs_btofsb(fs, lfs_sb_getibsize(fs)));
 			sbdirty();
 			bread(devvp, LFS_FSBTODB(fs, ibdaddr),

Index: src/sbin/fsck_lfs/setup.c
diff -u src/sbin/fsck_lfs/setup.c:1.59 src/sbin/fsck_lfs/setup.c:1.60
--- src/sbin/fsck_lfs/setup.c:1.59	Tue Sep  1 06:15:02 2015
+++ src/sbin/fsck_lfs/setup.c	Sat Oct  3 08:29:21 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.59 2015/09/01 06:15:02 dholland Exp $ */
+/* $NetBSD: setup.c,v 1.60 2015/10/03 08:29:21 dholland Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -123,8 +123,7 @@ calcmaxfilesize(unsigned bshift)
 	uint64_t nptr; /* number of block pointers per block */
 	uint64_t maxblock;
 
-	/* XXX ondisk32 */
-	nptr = (1 << bshift) / sizeof(uint32_t);
+	nptr = (1 << bshift) / LFS_BLKPTRSIZE(fs);
 	maxblock = ULFS_NDADDR + nptr + nptr * nptr + nptr * nptr * nptr;
 
 	return maxblock << bshift;



CVS commit: src/sbin/fsck_lfs

2015-10-03 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Oct  3 08:29:06 UTC 2015

Modified Files:
src/sbin/fsck_lfs: extern.h fsck.h

Log Message:
Remove a dead data structure.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/fsck_lfs/extern.h
cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_lfs/fsck.h

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

Modified files:

Index: src/sbin/fsck_lfs/extern.h
diff -u src/sbin/fsck_lfs/extern.h:1.14 src/sbin/fsck_lfs/extern.h:1.15
--- src/sbin/fsck_lfs/extern.h:1.14	Mon Sep 21 01:24:23 2015
+++ src/sbin/fsck_lfs/extern.h	Sat Oct  3 08:29:06 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.14 2015/09/21 01:24:23 dholland Exp $	 */
+/* $NetBSD: extern.h,v 1.15 2015/10/03 08:29:06 dholland Exp $	 */
 
 /*
  * Copyright (c) 1994 James A. Jegers
@@ -43,7 +43,6 @@ int dofix(struct inodesc *, const char *
 void fileerror(ino_t, ino_t, const char *);
 int findino(struct inodesc *);
 int findname(struct inodesc *);
-void flush(int, struct ubufarea *);
 void freeblk(daddr_t, long);
 void freeino(ino_t);
 void freeinodebuf(void);

Index: src/sbin/fsck_lfs/fsck.h
diff -u src/sbin/fsck_lfs/fsck.h:1.23 src/sbin/fsck_lfs/fsck.h:1.24
--- src/sbin/fsck_lfs/fsck.h:1.23	Mon Sep 21 01:24:23 2015
+++ src/sbin/fsck_lfs/fsck.h	Sat Oct  3 08:29:06 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fsck.h,v 1.23 2015/09/21 01:24:23 dholland Exp $	 */
+/* $NetBSD: fsck.h,v 1.24 2015/10/03 08:29:06 dholland Exp $	 */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -69,8 +69,6 @@
 
 #define	MAXDUP		10	/* limit on dup blks (per inode) */
 #define	MAXBAD		10	/* limit on bad blks (per inode) */
-#define	MAXBUFSPACE	40*1024	/* maximum space to allocate to buffers */
-#define	INOBUFSIZE	56*1024	/* size of buffer to read inodes in pass1 */
 
 #ifndef BUFSIZ
 #define BUFSIZ 1024
@@ -85,37 +83,6 @@
 
 #define EEXIT	8		/* Standard error exit */
 
-/*
- * buffer cache structure.
- */
-struct ubufarea {
-	struct ubufarea *b_next;	/* free list queue */
-	struct ubufarea *b_prev;	/* free list queue */
-	daddr_t b_bno;
-	int b_size;
-	int b_errs;
-	int b_flags;
-	union {
-		char *b_buf;	/* buffer space */
-		/* XXX ondisk32 */
-		int32_t *b_indir;	/* indirect block */
-		struct lfs *b_fs;	/* super block */
-		struct cg *b_cg;/* cylinder group */
-		struct lfs32_dinode *b_dinode32;	/* inode block */
-		struct lfs64_dinode *b_dinode64;	/* inode block */
-	} b_un;
-	char b_dirty;
-};
-#define	B_INUSE 1
-
-#define	MINBUFS		5	/* minimum number of buffers required */
-
-#define	dirty(bp)	(bp)->b_dirty = 1
-#define	initbarea(bp) \
-	(bp)->b_dirty = 0; \
-	(bp)->b_bno = (daddr_t)-1; \
-	(bp)->b_flags = 0;
-
 enum fixstate {
 	DONTKNOW, NOFIX, FIX, IGNORE
 };



CVS commit: src/sbin/fsck_lfs

2015-08-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Sep  1 06:15:16 UTC 2015

Modified Files:
src/sbin/fsck_lfs: lfs_user.h

Log Message:
Remove ulfs_daddr_t.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sbin/fsck_lfs/lfs_user.h

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

Modified files:

Index: src/sbin/fsck_lfs/lfs_user.h
diff -u src/sbin/fsck_lfs/lfs_user.h:1.13 src/sbin/fsck_lfs/lfs_user.h:1.14
--- src/sbin/fsck_lfs/lfs_user.h:1.13	Tue Sep  1 06:13:57 2015
+++ src/sbin/fsck_lfs/lfs_user.h	Tue Sep  1 06:15:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_user.h,v 1.13 2015/09/01 06:13:57 dholland Exp $ */
+/* $NetBSD: lfs_user.h,v 1.14 2015/09/01 06:15:16 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -68,8 +68,6 @@ struct indir {
 	int in_exists;		/* Flag if the block exists. */
 };
 
-typedef int32_t ulfs_daddr_t;
-
 /* Convert between inode pointers and vnode pointers. */
 #define	VTOI(vp)	((struct inode *)(vp)->v_data)
 #define VTOD(vp)	(VTOI(vp)->i_din)



CVS commit: src/sbin/fsck_lfs

2015-08-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Sep  1 06:13:34 UTC 2015

Modified Files:
src/sbin/fsck_lfs: lfs.c lfs_user.h pass6.c

Log Message:
Use daddr_t, not ulfs_daddr_t, as the latter's 32 bits wide.
Don't use either for on-disk items.
Part 1 of 3.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sbin/fsck_lfs/lfs.c
cvs rdiff -u -r1.11 -r1.12 src/sbin/fsck_lfs/lfs_user.h
cvs rdiff -u -r1.45 -r1.46 src/sbin/fsck_lfs/pass6.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.60 src/sbin/fsck_lfs/lfs.c:1.61
--- src/sbin/fsck_lfs/lfs.c:1.60	Tue Sep  1 06:12:04 2015
+++ src/sbin/fsck_lfs/lfs.c	Tue Sep  1 06:13:33 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.60 2015/09/01 06:12:04 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.61 2015/09/01 06:13:33 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -336,7 +336,7 @@ lfs_ifind(struct lfs *fs, ino_t ino, str
  * XXX it currently loses atime information.
  */
 struct uvnode *
-lfs_raw_vget(struct lfs * fs, ino_t ino, int fd, ulfs_daddr_t daddr)
+lfs_raw_vget(struct lfs * fs, ino_t ino, int fd, daddr_t daddr)
 {
 	struct uvnode *vp;
 	struct inode *ip;
@@ -412,7 +412,7 @@ static struct uvnode *
 lfs_vget(void *vfs, ino_t ino)
 {
 	struct lfs *fs = (struct lfs *)vfs;
-	ulfs_daddr_t daddr;
+	daddr_t daddr;
 	struct ubuf *bp;
 	IFILE *ifp;
 

Index: src/sbin/fsck_lfs/lfs_user.h
diff -u src/sbin/fsck_lfs/lfs_user.h:1.11 src/sbin/fsck_lfs/lfs_user.h:1.12
--- src/sbin/fsck_lfs/lfs_user.h:1.11	Wed Aug 19 20:33:29 2015
+++ src/sbin/fsck_lfs/lfs_user.h	Tue Sep  1 06:13:33 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_user.h,v 1.11 2015/08/19 20:33:29 dholland Exp $ */
+/* $NetBSD: lfs_user.h,v 1.12 2015/09/01 06:13:33 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -83,7 +83,7 @@ int lfs_vop_strategy(struct ubuf *);
 int lfs_vop_bwrite(struct ubuf *);
 int lfs_vop_bmap(struct uvnode *, daddr_t, daddr_t *);
 
-struct uvnode *lfs_raw_vget(struct lfs *, ino_t, int, ulfs_daddr_t);
+struct uvnode *lfs_raw_vget(struct lfs *, ino_t, int, daddr_t);
 struct lfs *lfs_init(int, daddr_t, daddr_t, int, int);
 struct lfs *lfs_verify(struct lfs *, struct lfs *, struct uvnode *, int);
 int check_summary(struct lfs *, union segsum *, ulfs_daddr_t, int, struct uvnode *, void (*)(ulfs_daddr_t, union finfo *));

Index: src/sbin/fsck_lfs/pass6.c
diff -u src/sbin/fsck_lfs/pass6.c:1.45 src/sbin/fsck_lfs/pass6.c:1.46
--- src/sbin/fsck_lfs/pass6.c:1.45	Tue Sep  1 06:12:04 2015
+++ src/sbin/fsck_lfs/pass6.c	Tue Sep  1 06:13:33 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.45 2015/09/01 06:12:04 dholland Exp $	 */
+/* $NetBSD: pass6.c,v 1.46 2015/09/01 06:13:33 dholland Exp $	 */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -219,7 +219,7 @@ remove_ino(struct uvnode *vp, ino_t ino)
 	CLEANERINFO *cip;
 	struct ubuf *bp, *sbp, *cbp;
 	struct inodesc idesc;
-	ulfs_daddr_t daddr;
+	daddr_t daddr;
 
 	if (debug)
 		pwarn("remove ino %d\n", (int)ino);
@@ -422,13 +422,13 @@ account_block_changes(union lfs_dinode *
  * free list accounting is done.
  */
 static void
-readdress_inode(union lfs_dinode *dp, ulfs_daddr_t daddr)
+readdress_inode(union lfs_dinode *dp, daddr_t daddr)
 {
 	IFILE *ifp;
 	SEGUSE *sup;
 	struct ubuf *bp;
 	int sn;
-	ulfs_daddr_t odaddr;
+	daddr_t odaddr;
 	ino_t thisino = lfs_dino_getinumber(fs, dp);
 	struct uvnode *vp;
 
@@ -443,10 +443,10 @@ readdress_inode(union lfs_dinode *dp, ul
 	VOP_BWRITE(bp);
 
 	if (debug)
-		pwarn("readdress ino %ju from 0x%x to 0x%x mode %o nlink %d\n",
+		pwarn("readdress ino %ju from 0x%jx to 0x%jx mode %o nlink %d\n",
 			(uintmax_t)lfs_dino_getinumber(fs, dp),
-			(unsigned)odaddr,
-			(unsigned)daddr,
+			(uintmax_t)odaddr,
+			(intmax_t)daddr,
 			(int)lfs_dino_getmode(fs, dp),
 			(int)lfs_dino_getnlink(fs, dp));
 
@@ -549,7 +549,8 @@ alloc_inode(ino_t thisino, ulfs_daddr_t 
 void
 pass6(void)
 {
-	ulfs_daddr_t daddr, ibdaddr, odaddr, lastgood, *idaddrp;
+	daddr_t daddr, ibdaddr, odaddr, lastgood;
+	uint32_t *idaddrp; /* XXX ondisk32 */
 	struct uvnode *vp, *devvp;
 	CLEANERINFO *cip;
 	SEGUSE *sup;
@@ -618,13 +619,14 @@ pass6(void)
 	break;
 			}
 		}
+		KASSERT(hassuper == 0 || hassuper == 1);
 		
 		/* Read in summary block */
 		bread(devvp, LFS_FSBTODB(fs, daddr), lfs_sb_getsumsize(fs), 0, &bp);
 		sp = (SEGSUM *)bp->b_data;
 		if (debug)
-			pwarn("sum at 0x%x: ninos=%d nfinfo=%d\n",
-(unsigned)daddr, (int)lfs_ss_getninos(fs, sp),
+			pwarn("sum at 0x%jx: ninos=%d nfinfo=%d\n",
+(intmax_t)daddr, (int)lfs_ss_getninos(fs, sp),
 (int)lfs_ss_getnfinfo(fs, sp));
 
 		/* We have verified that this is a good summary. */
@@ -650,7 +652,8 @@ pass6(void)
 			LFS_INOPB(fs)) *
 		lfs_sb_getibsize(fs)));
 		}
-		idaddrp = ((ulfs_dad

CVS commit: src/sbin/fsck_lfs

2015-08-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Sep  1 06:13:57 UTC 2015

Modified Files:
src/sbin/fsck_lfs: lfs.c lfs_user.h pass6.c

Log Message:
Use daddr_t, not ulfs_daddr_t, as the latter's 32 bits wide.
Don't use either for on-disk items.
Part 2 of 3.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sbin/fsck_lfs/lfs.c
cvs rdiff -u -r1.12 -r1.13 src/sbin/fsck_lfs/lfs_user.h
cvs rdiff -u -r1.46 -r1.47 src/sbin/fsck_lfs/pass6.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.61 src/sbin/fsck_lfs/lfs.c:1.62
--- src/sbin/fsck_lfs/lfs.c:1.61	Tue Sep  1 06:13:33 2015
+++ src/sbin/fsck_lfs/lfs.c	Tue Sep  1 06:13:57 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.61 2015/09/01 06:13:33 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.62 2015/09/01 06:13:57 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -579,14 +579,14 @@ lfs_init(int devfd, daddr_t sblkno, dadd
  * or "goal" if we reached it without failure (the partial segment *at* goal
  * need not be valid).
  */
-ulfs_daddr_t
-try_verify(struct lfs *osb, struct uvnode *devvp, ulfs_daddr_t goal, int debug)
+daddr_t
+try_verify(struct lfs *osb, struct uvnode *devvp, daddr_t goal, int debug)
 {
-	ulfs_daddr_t daddr, odaddr;
+	daddr_t daddr, odaddr;
 	SEGSUM *sp;
 	int i, bc, hitclean;
 	struct ubuf *bp;
-	ulfs_daddr_t nodirop_daddr;
+	daddr_t nodirop_daddr;
 	u_int64_t serial;
 
 	bc = 0;
@@ -603,6 +603,7 @@ try_verify(struct lfs *osb, struct uvnod
 			if (daddr == lfs_sb_gets0addr(osb))
 daddr += lfs_btofsb(osb, LFS_LABELPAD);
 			for (i = 0; i < LFS_MAXNUMSB; i++) {
+/* XXX dholland 20150828 I think this is wrong */
 if (lfs_sb_getsboff(osb, i) < daddr)
 	break;
 if (lfs_sb_getsboff(osb, i) == daddr)
@@ -694,7 +695,7 @@ try_verify(struct lfs *osb, struct uvnod
 struct lfs *
 lfs_verify(struct lfs *sb0, struct lfs *sb1, struct uvnode *devvp, int debug)
 {
-	ulfs_daddr_t daddr;
+	daddr_t daddr;
 	struct lfs *osb, *nsb;
 
 	/*
@@ -753,14 +754,14 @@ lfs_verify(struct lfs *sb0, struct lfs *
 
 /* Verify a partial-segment summary; return the number of bytes on disk. */
 int
-check_summary(struct lfs *fs, SEGSUM *sp, ulfs_daddr_t pseg_addr, int debug,
-	  struct uvnode *devvp, void (func(ulfs_daddr_t, FINFO *)))
+check_summary(struct lfs *fs, SEGSUM *sp, daddr_t pseg_addr, int debug,
+	  struct uvnode *devvp, void (func(daddr_t, FINFO *)))
 {
 	FINFO *fp;
 	int bc;			/* Bytes in partial segment */
 	int nblocks;
-	ulfs_daddr_t daddr;
-	ulfs_daddr_t *dp, *idp;
+	daddr_t daddr;
+	uint32_t *dp, *idp; // XXX ondisk32
 	struct ubuf *bp;
 	int i, j, k, datac, len;
 	u_int32_t *datap;
@@ -786,8 +787,8 @@ check_summary(struct lfs *fs, SEGSUM *sp
 	datap = emalloc(nblocks * sizeof(*datap));
 	datac = 0;
 
-	dp = (ulfs_daddr_t *) sp;
-	dp += lfs_sb_getsumsize(fs) / sizeof(ulfs_daddr_t);
+	dp = (uint32_t *) sp; /* XXX ondisk32 */
+	dp += lfs_sb_getsumsize(fs) / sizeof(*dp);
 	dp--;
 
 	idp = dp;
@@ -796,13 +797,13 @@ check_summary(struct lfs *fs, SEGSUM *sp
 	for (i = 0, j = 0;
 	 i < lfs_ss_getnfinfo(fs, sp) || j < howmany(lfs_ss_getninos(fs, sp), LFS_INOPB(fs)); i++) {
 		if (i >= lfs_ss_getnfinfo(fs, sp) && *idp != daddr) {
-			pwarn("Not enough inode blocks in pseg at 0x%" PRIx32
-			  ": found %d, wanted %d\n",
+			pwarn("Not enough inode blocks in pseg at 0x%jx: "
+			  "found %d, wanted %d\n",
 			  pseg_addr, j, howmany(lfs_ss_getninos(fs, sp),
 		LFS_INOPB(fs)));
 			if (debug)
-pwarn("*idp=%x, daddr=%" PRIx32 "\n", *idp,
-  daddr);
+pwarn("*idp=0x%jx, daddr=0x%jx\n",
+(uintmax_t)*idp, (intmax_t)daddr);
 			break;
 		}
 		while (j < howmany(lfs_ss_getninos(fs, sp), LFS_INOPB(fs)) && *idp == daddr) {

Index: src/sbin/fsck_lfs/lfs_user.h
diff -u src/sbin/fsck_lfs/lfs_user.h:1.12 src/sbin/fsck_lfs/lfs_user.h:1.13
--- src/sbin/fsck_lfs/lfs_user.h:1.12	Tue Sep  1 06:13:33 2015
+++ src/sbin/fsck_lfs/lfs_user.h	Tue Sep  1 06:13:57 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_user.h,v 1.12 2015/09/01 06:13:33 dholland Exp $ */
+/* $NetBSD: lfs_user.h,v 1.13 2015/09/01 06:13:57 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -86,8 +86,8 @@ int lfs_vop_bmap(struct uvnode *, daddr_
 struct uvnode *lfs_raw_vget(struct lfs *, ino_t, int, daddr_t);
 struct lfs *lfs_init(int, daddr_t, daddr_t, int, int);
 struct lfs *lfs_verify(struct lfs *, struct lfs *, struct uvnode *, int);
-int check_summary(struct lfs *, union segsum *, ulfs_daddr_t, int, struct uvnode *, void (*)(ulfs_daddr_t, union finfo *));
-ulfs_daddr_t try_verify(struct lfs *, struct uvnode *, ulfs_daddr_t, int);
+int check_summary(struct lfs *, union segsum *, daddr_t, int, struct uvnode *, void (*)(daddr_t, union finfo *));
+daddr_t try_verify(struct lfs *, struct 

CVS commit: src/sbin/fsck_lfs

2015-08-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 23 16:00:23 UTC 2015

Modified Files:
src/sbin/fsck_lfs: pass0.c

Log Message:
swap the formats too, not just the args.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/fsck_lfs/pass0.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/fsck_lfs/pass0.c
diff -u src/sbin/fsck_lfs/pass0.c:1.40 src/sbin/fsck_lfs/pass0.c:1.41
--- src/sbin/fsck_lfs/pass0.c:1.40	Sun Aug 23 05:29:46 2015
+++ src/sbin/fsck_lfs/pass0.c	Sun Aug 23 12:00:23 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pass0.c,v 1.40 2015/08/23 09:29:46 dholland Exp $	 */
+/* $NetBSD: pass0.c,v 1.41 2015/08/23 16:00:23 christos Exp $	 */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -200,7 +200,7 @@ pass0(void)
 		writeit = 1;
 	}
 	if (freehd != lfs_sb_getfreehd(fs)) {
-		pwarn("FREE LIST HEAD IN SUPERBLOCK SHOULD BE %u (WAS %ju)\n",
+		pwarn("FREE LIST HEAD IN SUPERBLOCK SHOULD BE %ju (WAS %u)\n",
 			(uintmax_t)freehd, lfs_sb_getfreehd(fs));
 		if (preen || reply("FIX")) {
 			lfs_sb_setfreehd(fs, freehd);



CVS commit: src/sbin/fsck_lfs

2015-08-23 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Aug 23 09:29:46 UTC 2015

Modified Files:
src/sbin/fsck_lfs: pass0.c

Log Message:
Fix reversed arguments to a print. nice and confusing...


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sbin/fsck_lfs/pass0.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/fsck_lfs/pass0.c
diff -u src/sbin/fsck_lfs/pass0.c:1.39 src/sbin/fsck_lfs/pass0.c:1.40
--- src/sbin/fsck_lfs/pass0.c:1.39	Wed Aug 12 18:25:52 2015
+++ src/sbin/fsck_lfs/pass0.c	Sun Aug 23 09:29:46 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pass0.c,v 1.39 2015/08/12 18:25:52 dholland Exp $	 */
+/* $NetBSD: pass0.c,v 1.40 2015/08/23 09:29:46 dholland Exp $	 */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -201,7 +201,7 @@ pass0(void)
 	}
 	if (freehd != lfs_sb_getfreehd(fs)) {
 		pwarn("FREE LIST HEAD IN SUPERBLOCK SHOULD BE %u (WAS %ju)\n",
-			lfs_sb_getfreehd(fs), (uintmax_t)freehd);
+			(uintmax_t)freehd, lfs_sb_getfreehd(fs));
 		if (preen || reply("FIX")) {
 			lfs_sb_setfreehd(fs, freehd);
 			sbdirty();



CVS commit: src/sbin/fsck_lfs

2015-08-02 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Aug  3 04:16:10 UTC 2015

Modified Files:
src/sbin/fsck_lfs: pass5.c

Log Message:
Use intmax_t to print daddr_t; from sevan@.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sbin/fsck_lfs/pass5.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/fsck_lfs/pass5.c
diff -u src/sbin/fsck_lfs/pass5.c:1.34 src/sbin/fsck_lfs/pass5.c:1.35
--- src/sbin/fsck_lfs/pass5.c:1.34	Sun Aug  2 18:14:16 2015
+++ src/sbin/fsck_lfs/pass5.c	Mon Aug  3 04:16:10 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pass5.c,v 1.34 2015/08/02 18:14:16 dholland Exp $	 */
+/* $NetBSD: pass5.c,v 1.35 2015/08/03 04:16:10 dholland Exp $	 */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -152,8 +152,8 @@ pass5(void)
 		}
 	}
 	if (avail != lfs_sb_getavail(fs)) {
-		pwarn("AVAIL GIVEN AS %jd, SHOULD BE %ld\n",
-		  (intmax_t)lfs_sb_getavail(fs), avail);
+		pwarn("AVAIL GIVEN AS %jd, SHOULD BE %jd\n",
+		  (intmax_t)lfs_sb_getavail(fs), (intmax_t)avail);
 		if (preen || reply("FIX")) {
 			lfs_sb_setavail(fs, avail);
 			sbdirty();



CVS commit: src/sbin/fsck_lfs

2015-08-02 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Aug  2 17:56:24 UTC 2015

Modified Files:
src/sbin/fsck_lfs: setup.c

Log Message:
Fix bug: for format version 1, the superblock "size" field is measured
in blocks instead of frags, so use lfs_blkstofrags to correct it.

This code was instead multiplying by the block size divided by
DEV_BSIZE to get the number of disk blocks rather than the number of
frags. (I gather that originally these were the same, but they're not
necessarily any more.)


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sbin/fsck_lfs/setup.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/fsck_lfs/setup.c
diff -u src/sbin/fsck_lfs/setup.c:1.49 src/sbin/fsck_lfs/setup.c:1.50
--- src/sbin/fsck_lfs/setup.c:1.49	Tue Jul 28 05:09:34 2015
+++ src/sbin/fsck_lfs/setup.c	Sun Aug  2 17:56:24 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.49 2015/07/28 05:09:34 dholland Exp $ */
+/* $NetBSD: setup.c,v 1.50 2015/08/02 17:56:24 dholland Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -334,7 +334,7 @@ setup(const char *dev)
 		pwarn("lfs_inopb = %lu\n", (unsigned long) lfs_sb_getinopb(fs));
 	}
 	if (fs->lfs_version == 1)
-		maxfsblock = lfs_sb_getsize(fs) * (lfs_sb_getbsize(fs) / dev_bsize);
+		maxfsblock = lfs_blkstofrags(fs, lfs_sb_getsize(fs));
 	else
 		maxfsblock = lfs_sb_getsize(fs);
 	maxfilesize = calcmaxfilesize(lfs_sb_getbshift(fs));



CVS commit: src/sbin/fsck_lfs

2015-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 17 00:18:35 UTC 2015

Modified Files:
src/sbin/fsck_lfs: segwrite.c

Log Message:
add missing ;


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sbin/fsck_lfs/segwrite.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/fsck_lfs/segwrite.c
diff -u src/sbin/fsck_lfs/segwrite.c:1.30 src/sbin/fsck_lfs/segwrite.c:1.31
--- src/sbin/fsck_lfs/segwrite.c:1.30	Tue Jun 16 19:18:55 2015
+++ src/sbin/fsck_lfs/segwrite.c	Tue Jun 16 20:18:35 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: segwrite.c,v 1.30 2015/06/16 23:18:55 christos Exp $ */
+/* $NetBSD: segwrite.c,v 1.31 2015/06/17 00:18:35 christos Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -905,7 +905,7 @@ lfs_seglock(struct lfs * fs, unsigned lo
 	sp->bpp = emalloc(fs->lfs_ssize * sizeof(struct ubuf *));
 	if (!sp->bpp)
 		err(!preen, "Could not allocate %zu bytes",
-		(size_t)(fs->lfs_ssize * sizeof(struct ubuf *)))
+		(size_t)(fs->lfs_ssize * sizeof(struct ubuf *)));
 	sp->seg_flags = flags;
 	sp->vp = NULL;
 	sp->seg_iocount = 0;



CVS commit: src/sbin/fsck_lfs

2014-07-12 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 13 02:44:21 UTC 2014

Modified Files:
src/sbin/fsck_lfs: lfs.c lfs_user.h main.c

Log Message:
Revert previous; it doesn't work because all the lfs tools
promiscuously .PATH in each other's source files, and I haven't the
time or patience to deal with it tonight.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/fsck_lfs/lfs.c
cvs rdiff -u -r1.6 -r1.7 src/sbin/fsck_lfs/lfs_user.h
cvs rdiff -u -r1.47 -r1.48 src/sbin/fsck_lfs/main.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.42 src/sbin/fsck_lfs/lfs.c:1.43
--- src/sbin/fsck_lfs/lfs.c:1.42	Sat Jul 12 19:44:00 2014
+++ src/sbin/fsck_lfs/lfs.c	Sun Jul 13 02:44:21 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.42 2014/07/12 19:44:00 dholland Exp $ */
+/* $NetBSD: lfs.c,v 1.43 2014/07/13 02:44:21 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -85,7 +85,6 @@
 #include 
 #include 
 
-#include "fsutil.h"
 #include "bufcache.h"
 #include "vnode.h"
 #include "lfs_user.h"
@@ -108,6 +107,7 @@ static int
 lfs_fragextend(struct uvnode *, int, int, daddr_t, struct ubuf **);
 
 int fsdirty = 0;
+void (*panic_func)(int, const char *, va_list) = my_vpanic;
 
 /*
  * LFS buffer and uvnode operations
@@ -835,12 +835,19 @@ check_summary(struct lfs *fs, SEGSUM *sp
 
 /* print message and exit */
 void
+my_vpanic(int fatal, const char *fmt, va_list ap)
+{
+(void) vprintf(fmt, ap);
+	exit(8);
+}
+
+void
 call_panic(const char *fmt, ...)
 {
 	va_list ap;
 
 	va_start(ap, fmt);
-vmsg(1, fmt, ap);
+panic_func(1, fmt, ap);
 	va_end(ap);
 }
 

Index: src/sbin/fsck_lfs/lfs_user.h
diff -u src/sbin/fsck_lfs/lfs_user.h:1.6 src/sbin/fsck_lfs/lfs_user.h:1.7
--- src/sbin/fsck_lfs/lfs_user.h:1.6	Sat Jul 12 19:48:24 2014
+++ src/sbin/fsck_lfs/lfs_user.h	Sun Jul 13 02:44:21 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_user.h,v 1.6 2014/07/12 19:48:24 dholland Exp $ */
+/* $NetBSD: lfs_user.h,v 1.7 2014/07/13 02:44:21 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -89,6 +89,7 @@ int check_summary(struct lfs *, struct s
 ulfs_daddr_t try_verify(struct lfs *, struct uvnode *, ulfs_daddr_t, int);
 struct ulfs1_dinode *lfs_ifind(struct lfs *, ino_t, struct ubuf *);
 void call_panic(const char *, ...);
+void my_vpanic(int, const char *, va_list);
 int extend_ifile(struct lfs *);
 struct uvnode *lfs_valloc(struct lfs *, ino_t);
 int lfs_balloc(struct uvnode *, off_t, int, struct ubuf **);

Index: src/sbin/fsck_lfs/main.c
diff -u src/sbin/fsck_lfs/main.c:1.47 src/sbin/fsck_lfs/main.c:1.48
--- src/sbin/fsck_lfs/main.c:1.47	Sat Jul 12 19:44:00 2014
+++ src/sbin/fsck_lfs/main.c	Sun Jul 13 02:44:21 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.47 2014/07/12 19:44:00 dholland Exp $	 */
+/* $NetBSD: main.c,v 1.48 2014/07/13 02:44:21 dholland Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -57,6 +57,7 @@ static int argtoi(int, const char *, con
 static int checkfilesys(const char *, char *, long, int);
 static void usage(void);
 static void efun(int, const char *, ...);
+extern void (*panic_func)(int, const char *, va_list);
 
 static void
 efun(int eval, const char *fmt, ...)
@@ -80,6 +81,7 @@ main(int argc, char **argv)
 	skipclean = 1;
 	exitonfail = 0;
 	idaddr = 0x0;
+	panic_func = vmsg;
 	esetfunc(efun);
 	while ((ch = getopt(argc, argv, optstring)) != -1) {
 		switch (ch) {



CVS commit: src/sbin/fsck_lfs

2014-07-12 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Jul 12 19:48:24 UTC 2014

Modified Files:
src/sbin/fsck_lfs: lfs_user.h

Log Message:
G/C my_vpanic().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sbin/fsck_lfs/lfs_user.h

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

Modified files:

Index: src/sbin/fsck_lfs/lfs_user.h
diff -u src/sbin/fsck_lfs/lfs_user.h:1.5 src/sbin/fsck_lfs/lfs_user.h:1.6
--- src/sbin/fsck_lfs/lfs_user.h:1.5	Sat Jun  8 21:13:19 2013
+++ src/sbin/fsck_lfs/lfs_user.h	Sat Jul 12 19:48:24 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_user.h,v 1.5 2013/06/08 21:13:19 dholland Exp $ */
+/* $NetBSD: lfs_user.h,v 1.6 2014/07/12 19:48:24 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -89,7 +89,6 @@ int check_summary(struct lfs *, struct s
 ulfs_daddr_t try_verify(struct lfs *, struct uvnode *, ulfs_daddr_t, int);
 struct ulfs1_dinode *lfs_ifind(struct lfs *, ino_t, struct ubuf *);
 void call_panic(const char *, ...);
-void my_vpanic(int, const char *, va_list);
 int extend_ifile(struct lfs *);
 struct uvnode *lfs_valloc(struct lfs *, ino_t);
 int lfs_balloc(struct uvnode *, off_t, int, struct ubuf **);



CVS commit: src/sbin/fsck_lfs

2014-07-12 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Jul 12 19:44:00 UTC 2014

Modified Files:
src/sbin/fsck_lfs: lfs.c main.c

Log Message:
Remove pointless function indirection through panic_func(). It was
initialized to one thing, and then set to another right at the top of
main and never changed again.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sbin/fsck_lfs/lfs.c
cvs rdiff -u -r1.46 -r1.47 src/sbin/fsck_lfs/main.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.41 src/sbin/fsck_lfs/lfs.c:1.42
--- src/sbin/fsck_lfs/lfs.c:1.41	Sat Oct 19 01:09:58 2013
+++ src/sbin/fsck_lfs/lfs.c	Sat Jul 12 19:44:00 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.41 2013/10/19 01:09:58 christos Exp $ */
+/* $NetBSD: lfs.c,v 1.42 2014/07/12 19:44:00 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -85,6 +85,7 @@
 #include 
 #include 
 
+#include "fsutil.h"
 #include "bufcache.h"
 #include "vnode.h"
 #include "lfs_user.h"
@@ -107,7 +108,6 @@ static int
 lfs_fragextend(struct uvnode *, int, int, daddr_t, struct ubuf **);
 
 int fsdirty = 0;
-void (*panic_func)(int, const char *, va_list) = my_vpanic;
 
 /*
  * LFS buffer and uvnode operations
@@ -835,19 +835,12 @@ check_summary(struct lfs *fs, SEGSUM *sp
 
 /* print message and exit */
 void
-my_vpanic(int fatal, const char *fmt, va_list ap)
-{
-(void) vprintf(fmt, ap);
-	exit(8);
-}
-
-void
 call_panic(const char *fmt, ...)
 {
 	va_list ap;
 
 	va_start(ap, fmt);
-panic_func(1, fmt, ap);
+vmsg(1, fmt, ap);
 	va_end(ap);
 }
 

Index: src/sbin/fsck_lfs/main.c
diff -u src/sbin/fsck_lfs/main.c:1.46 src/sbin/fsck_lfs/main.c:1.47
--- src/sbin/fsck_lfs/main.c:1.46	Sat Jul 12 16:11:27 2014
+++ src/sbin/fsck_lfs/main.c	Sat Jul 12 19:44:00 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.46 2014/07/12 16:11:27 dholland Exp $	 */
+/* $NetBSD: main.c,v 1.47 2014/07/12 19:44:00 dholland Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -57,7 +57,6 @@ static int argtoi(int, const char *, con
 static int checkfilesys(const char *, char *, long, int);
 static void usage(void);
 static void efun(int, const char *, ...);
-extern void (*panic_func)(int, const char *, va_list);
 
 static void
 efun(int eval, const char *fmt, ...)
@@ -81,7 +80,6 @@ main(int argc, char **argv)
 	skipclean = 1;
 	exitonfail = 0;
 	idaddr = 0x0;
-	panic_func = vmsg;
 	esetfunc(efun);
 	while ((ch = getopt(argc, argv, optstring)) != -1) {
 		switch (ch) {



CVS commit: src/sbin/fsck_lfs

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:39:32 UTC 2014

Modified Files:
src/sbin/fsck_lfs: inode.c

Log Message:
don't use sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sbin/fsck_lfs/inode.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/fsck_lfs/inode.c
diff -u src/sbin/fsck_lfs/inode.c:1.51 src/sbin/fsck_lfs/inode.c:1.52
--- src/sbin/fsck_lfs/inode.c:1.51	Tue Jun 18 18:18:58 2013
+++ src/sbin/fsck_lfs/inode.c	Sun Mar 23 05:39:32 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.51 2013/06/18 18:18:58 christos Exp $	 */
+/* $NetBSD: inode.c,v 1.52 2014/03/23 05:39:32 dholland Exp $	 */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -259,7 +259,8 @@ iblock(struct inodesc *idesc, long ileve
 		for (ap = ((ulfs_daddr_t *) bp->b_data) + nif; ap < aplim; ap++) {
 			if (*ap == 0)
 continue;
-			(void) sprintf(buf, "PARTIALLY TRUNCATED INODE I=%llu",
+			(void)snprintf(buf, sizeof(buf),
+			"PARTIALLY TRUNCATED INODE I=%llu",
 			(unsigned long long)idesc->id_number);
 			if (dofix(idesc, buf)) {
 *ap = 0;



CVS commit: src/sbin/fsck_lfs

2013-06-08 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Jun  8 23:12:13 UTC 2013

Modified Files:
src/sbin/fsck_lfs: pass6.c

Log Message:
dp->di_u.inumber -> dp->di_inumber

Should have been part of the previous changeset that applied that
change to lfs.h. I'd quite like to know why the test build I ran
didn't trip on this.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sbin/fsck_lfs/pass6.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/fsck_lfs/pass6.c
diff -u src/sbin/fsck_lfs/pass6.c:1.29 src/sbin/fsck_lfs/pass6.c:1.30
--- src/sbin/fsck_lfs/pass6.c:1.29	Sat Jun  8 02:16:03 2013
+++ src/sbin/fsck_lfs/pass6.c	Sat Jun  8 23:12:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.29 2013/06/08 02:16:03 dholland Exp $	 */
+/* $NetBSD: pass6.c,v 1.30 2013/06/08 23:12:13 dholland Exp $	 */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -662,8 +662,8 @@ pass6(void)
 			for (dp = (struct ulfs1_dinode *)ibbuf;
 			 dp < (struct ulfs1_dinode *)ibbuf + INOPB(fs);
 			 ++dp) {
-if (dp->di_u.inumber == 0 ||
-dp->di_u.inumber == fs->lfs_ifile)
+if (dp->di_inumber == 0 ||
+dp->di_inumber == fs->lfs_ifile)
 	continue;
 /* Basic sanity checks */
 if (dp->di_nlink < 0 
@@ -679,7 +679,7 @@ pass6(void)
 	goto out;
 }
 
-vp = vget(fs, dp->di_u.inumber);
+vp = vget(fs, dp->di_inumber);
 
 /*
  * Four cases:
@@ -687,7 +687,7 @@ pass6(void)
  * If currently allocated, remove.
  */
 if (dp->di_nlink == 0) {
-	remove_ino(vp, dp->di_u.inumber);
+	remove_ino(vp, dp->di_inumber);
 	++ndelfiles;
 	continue;
 }
@@ -701,7 +701,7 @@ pass6(void)
 	if (!(sp->ss_flags & SS_DIROP))
 		pfatal("NEW FILE IN NON-DIROP PARTIAL SEGMENT");
 	else {
-		inums[j++] = dp->di_u.inumber;
+		inums[j++] = dp->di_inumber;
 		nnewfiles++;
 	}
 	continue;
@@ -712,11 +712,11 @@ pass6(void)
  * and proceed as in (2).
  */
 if (vp && VTOI(vp)->i_ffs1_gen < dp->di_gen) {
-	remove_ino(vp, dp->di_u.inumber);
+	remove_ino(vp, dp->di_inumber);
 	if (!(sp->ss_flags & SS_DIROP))
 		pfatal("NEW FILE VERSION IN NON-DIROP PARTIAL SEGMENT");
 	else {
-		inums[j++] = dp->di_u.inumber;
+		inums[j++] = dp->di_inumber;
 		ndelfiles++;
 		nnewfiles++;
 	}



CVS commit: src/sbin/fsck_lfs

2012-01-05 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Thu Jan  5 16:18:01 UTC 2012

Modified Files:
src/sbin/fsck_lfs: pass6.c

Log Message:
Correct fragment extension calculation in pass6, to avoid putting
negative block counts on inodes during roll-forward.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_lfs/pass6.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/fsck_lfs/pass6.c
diff -u src/sbin/fsck_lfs/pass6.c:1.23 src/sbin/fsck_lfs/pass6.c:1.24
--- src/sbin/fsck_lfs/pass6.c:1.23	Tue Feb 16 23:20:30 2010
+++ src/sbin/fsck_lfs/pass6.c	Thu Jan  5 16:18:00 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.23 2010/02/16 23:20:30 mlelstv Exp $	 */
+/* $NetBSD: pass6.c,v 1.24 2012/01/05 16:18:00 perseant Exp $	 */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ rfw_update_single(struct uvnode *vp, dad
 			ip->i_ffs1_blocks += frags;
 		else {
 			/* possible fragment truncation or extension */
-			ofrags = ip->i_lfs_fragsize[lbn];
+			ofrags = numfrags(fs, ip->i_lfs_fragsize[lbn]);
 			ip->i_ffs1_blocks += (frags - ofrags);
 		}
 		ip->i_ffs1_db[lbn] = ndaddr;



CVS commit: src/sbin/fsck_lfs

2011-08-29 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Aug 29 18:43:20 UTC 2011

Modified Files:
src/sbin/fsck_lfs: setup.c

Log Message:
PR bin/45299: print FBMASK not FFMASK when lfs_fbmask is incorrect.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sbin/fsck_lfs/setup.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/fsck_lfs/setup.c
diff -u src/sbin/fsck_lfs/setup.c:1.37 src/sbin/fsck_lfs/setup.c:1.38
--- src/sbin/fsck_lfs/setup.c:1.37	Tue Feb 16 23:20:30 2010
+++ src/sbin/fsck_lfs/setup.c	Mon Aug 29 18:43:20 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.37 2010/02/16 23:20:30 mlelstv Exp $ */
+/* $NetBSD: setup.c,v 1.38 2011/08/29 18:43:20 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -367,8 +367,8 @@
 		}
 	}
 	if (fs->lfs_fbmask != (1 << fs->lfs_fbshift) - 1) {
-		pwarn("INCORRECT FFMASK=%" PRId64 " IN SUPERBLOCK",
-		fs->lfs_ffmask);
+		pwarn("INCORRECT FBMASK=%" PRId64 " IN SUPERBLOCK",
+		fs->lfs_fbmask);
 		fs->lfs_fbmask = (1 << fs->lfs_fbshift) - 1;
 		if (preen)
 			printf(" (FIXED)\n");



CVS commit: src/sbin/fsck_lfs

2011-07-11 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Jul 12 02:46:03 UTC 2011

Modified Files:
src/sbin/fsck_lfs: lfs.c

Log Message:
Don't need to initialize (one of) the elements now in i_crap; nothing in
here touches that material.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sbin/fsck_lfs/lfs.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.34 src/sbin/fsck_lfs/lfs.c:1.35
--- src/sbin/fsck_lfs/lfs.c:1.34	Tue Jun 21 09:36:46 2011
+++ src/sbin/fsck_lfs/lfs.c	Tue Jul 12 02:46:03 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.34 2011/06/21 09:36:46 mrg Exp $ */
+/* $NetBSD: lfs.c,v 1.35 2011/07/12 02:46:03 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -362,7 +362,6 @@
 	/* ip->i_vnode = vp; */
 	ip->i_number = ino;
 	ip->i_lockf = 0;
-	ip->i_diroff = 0;
 	ip->i_lfs_effnblks = 0;
 	ip->i_flag = 0;
 



CVS commit: src/sbin/fsck_lfs

2010-02-21 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Feb 21 16:24:21 UTC 2010

Modified Files:
src/sbin/fsck_lfs: lfs.c

Log Message:
dev_bsize wasn't initialized. The actual value doesn't matter since
the same value is used to compute byte offsets into the special file
but a value of zero causes a division by zero.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sbin/fsck_lfs/lfs.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/fsck_lfs/lfs.c
diff -u src/sbin/fsck_lfs/lfs.c:1.32 src/sbin/fsck_lfs/lfs.c:1.33
--- src/sbin/fsck_lfs/lfs.c:1.32	Tue Feb 16 23:20:30 2010
+++ src/sbin/fsck_lfs/lfs.c	Sun Feb 21 16:24:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.32 2010/02/16 23:20:30 mlelstv Exp $ */
+/* $NetBSD: lfs.c,v 1.33 2010/02/21 16:24:21 mlelstv Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -102,7 +102,7 @@
 extern struct uvnodelst getvnodelist[VNODE_HASH_MAX];
 extern int nvnodes;
 
-long dev_bsize;
+long dev_bsize = DEV_BSIZE;
 
 static int
 lfs_fragextend(struct uvnode *, int, int, daddr_t, struct ubuf **);



CVS commit: src/sbin/fsck_lfs

2010-01-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  7 04:21:28 UTC 2010

Modified Files:
src/sbin/fsck_lfs: utilities.c

Log Message:
missing errno.h


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sbin/fsck_lfs/utilities.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/fsck_lfs/utilities.c
diff -u src/sbin/fsck_lfs/utilities.c:1.29 src/sbin/fsck_lfs/utilities.c:1.30
--- src/sbin/fsck_lfs/utilities.c:1.29	Wed Jan  6 20:39:56 2010
+++ src/sbin/fsck_lfs/utilities.c	Wed Jan  6 23:21:28 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: utilities.c,v 1.29 2010/01/07 01:39:56 christos Exp $	 */
+/* $NetBSD: utilities.c,v 1.30 2010/01/07 04:21:28 christos Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



CVS commit: src/sbin/fsck_lfs

2009-08-05 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Aug  6 00:55:09 UTC 2009

Modified Files:
src/sbin/fsck_lfs: kernelops.c kernelops.h

Log Message:
in const where available


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/fsck_lfs/kernelops.c \
src/sbin/fsck_lfs/kernelops.h

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

Modified files:

Index: src/sbin/fsck_lfs/kernelops.c
diff -u src/sbin/fsck_lfs/kernelops.c:1.1 src/sbin/fsck_lfs/kernelops.c:1.2
--- src/sbin/fsck_lfs/kernelops.c:1.1	Thu Aug  6 00:51:55 2009
+++ src/sbin/fsck_lfs/kernelops.c	Thu Aug  6 00:55:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernelops.c,v 1.1 2009/08/06 00:51:55 pooka Exp $	*/
+/*	$NetBSD: kernelops.c,v 1.2 2009/08/06 00:55:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: kernelops.c,v 1.1 2009/08/06 00:51:55 pooka Exp $");
+__RCSID("$NetBSD: kernelops.c,v 1.2 2009/08/06 00:55:08 pooka Exp $");
 #endif /* !lint */
 
 /*
@@ -54,7 +54,7 @@
 #include 
 #include 
 
-struct kernelops kops = {
+const struct kernelops kops = {
 	.ko_open = rump_sys_open,
 	.ko_fcntl = rump_sys_fcntl,
 	.ko_statvfs = rump_sys_statvfs1,
@@ -67,7 +67,7 @@
 
 #else
 
-struct kernelops kops = {
+const struct kernelops kops = {
 	.ko_open = (void *)open, /* XXX: fix rump_syscalls */
 	.ko_fcntl = (void *)fcntl,
 	.ko_statvfs = statvfs1,
Index: src/sbin/fsck_lfs/kernelops.h
diff -u src/sbin/fsck_lfs/kernelops.h:1.1 src/sbin/fsck_lfs/kernelops.h:1.2
--- src/sbin/fsck_lfs/kernelops.h:1.1	Thu Aug  6 00:51:55 2009
+++ src/sbin/fsck_lfs/kernelops.h	Thu Aug  6 00:55:08 2009
@@ -17,6 +17,6 @@
 	ssize_t (*ko_pread)(int, void *, size_t, off_t);
 	ssize_t (*ko_pwrite)(int, const void *, size_t, off_t);
 };
-extern struct kernelops kops;
+extern const struct kernelops kops;
 
 #endif /* _LFS_KERNEL_OPS_H_ */