Author: kevans
Date: Sun Mar 29 20:03:46 2020
New Revision: 359427
URL: https://svnweb.freebsd.org/changeset/base/359427

Log:
  fsck_ffs/fsdb: fix -fno-common build
  
  This one is also a small list:
  
  - 3x duplicate definition (ufs2_zino, returntosingle, nflag)
  - 5x 'needs extern', 3/5 of which are referenced in fsdb
  
  -fno-common will become the default in GCC10/LLVM11.
  
  MFC after:    1 week

Modified:
  head/sbin/fsck_ffs/fsck.h
  head/sbin/fsck_ffs/gjournal.c
  head/sbin/fsck_ffs/globs.c
  head/sbin/fsck_ffs/setup.c
  head/sbin/fsdb/fsdb.c

Modified: head/sbin/fsck_ffs/fsck.h
==============================================================================
--- head/sbin/fsck_ffs/fsck.h   Sun Mar 29 19:48:28 2020        (r359426)
+++ head/sbin/fsck_ffs/fsck.h   Sun Mar 29 20:03:46 2020        (r359427)
@@ -127,7 +127,7 @@ struct inostat {
  * Inode state information is contained on per cylinder group lists
  * which are described by the following structure.
  */
-struct inostatlist {
+extern struct inostatlist {
        long    il_numalloced;  /* number of inodes allocated in this cg */
        struct inostat *il_stat;/* inostat info for this cylinder group */
 } *inostathead;
@@ -271,13 +271,13 @@ struct dups {
        struct dups *next;
        ufs2_daddr_t dup;
 };
-struct dups *duplist;          /* head of dup list */
-struct dups *muldup;           /* end of unique duplicate dup block numbers */
+extern struct dups *duplist;           /* head of dup list */
+extern struct dups *muldup;            /* end of unique duplicate dup block 
numbers */
 
 /*
  * Inode cache data structures.
  */
-struct inoinfo {
+extern struct inoinfo {
        struct  inoinfo *i_nexthash;    /* next entry in hash chain */
        ino_t   i_number;               /* inode number of this entry */
        ino_t   i_parent;               /* inode number of parent */

Modified: head/sbin/fsck_ffs/gjournal.c
==============================================================================
--- head/sbin/fsck_ffs/gjournal.c       Sun Mar 29 19:48:28 2020        
(r359426)
+++ head/sbin/fsck_ffs/gjournal.c       Sun Mar 29 20:03:46 2020        
(r359427)
@@ -93,7 +93,6 @@ static LIST_HEAD(, cgchain) cglist = LIST_HEAD_INITIAL
 static const char *devnam;
 static struct uufsd *diskp = NULL;
 static struct fs *fs = NULL;
-struct ufs2_dinode ufs2_zino;
 
 static void putcgs(void);
 

Modified: head/sbin/fsck_ffs/globs.c
==============================================================================
--- head/sbin/fsck_ffs/globs.c  Sun Mar 29 19:48:28 2020        (r359426)
+++ head/sbin/fsck_ffs/globs.c  Sun Mar 29 20:03:46 2020        (r359427)
@@ -117,6 +117,10 @@ volatile sig_atomic_t      got_sigalarm;   /* received a 
SIGA
 struct ufs1_dinode ufs1_zino;
 struct ufs2_dinode ufs2_zino;
 
+struct dups *duplist;
+struct dups *muldup;
+struct inostatlist *inostathead;
+
 void
 fsckinit(void)
 {

Modified: head/sbin/fsck_ffs/setup.c
==============================================================================
--- head/sbin/fsck_ffs/setup.c  Sun Mar 29 19:48:28 2020        (r359426)
+++ head/sbin/fsck_ffs/setup.c  Sun Mar 29 20:03:46 2020        (r359427)
@@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$");
 
 #include "fsck.h"
 
+struct inoinfo **inphead, **inpsort;
+
 struct uufsd disk;
 struct bufarea asblk;
 #define altsblock (*asblk.b_un.b_fs)

Modified: head/sbin/fsdb/fsdb.c
==============================================================================
--- head/sbin/fsdb/fsdb.c       Sun Mar 29 19:48:28 2020        (r359426)
+++ head/sbin/fsdb/fsdb.c       Sun Mar 29 20:03:46 2020        (r359427)
@@ -70,9 +70,6 @@ usage(void)
        exit(1);
 }
 
-int returntosingle;
-char nflag;
-
 /*
  * We suck in lots of fsck code, and just pick & choose the stuff we want.
  *
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to