Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Use VFS_PROTOS() for lfs.



details:   https://anonhg.NetBSD.org/src/rev/d0c3eb559fb4
branches:  trunk
changeset: 338600:d0c3eb559fb4
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun May 31 15:44:30 2015 +0000

description:
Use VFS_PROTOS() for lfs.
Rename conflicting struct lfs field "lfs_start" to "lfs_s0addr".

No functional change.

diffstat:

 sbin/fsck_lfs/lfs.c        |   6 +++---
 sbin/fsck_lfs/pass5.c      |   8 ++++----
 sbin/fsck_lfs/pass6.c      |   8 ++++----
 sbin/fsck_lfs/segwrite.c   |   8 ++++----
 sbin/fsck_lfs/setup.c      |   4 ++--
 sbin/newfs_lfs/make_lfs.c  |  18 +++++++++---------
 sys/ufs/lfs/lfs.h          |   8 ++++----
 sys/ufs/lfs/lfs_extern.h   |  14 ++------------
 sys/ufs/lfs/lfs_segment.c  |  10 +++++-----
 sys/ufs/lfs/lfs_syscalls.c |   8 ++++----
 sys/ufs/lfs/lfs_vfsops.c   |  10 ++++------
 usr.sbin/dumplfs/dumplfs.c |  14 +++++++-------
 12 files changed, 52 insertions(+), 64 deletions(-)

diffs (truncated from 417 to 300 lines):

diff -r b60184a464f4 -r d0c3eb559fb4 sbin/fsck_lfs/lfs.c
--- a/sbin/fsck_lfs/lfs.c       Sun May 31 15:08:14 2015 +0000
+++ b/sbin/fsck_lfs/lfs.c       Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.44 2015/03/29 19:35:58 chopps Exp $ */
+/* $NetBSD: lfs.c,v 1.45 2015/05/31 15:44:30 hannken Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -528,7 +528,7 @@
        if (fs->lfs_version < 2) {
                fs->lfs_sumsize = LFS_V1_SUMMARY_SIZE;
                fs->lfs_ibsize = fs->lfs_bsize;
-               fs->lfs_start = fs->lfs_sboffs[0];
+               fs->lfs_s0addr = fs->lfs_sboffs[0];
                fs->lfs_tstamp = fs->lfs_otstamp;
                fs->lfs_fsbtodb = 0;
        }
@@ -586,7 +586,7 @@
                 * Don't mistakenly read a superblock, if there is one here.
                 */
                if (lfs_sntod(osb, lfs_dtosn(osb, daddr)) == daddr) {
-                       if (daddr == osb->lfs_start)
+                       if (daddr == osb->lfs_s0addr)
                                daddr += lfs_btofsb(osb, LFS_LABELPAD);
                        for (i = 0; i < LFS_MAXNUMSB; i++) {
                                if (osb->lfs_sboffs[i] < daddr)
diff -r b60184a464f4 -r d0c3eb559fb4 sbin/fsck_lfs/pass5.c
--- a/sbin/fsck_lfs/pass5.c     Sun May 31 15:08:14 2015 +0000
+++ b/sbin/fsck_lfs/pass5.c     Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass5.c,v 1.28 2013/06/18 18:18:58 christos Exp $   */
+/* $NetBSD: pass5.c,v 1.29 2015/05/31 15:44:30 hannken Exp $    */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -120,9 +120,9 @@
                        if (su->su_flags & SEGUSE_SUPERBLOCK)
                                avail -= lfs_btofsb(fs, LFS_SBPAD);
                        if (i == 0 && fs->lfs_version > 1 &&
-                           fs->lfs_start < lfs_btofsb(fs, LFS_LABELPAD))
+                           fs->lfs_s0addr < lfs_btofsb(fs, LFS_LABELPAD))
                                avail -= lfs_btofsb(fs, LFS_LABELPAD) -
-                                   fs->lfs_start;
+                                   fs->lfs_s0addr;
                }
                if (diddirty)
                        VOP_BWRITE(bp);
@@ -169,7 +169,7 @@
 
        labelskew = 0;
        if (fs->lfs_version > 1 &&
-           fs->lfs_start < lfs_btofsb(fs, LFS_LABELPAD))
+           fs->lfs_s0addr < lfs_btofsb(fs, LFS_LABELPAD))
                labelskew = lfs_btofsb(fs, LFS_LABELPAD);
        if (fs->lfs_bfree > fs->lfs_dsize - bb - labelskew ||
            fs->lfs_bfree < fs->lfs_dsize - ubb - labelskew) {
diff -r b60184a464f4 -r d0c3eb559fb4 sbin/fsck_lfs/pass6.c
--- a/sbin/fsck_lfs/pass6.c     Sun May 31 15:08:14 2015 +0000
+++ b/sbin/fsck_lfs/pass6.c     Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.33 2015/03/29 19:35:58 chopps Exp $     */
+/* $NetBSD: pass6.c,v 1.34 2015/05/31 15:44:30 hannken Exp $    */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -596,7 +596,7 @@
 
                /* Could be a superblock */
                if (lfs_sntod(fs, lfs_dtosn(fs, daddr)) == daddr) {
-                       if (daddr == fs->lfs_start) {
+                       if (daddr == fs->lfs_s0addr) {
                                ++hassuper;
                                daddr += lfs_btofsb(fs, LFS_LABELPAD);
                        }
@@ -825,7 +825,7 @@
 
                /* Could be a superblock */
                if (lfs_sntod(fs, lfs_dtosn(fs, daddr)) == daddr) {
-                       if (daddr == fs->lfs_start)
+                       if (daddr == fs->lfs_s0addr)
                                daddr += lfs_btofsb(fs, LFS_LABELPAD);
                        for (i = 0; i < LFS_MAXNUMSB; i++) {
                                if (daddr == fs->lfs_sboffs[i]) {
@@ -863,7 +863,7 @@
 
        /* Final address could also be a superblock */
        if (lfs_sntod(fs, lfs_dtosn(fs, lastgood)) == lastgood) {
-               if (lastgood == fs->lfs_start)
+               if (lastgood == fs->lfs_s0addr)
                        lastgood += lfs_btofsb(fs, LFS_LABELPAD);
                for (i = 0; i < LFS_MAXNUMSB; i++) {
                        if (lastgood == fs->lfs_sboffs[i])
diff -r b60184a464f4 -r d0c3eb559fb4 sbin/fsck_lfs/segwrite.c
--- a/sbin/fsck_lfs/segwrite.c  Sun May 31 15:08:14 2015 +0000
+++ b/sbin/fsck_lfs/segwrite.c  Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: segwrite.c,v 1.28 2015/03/29 19:35:58 chopps Exp $ */
+/* $NetBSD: segwrite.c,v 1.29 2015/05/31 15:44:30 hannken Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -634,9 +634,9 @@
                brelse(bp, 0);
                /* Segment zero could also contain the labelpad */
                if (fs->lfs_version > 1 && sp->seg_number == 0 &&
-                   fs->lfs_start < lfs_btofsb(fs, LFS_LABELPAD)) {
-                       fs->lfs_offset += lfs_btofsb(fs, LFS_LABELPAD) - fs->lfs_start;
-                       sp->seg_bytes_left -= LFS_LABELPAD - lfs_fsbtob(fs, fs->lfs_start);
+                   fs->lfs_s0addr < lfs_btofsb(fs, LFS_LABELPAD)) {
+                       fs->lfs_offset += lfs_btofsb(fs, LFS_LABELPAD) - fs->lfs_s0addr;
+                       sp->seg_bytes_left -= LFS_LABELPAD - lfs_fsbtob(fs, fs->lfs_s0addr);
                }
        } else {
                sp->seg_number = lfs_dtosn(fs, fs->lfs_curseg);
diff -r b60184a464f4 -r d0c3eb559fb4 sbin/fsck_lfs/setup.c
--- a/sbin/fsck_lfs/setup.c     Sun May 31 15:08:14 2015 +0000
+++ b/sbin/fsck_lfs/setup.c     Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.45 2015/03/29 19:35:58 chopps Exp $ */
+/* $NetBSD: setup.c,v 1.46 2015/05/31 15:44:30 hannken Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -240,7 +240,7 @@
                                (unsigned long)idaddr);
                tdaddr = lfs_sntod(fs, lfs_dtosn(fs, idaddr));
                if (lfs_sntod(fs, lfs_dtosn(fs, tdaddr)) == tdaddr) {
-                       if (tdaddr == fs->lfs_start)
+                       if (tdaddr == fs->lfs_s0addr)
                                tdaddr += lfs_btofsb(fs, LFS_LABELPAD);
                        for (i = 0; i < LFS_MAXNUMSB; i++) {
                                if (fs->lfs_sboffs[i] == tdaddr)
diff -r b60184a464f4 -r d0c3eb559fb4 sbin/newfs_lfs/make_lfs.c
--- a/sbin/newfs_lfs/make_lfs.c Sun May 31 15:08:14 2015 +0000
+++ b/sbin/newfs_lfs/make_lfs.c Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_lfs.c,v 1.30 2015/03/29 19:35:58 chopps Exp $     */
+/*     $NetBSD: make_lfs.c,v 1.31 2015/05/31 15:44:31 hannken Exp $    */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 #if 0
 static char sccsid[] = "@(#)lfs.c      8.5 (Berkeley) 5/24/95";
 #else
-__RCSID("$NetBSD: make_lfs.c,v 1.30 2015/03/29 19:35:58 chopps Exp $");
+__RCSID("$NetBSD: make_lfs.c,v 1.31 2015/05/31 15:44:31 hannken Exp $");
 #endif
 #endif /* not lint */
 
@@ -573,15 +573,15 @@
        }
        fs->lfs_sboffs[0] = label_fsb;
        if (version == 1)
-               fs->lfs_start = fs->lfs_sboffs[0];
+               fs->lfs_s0addr = fs->lfs_sboffs[0];
        else
-               fs->lfs_start = LFS_DBTOFSB(fs, start);
+               fs->lfs_s0addr = LFS_DBTOFSB(fs, start);
         fs->lfs_dsize -= sb_fsb;
        for (i = 1; i < LFS_MAXNUMSB; i++) {
                sb_addr = ((i * sb_interval) * lfs_segtod(fs, 1))
                    + fs->lfs_sboffs[0];
                /* Segment 0 eats the label, except for version 1 */
-               if (fs->lfs_version > 1 && fs->lfs_start < label_fsb)
+               if (fs->lfs_version > 1 && fs->lfs_s0addr < label_fsb)
                        sb_addr -= label_fsb - start;
                if (sb_addr + sizeof(struct dlfs)
                    >= LFS_DBTOFSB(fs, dkw->dkw_size))
@@ -650,7 +650,7 @@
                LFS_SEGENTRY(segp, fs, i, bp);
 
                if (i == 0 &&
-                   fs->lfs_start < lfs_btofsb(fs, LFS_LABELPAD + LFS_SBPAD)) {
+                   fs->lfs_s0addr < lfs_btofsb(fs, LFS_LABELPAD + LFS_SBPAD)) {
                        segp->su_flags = SEGUSE_SUPERBLOCK;
                        fs->lfs_bfree -= sb_fsb;
                        ++j;
@@ -782,9 +782,9 @@
                         if (segp->su_flags & SEGUSE_SUPERBLOCK)
                                 fs->lfs_avail -= lfs_btofsb(fs, LFS_SBPAD);
                         if (i == 0 && fs->lfs_version > 1 &&
-                            fs->lfs_start < lfs_btofsb(fs, LFS_LABELPAD))
+                            fs->lfs_s0addr < lfs_btofsb(fs, LFS_LABELPAD))
                                 fs->lfs_avail -= lfs_btofsb(fs, LFS_LABELPAD) -
-                                    fs->lfs_start;
+                                    fs->lfs_s0addr;
                 }
                brelse(bp, 0);
         }
@@ -795,7 +795,7 @@
         fs->lfs_avail -= lfs_segtod(fs, (fs->lfs_minfreeseg - (fs->lfs_minfreeseg / 2)));
 
         labelskew = 0;
-        if (fs->lfs_version > 1 && fs->lfs_start < lfs_btofsb(fs, LFS_LABELPAD))
+        if (fs->lfs_version > 1 && fs->lfs_s0addr < lfs_btofsb(fs, LFS_LABELPAD))
                 labelskew = lfs_btofsb(fs, LFS_LABELPAD);
         fs->lfs_bfree = fs->lfs_dsize - labelskew - (ubb + bb) / 2;
 
diff -r b60184a464f4 -r d0c3eb559fb4 sys/ufs/lfs/lfs.h
--- a/sys/ufs/lfs/lfs.h Sun May 31 15:08:14 2015 +0000
+++ b/sys/ufs/lfs/lfs.h Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs.h,v 1.161 2015/03/28 19:24:05 maxv Exp $   */
+/*     $NetBSD: lfs.h,v 1.162 2015/05/31 15:44:31 hannken Exp $        */
 
 /*  from NetBSD: dinode.h,v 1.22 2013/01/22 09:39:18 dholland Exp  */
 /*  from NetBSD: dir.h,v 1.21 2009/07/22 04:49:19 dholland Exp  */
@@ -929,7 +929,7 @@
 #define lfs_sumsize lfs_dlfs.dlfs_sumsize
 #define lfs_serial lfs_dlfs.dlfs_serial
 #define lfs_ibsize lfs_dlfs.dlfs_ibsize
-#define lfs_start lfs_dlfs.dlfs_start
+#define lfs_s0addr lfs_dlfs.dlfs_start
 #define lfs_tstamp lfs_dlfs.dlfs_tstamp
 #define lfs_inodefmt lfs_dlfs.dlfs_inodefmt
 #define lfs_interleave lfs_dlfs.dlfs_interleave
@@ -1071,9 +1071,9 @@
                           (fs)->lfs_ssize << (fs)->lfs_blktodb :       \
                           lfs_btofsb((fs), (fs)->lfs_ssize)) * (seg))
 #define        lfs_dtosn(fs, daddr)    /* block address to segment number */   \
-       ((uint32_t)(((daddr) - (fs)->lfs_start) / lfs_segtod((fs), 1)))
+       ((uint32_t)(((daddr) - (fs)->lfs_s0addr) / lfs_segtod((fs), 1)))
 #define lfs_sntod(fs, sn)      /* segment number to disk address */    \
-       ((daddr_t)(lfs_segtod((fs), (sn)) + (fs)->lfs_start))
+       ((daddr_t)(lfs_segtod((fs), (sn)) + (fs)->lfs_s0addr))
 
 /*
  * Structures used by lfs_bmapv and lfs_markv to communicate information
diff -r b60184a464f4 -r d0c3eb559fb4 sys/ufs/lfs/lfs_extern.h
--- a/sys/ufs/lfs/lfs_extern.h  Sun May 31 15:08:14 2015 +0000
+++ b/sys/ufs/lfs/lfs_extern.h  Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_extern.h,v 1.102 2015/03/27 17:27:56 riastradh Exp $       */
+/*     $NetBSD: lfs_extern.h,v 1.103 2015/05/31 15:44:31 hannken Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -223,17 +223,7 @@
 int lfs_markv(struct proc *, fsid_t *, struct block_info *, int);
 
 /* lfs_vfsops.c */
-void lfs_init(void);
-void lfs_reinit(void);
-void lfs_done(void);
-int lfs_mountroot(void);
-int lfs_mount(struct mount *, const char *, void *, size_t *);
-int lfs_unmount(struct mount *, int);
-int lfs_statvfs(struct mount *, struct statvfs *);
-int lfs_sync(struct mount *, int, kauth_cred_t);
-int lfs_vget(struct mount *, ino_t, struct vnode **);
-int lfs_fhtovp(struct mount *, struct fid *, struct vnode **);
-int lfs_vptofh(struct vnode *, struct fid *, size_t *);
+VFS_PROTOS(lfs);
 void lfs_vinit(struct mount *, struct vnode **);
 int lfs_resize_fs(struct lfs *, int);
 
diff -r b60184a464f4 -r d0c3eb559fb4 sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Sun May 31 15:08:14 2015 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_segment.c,v 1.238 2015/04/20 13:44:16 riastradh Exp $      */
+/*     $NetBSD: lfs_segment.c,v 1.239 2015/05/31 15:44:31 hannken Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.238 2015/04/20 13:44:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.239 2015/05/31 15:44:31 hannken Exp $");
 
 #define _VFS_VNODE_PRIVATE     /* XXX: check for VI_MARKER, this has to go */
 
@@ -1784,11 +1784,11 @@
                brelse(bp, 0);
                /* Segment zero could also contain the labelpad */
                if (fs->lfs_version > 1 && sp->seg_number == 0 &&
-                   fs->lfs_start < lfs_btofsb(fs, LFS_LABELPAD)) {
+                   fs->lfs_s0addr < lfs_btofsb(fs, LFS_LABELPAD)) {
                        fs->lfs_offset +=
-                           lfs_btofsb(fs, LFS_LABELPAD) - fs->lfs_start;
+                           lfs_btofsb(fs, LFS_LABELPAD) - fs->lfs_s0addr;
                        sp->seg_bytes_left -=
-                           LFS_LABELPAD - lfs_fsbtob(fs, fs->lfs_start);
+                           LFS_LABELPAD - lfs_fsbtob(fs, fs->lfs_s0addr);
                }
        } else {
                sp->seg_number = lfs_dtosn(fs, fs->lfs_curseg);
diff -r b60184a464f4 -r d0c3eb559fb4 sys/ufs/lfs/lfs_syscalls.c
--- a/sys/ufs/lfs/lfs_syscalls.c        Sun May 31 15:08:14 2015 +0000
+++ b/sys/ufs/lfs/lfs_syscalls.c        Sun May 31 15:44:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_syscalls.c,v 1.157 2015/04/20 13:44:16 riastradh Exp $     */
+/*     $NetBSD: lfs_syscalls.c,v 1.158 2015/05/31 15:44:31 hannken Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007, 2008



Home | Main Index | Thread Index | Old Index