]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: make static things static
authorEric Sandeen <sandeen@redhat.com>
Tue, 9 Oct 2018 16:49:48 +0000 (11:49 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 9 Oct 2018 16:49:48 +0000 (11:49 -0500)
There are tons of functions which can be static, make them so.

Fixes many sparse warnings about this.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
43 files changed:
copy/xfs_copy.c
db/btblock.c
db/check.c
db/fsmap.c
db/init.c
db/input.c
db/io.c
db/logformat.c
estimate/xfs_estimate.c
fsr/xfs_fsr.c
io/bmap.c
io/fiemap.c
io/freeze.c
io/fsmap.c
io/imap.c
io/init.c
io/madvise.c
io/mincore.c
io/mmap.c
io/parent.c
io/readdir.c
io/seek.c
io/stat.c
libxcmd/command.c
libxfs/cache.c
libxfs/init.c
libxfs/rdwr.c
libxfs/util.c
logprint/log_misc.c
logprint/log_print_all.c
logprint/logprint.c
mdrestore/xfs_mdrestore.c
mkfs/xfs_mkfs.c
repair/btree.c
repair/incore_ext.c
repair/incore_ino.c
repair/phase6.c
repair/progress.c
repair/sb.c
repair/scan.c
rtcp/xfs_rtcp.c
scrub/scrub.c
spaceman/init.c

index bc73bb4bf8431380bd3f9b8d26b3d98289a3ff61..64761b3a03c7881bb3cdc8801b9e1171cdddd008 100644 (file)
 
 extern int     platform_check_ismounted(char *, char *, struct stat *, int);
 
-int            logfd;
-char           *logfile_name;
-FILE           *logerr;
-char           LOGFILE_NAME[] = "/var/tmp/xfs_copy.log.XXXXXX";
+static char            *logfile_name;
+static FILE            *logerr;
+static char            LOGFILE_NAME[] = "/var/tmp/xfs_copy.log.XXXXXX";
 
-char           *source_name;
-int            source_fd;
+static char            *source_name;
+static int             source_fd;
 
-unsigned int   source_blocksize;       /* source filesystem blocksize */
-unsigned int   source_sectorsize;      /* source disk sectorsize */
+static unsigned int    source_blocksize;       /* source filesystem blocksize */
+static unsigned int    source_sectorsize;      /* source disk sectorsize */
 
-xfs_agblock_t  first_agbno;
+static xfs_agblock_t   first_agbno;
 
-uint64_t       barcount[11];
+static uint64_t        barcount[11];
 
-unsigned int   num_targets;
-target_control *target;
+static unsigned int    num_targets;
+static target_control  *target;
 
-wbuf           w_buf;
-wbuf           btree_buf;
+static wbuf            w_buf;
+static wbuf            btree_buf;
 
-unsigned int   kids;
+static unsigned int    kids;
 
-thread_control glob_masks;
-thread_args    *targ;
+static thread_control  glob_masks;
+static thread_args     *targ;
 
-pthread_mutex_t        mainwait;
+static pthread_mutex_t mainwait;
 
 #define ACTIVE         1
 #define INACTIVE       2
@@ -61,7 +60,7 @@ static int    format_logs(struct xfs_mount *);
 #define PRE    0x08            /* append strerror string */
 #define LAST   0x10            /* final message we print */
 
-void
+static void
 signal_maskfunc(int addset, int newset)
 {
        sigset_t set;
@@ -71,7 +70,7 @@ signal_maskfunc(int addset, int newset)
        sigprocmask(newset, &set, NULL);
 }
 
-void
+static void
 do_message(int flags, int code, const char *fmt, ...)
 {
        va_list ap;
@@ -133,7 +132,7 @@ int xlog_recover_do_trans(struct xlog *log, struct xlog_recover *t, int p)
        return 0;
 }
 
-void
+static void
 check_errors(void)
 {
        int     i, first_error = 0;
@@ -167,7 +166,7 @@ check_errors(void)
  * don't have to worry about alignment and mins because those
  * are taken care of when the buffer's read in
  */
-int
+static int
 do_write(
        thread_args     *args,
        wbuf            *buf)
@@ -200,7 +199,7 @@ do_write(
        return error;
 }
 
-void *
+static void *
 begin_reader(void *arg)
 {
        thread_args     *args = arg;
@@ -228,7 +227,7 @@ handle_error:
        return NULL;
 }
 
-void
+static void
 handler(int sig)
 {
        pid_t   pid;
@@ -290,7 +289,7 @@ handler(int sig)
        signal(SIGCHLD, handler);
 }
 
-void
+static void
 usage(void)
 {
        fprintf(stderr,
@@ -299,7 +298,7 @@ usage(void)
        exit(1);
 }
 
-void
+static void
 init_bar(uint64_t source_blocks)
 {
        int     i;
@@ -308,7 +307,7 @@ init_bar(uint64_t source_blocks)
                barcount[i] = (source_blocks/10)*i;
 }
 
-int
+static int
 bump_bar(int tenths, uint64_t numblocks)
 {
        static char *bar[11] = {
@@ -340,7 +339,7 @@ bump_bar(int tenths, uint64_t numblocks)
 
 static xfs_off_t source_position = -1;
 
-wbuf *
+static wbuf *
 wbuf_init(wbuf *buf, int data_size, int data_align, int min_io_size, int id)
 {
        ASSERT(data_size % BBSIZE == 0);
@@ -357,7 +356,7 @@ wbuf_init(wbuf *buf, int data_size, int data_align, int min_io_size, int id)
        return buf;
 }
 
-void
+static void
 read_wbuf(int fd, wbuf *buf, xfs_mount_t *mp)
 {
        int             res = 0;
@@ -412,7 +411,7 @@ read_wbuf(int fd, wbuf *buf, xfs_mount_t *mp)
        buf->length = res;
 }
 
-void
+static void
 read_ag_header(int fd, xfs_agnumber_t agno, wbuf *buf, ag_header_t *ag,
                xfs_mount_t *mp, int blocksize, int sectorsize)
 {
@@ -459,7 +458,7 @@ read_ag_header(int fd, xfs_agnumber_t agno, wbuf *buf, ag_header_t *ag,
 }
 
 
-void
+static void
 write_wbuf(void)
 {
        int             i;
@@ -491,7 +490,7 @@ write_wbuf(void)
        signal_maskfunc(SIGCHLD, SIG_BLOCK);
 }
 
-void
+static void
 sb_update_uuid(
        xfs_sb_t        *sb,            /* Original fs superblock */
        ag_header_t     *ag_hdr,        /* AG hdr to update for this copy */
@@ -528,6 +527,7 @@ int
 main(int argc, char **argv)
 {
        int             i, j;
+       int             logfd;
        int             howfar = 0;
        int             open_flags;
        xfs_off_t       pos;
@@ -1205,7 +1205,7 @@ main(int argc, char **argv)
        return 0;
 }
 
-char *
+static char *
 next_log_chunk(char *p, int offset, void *private)
 {
        wbuf    *buf = (wbuf *)private;
index cbd299062833d463eb8b38035bfd2b60d0f2d3ea..af42bf73a9d1e783abbe0e0f946f84c43f87351d 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * Definition of the possible btree block layouts.
  */
-struct xfs_db_btree {
+static struct xfs_db_btree {
        uint32_t                magic;
        size_t                  block_len;
        size_t                  key_len;
index e85afb9e7c65df087871e337eca1d94819aa1d48..e0fd9860b7abb77efcf9e95f92155402f30d16be 100644 (file)
@@ -996,7 +996,7 @@ blocktrash_b(
                bit_offset / NBBY, bit_offset % NBBY, modestr[mode]);
 }
 
-int
+static int
 blocktrash_f(
        int             argc,
        char            **argv)
@@ -1204,7 +1204,7 @@ out:
        return 0;
 }
 
-int
+static int
 blockuse_f(
        int             argc,
        char            **argv)
index 483638102d3c3f8cea60938257e10f2c533bbc95..29f3827c54c419ebbcf97a510a9ed0b2c06a473c 100644 (file)
@@ -99,7 +99,7 @@ fsmap(
        }
 }
 
-int
+static int
 fsmap_f(
        int                     argc,
        char                    **argv)
index a70b02b441f23569ec2a60432510ba3ea8c528df..455220a866f9fbe495be2f2eea5c05d264e43a89 100644 (file)
--- a/db/init.c
+++ b/db/init.c
@@ -23,10 +23,10 @@ char                        *fsdevice;
 int                    blkbb;
 int                    exitcode;
 int                    expert_mode;
-int                    force;
-struct xfs_mount       xmount;
+static int             force;
+static struct xfs_mount        xmount;
 struct xfs_mount       *mp;
-struct xlog            xlog;
+static struct xlog     xlog;
 libxfs_init_t          x;
 xfs_agnumber_t         cur_agno = NULLAGNUMBER;
 
@@ -39,7 +39,7 @@ usage(void)
        exit(1);
 }
 
-void
+static void
 init(
        int             argc,
        char            **argv)
index 9c59a5678ffdfa2a2a77ee49f4c521f4e40c6fc9..4d6c73761b0ba364401497990feff07993d26860 100644 (file)
@@ -20,9 +20,9 @@
 # include <histedit.h>
 #endif
 
-int    inputstacksize;
-FILE   **inputstack;
-FILE   *curinput;
+static int     inputstacksize;
+static FILE    **inputstack;
+static FILE    *curinput;
 
 static void    popfile(void);
 static int     source_f(int argc, char **argv);
diff --git a/db/io.c b/db/io.c
index 8c51b4d5ecb5e98d06048bf21b6195748872c83d..0486ae2e7c5b1943c3677835bac77cec6db2ec49 100644 (file)
--- a/db/io.c
+++ b/db/io.c
@@ -155,7 +155,7 @@ print_iocur(
                ioc->dirino, ioc->typ == NULL ? _("none") : ioc->typ->name);
 }
 
-void
+static void
 print_ring(void)
 {
        int i;
index 4bbab2ac897370ef43211b8e0b4a26b0243d506a..42ce2450be5880145a1398e9da1c7e99365c1328 100644 (file)
@@ -145,7 +145,7 @@ print_logres(
                i, res->tr_logres, res->tr_logcount, res->tr_logflags);
 }
 
-int
+static int
 logres_f(
        int                     argc,
        char                    **argv)
index eaa2cbae9852b55dc73f3dee8229b22a518b6d23..9e01ccec004eca5b2742da5c87ae4a8c2f4ce7d4 100644 (file)
@@ -13,7 +13,7 @@
 #include <sys/stat.h>
 #include <ftw.h>
 
-unsigned long long
+static unsigned long long
 cvtnum(char *s)
 {
        unsigned long long i;
@@ -43,22 +43,22 @@ int ffn(const char *, const struct stat *, int, struct FTW *);
 
 #define FBLOCKS(n)     ((n)/blocksize)
 
-unsigned long long dirsize=0;          /* bytes */
-unsigned long long logsize=LOGSIZE*BLOCKSIZE;  /* bytes */
-unsigned long long fullblocks=0;       /* FS blocks */
-unsigned long long isize=0;            /* inodes bytes */
-unsigned long long blocksize=BLOCKSIZE;
-unsigned long long nslinks=0;          /* number of symbolic links */
-unsigned long long nfiles=0;           /* number of regular files */
-unsigned long long ndirs=0;            /* number of directories */
-unsigned long long nspecial=0;         /* number of special files */
-unsigned long long verbose=0;          /* verbose mode TRUE/FALSE */
-
-int __debug = 0;
-int ilog = 0;
-int elog = 0;
-
-void
+static unsigned long long dirsize=0;           /* bytes */
+static unsigned long long logsize=LOGSIZE*BLOCKSIZE;   /* bytes */
+static unsigned long long fullblocks=0;        /* FS blocks */
+static unsigned long long isize=0;             /* inodes bytes */
+static unsigned long long blocksize=BLOCKSIZE;
+static unsigned long long nslinks=0;           /* number of symbolic links */
+static unsigned long long nfiles=0;            /* number of regular files */
+static unsigned long long ndirs=0;             /* number of directories */
+static unsigned long long nspecial=0;          /* number of special files */
+static unsigned long long verbose=0;           /* verbose mode TRUE/FALSE */
+
+static int __debug = 0;
+static int ilog = 0;
+static  int elog = 0;
+
+static void
 usage(char *progname)
 {
        fprintf(stderr,
index c8aea9804e517a0e1e9738ed1b29266b4c92a469..fef6262c8fd489b6c06799cf677c4e2c57bcd115 100644 (file)
 
 char *progname;
 
-int vflag;
-int gflag;
+static int vflag;
+static int gflag;
 static int Mflag;
 /* static int nflag; */
-int dflag = 0;
+static int dflag = 0;
 /* static int sflag; */
-int argv_blksz_dio;
+static int argv_blksz_dio;
 extern int max_ext_size;
 static int npasses = 10;
 static int startpass = 0;
 
-struct getbmap  *outmap = NULL;
-int             outmap_size = 0;
-int            RealUid;
-int            tmp_agi;
+static struct getbmap  *outmap = NULL;
+static int             outmap_size = 0;
+static int             RealUid;
+static int             tmp_agi;
 static int64_t         minimumfree = 2048;
 
 #define MNTTYPE_XFS             "xfs"
@@ -85,7 +85,7 @@ static char * tmp_next(char *mnt);
 static void tmp_close(char *mnt);
 int xfs_getgeom(int , xfs_fsop_geom_v1_t * );
 
-xfs_fsop_geom_v1_t fsgeom;     /* geometry of active mounted system */
+static xfs_fsop_geom_v1_t fsgeom;      /* geometry of active mounted system */
 
 #define NMOUNT 64
 static int numfs;
@@ -96,19 +96,19 @@ typedef struct fsdesc {
        int  npass;
 } fsdesc_t;
 
-fsdesc_t       *fs, *fsbase, *fsend;
-int            fsbufsize = 10; /* A starting value */
-int            nfrags = 0;     /* Debug option: Coerse into specific number
+static fsdesc_t        *fs, *fsbase, *fsend;
+static int     fsbufsize = 10; /* A starting value */
+static int     nfrags = 0;     /* Debug option: Coerse into specific number
                                 * of extents */
-int            openopts = O_CREAT|O_EXCL|O_RDWR|O_DIRECT;
+static int     openopts = O_CREAT|O_EXCL|O_RDWR|O_DIRECT;
 
-int
+static int
 xfs_fsgeometry(int fd, xfs_fsop_geom_v1_t *geom)
 {
     return ioctl(fd, XFS_IOC_FSGEOMETRY_V1, geom);
 }
 
-int
+static int
 xfs_bulkstat_single(int fd, xfs_ino_t *lastip, xfs_bstat_t *ubuffer)
 {
     xfs_fsop_bulkreq_t  bulkreq;
@@ -120,7 +120,7 @@ xfs_bulkstat_single(int fd, xfs_ino_t *lastip, xfs_bstat_t *ubuffer)
     return ioctl(fd, XFS_IOC_FSBULKSTAT_SINGLE, &bulkreq);
 }
 
-int
+static int
 xfs_bulkstat(int fd, xfs_ino_t *lastip, int icount,
                     xfs_bstat_t *ubuffer, __s32 *ocount)
 {
@@ -133,19 +133,19 @@ xfs_bulkstat(int fd, xfs_ino_t *lastip, int icount,
     return ioctl(fd, XFS_IOC_FSBULKSTAT, &bulkreq);
 }
 
-int
+static int
 xfs_swapext(int fd, xfs_swapext_t *sx)
 {
     return ioctl(fd, XFS_IOC_SWAPEXT, sx);
 }
 
-int
+static int
 xfs_fscounts(int fd, xfs_fsop_counts_t *counts)
 {
     return ioctl(fd, XFS_IOC_FSCOUNTS, counts);
 }
 
-void
+static void
 aborter(int unused)
 {
        fsrall_cleanup(1);
@@ -1586,7 +1586,7 @@ int       read_fd_bmap(int fd, xfs_bstat_t *sin, int *cur_nextents)
 /*
  * Read the block map and return the number of extents.
  */
-int
+static int
 getnextents(int fd)
 {
        int             nextents;
index f917831b8a0560e1ecf94f071b883bae0f38e0d9..d408826a2278792768435a2a2885a4308244cd43 100644 (file)
--- a/io/bmap.c
+++ b/io/bmap.c
@@ -43,7 +43,7 @@ bmap_help(void)
 "\n"));
 }
 
-int
+static int
 bmap_f(
        int                     argc,
        char                    **argv)
index 8090dc4a0dd1514a7510cb0e515fdfc59b217534..485bae16ebaa9a1ac92e0c31e0834be9e51d1026 100644 (file)
@@ -214,7 +214,7 @@ calc_print_format(
        }
 }
 
-int
+static int
 fiemap_f(
        int             argc,
        char            **argv)
index b52df9168febc3e478fcfd19890f924d0243d792..3333b08ad000e91e9b57537d5158d73c93d1f15f 100644 (file)
@@ -12,7 +12,7 @@
 static cmdinfo_t freeze_cmd;
 static cmdinfo_t thaw_cmd;
 
-int
+static int
 freeze_f(
        int             argc,
        char            **argv)
@@ -29,7 +29,7 @@ freeze_f(
        return 0;
 }
 
-int
+static int
 thaw_f(
        int             argc,
        char            **argv)
index 0bc8ae64bebe660af28ce6f0af4f7ad2bf930b46..477c36fcbd58442f69a0642b0a20240de7f49138 100644 (file)
@@ -364,7 +364,7 @@ dump_verbose_key(void)
                NFLG+1, NFLG+1, FLG_ESW);
 }
 
-int
+static int
 fsmap_f(
        int                     argc,
        char                    **argv)
index 048d1a4eb3b9b4e7511a7933a1e02e5d9d4c3d0c..fbc8e9e1b4605b0d588d0188563c3269a0a45638 100644 (file)
--- a/io/imap.c
+++ b/io/imap.c
@@ -11,7 +11,7 @@
 
 static cmdinfo_t imap_cmd;
 
-int
+static int
 imap_f(int argc, char **argv)
 {
        int             count;
index 29afe09a6a29b8de7f714de672f04612574f81db..b5eade3901af4509e5fb44a8c545dba830faa028 100644 (file)
--- a/io/init.c
+++ b/io/init.c
 char   *progname;
 int    exitcode;
 int    expert;
-int    idlethread;
+static int     idlethread;
 size_t pagesize;
 struct timeval stopwatch;
 
-void
+static void
 usage(void)
 {
        fprintf(stderr,
@@ -124,7 +124,7 @@ init_check_command(
        return 1;
 }
 
-void
+static void
 init(
        int             argc,
        char            **argv)
@@ -235,7 +235,7 @@ init(
  * are not reference counted. Spawning an idle thread can help detecting file
  * struct reference leaks.
  */
-void *
+static void *
 idle_loop(void *arg)
 {
        for (;;)
@@ -243,7 +243,7 @@ idle_loop(void *arg)
        return NULL;
 }
 
-void
+static void
 start_idle_thread(void)
 {
        pthread_t t;
index c001a2ff6db9d8f1e2862eceed1fd06fbfce4f2b..9f6c010d8a33d510ce961d079b23f7de62562185 100644 (file)
@@ -34,7 +34,7 @@ madvise_help(void)
 "\n"));
 }
 
-int
+static int
 madvise_f(
        int             argc,
        char            **argv)
index c4f354c5f9bc7e51f1ac3084ca7649180949a086..239134fedc8bdf423c93b57d08797b0f2a6d801a 100644 (file)
@@ -12,7 +12,7 @@
 
 static cmdinfo_t mincore_cmd;
 
-int
+static int
 mincore_f(
        int             argc,
        char            **argv)
index dbfcca5358a42e33bc0c33817d678cf3895a06c8..44749bb65c3724ba27274b302d8314e014638d61 100644 (file)
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -290,7 +290,7 @@ msync_help(void)
 "\n"));
 }
 
-int
+static int
 msync_f(
        int             argc,
        char            **argv)
@@ -374,7 +374,7 @@ mread_help(void)
 "\n"));
 }
 
-int
+static int
 mread_f(
        int             argc,
        char            **argv)
@@ -477,7 +477,7 @@ mread_f(
        return 0;
 }
 
-int
+static int
 munmap_f(
        int             argc,
        char            **argv)
@@ -531,7 +531,7 @@ mwrite_help(void)
 "\n"));
 }
 
-int
+static int
 mwrite_f(
        int             argc,
        char            **argv)
@@ -618,7 +618,7 @@ mremap_help(void)
 "\n"));
 }
 
-int
+static int
 mremap_f(
        int             argc,
        char            **argv)
index 53ac659f0ff8c6f804239b519771970678d1f952..ffa55f6d6e0dce6c3ba94a3fe5b64862f6119e14 100644 (file)
@@ -358,7 +358,7 @@ error:
        return retval;
 }
 
-int
+static int
 parent_f(int argc, char **argv)
 {
        int c;
index 4321bded95d8b7ef5d6a61afd79ec1e3d970a430..2cb897736faf9b46e3623ba36924b2d64d5c8140 100644 (file)
@@ -18,7 +18,7 @@
 
 static struct cmdinfo readdir_cmd;
 
-const char *d_type_str(unsigned int type)
+static const char *d_type_str(unsigned int type)
 {
        const char *str;
 
index ae6e9f58a5029b7141a6a9656ec09a778a44b09f..59ba1cfd1db33316f28a989a76656829114cd0eb 100644 (file)
--- a/io/seek.c
+++ b/io/seek.c
@@ -49,7 +49,7 @@ seek_help(void)
 #define        DATA            0
 #define        HOLE            1
 
-struct seekinfo {
+static struct seekinfo {
        char            *name;          /* display item name */
        int             seektype;       /* data or hole */
        int             mask;           /* compared for print and looping */
@@ -59,7 +59,7 @@ struct seekinfo {
 };
 
 /* print item type and offset. catch special cases of eof and error */
-void
+static void
 seek_output(
        int     startflag,
        char    *type,
index cde7780a5fcec31abb521dfbb93114ca0e368fce..64662b43480979d472bb4b1b72675e492c6cfc91 100644 (file)
--- a/io/stat.c
+++ b/io/stat.c
@@ -77,7 +77,8 @@ dump_raw_stat(struct stat *st)
        return 0;
 }
 
-void print_file_info(void)
+static void
+print_file_info(void)
 {
        printf(_("fd.path = \"%s\"\n"), file->name);
        printf(_("fd.flags = %s,%s,%s%s%s%s%s\n"),
@@ -90,7 +91,8 @@ void print_file_info(void)
                file->flags & IO_TMPFILE ? _(",tmpfile") : "");
 }
 
-void print_xfs_info(int verbose)
+static void
+print_xfs_info(int verbose)
 {
        struct dioattr  dio;
        struct fsxattr  fsx, fsxa;
@@ -291,7 +293,7 @@ dump_raw_statx(struct statx *stx)
  *     - output style for flags (and all else?) (chars vs. hex?)
  *     - output - mask out incidental flag or not?
  */
-int
+static int
 statx_f(
        int             argc,
        char            **argv)
index ceb359d6ed9b20bba93d412c13a0c4330ee9c49e..a76d15158eb2de4f1ff2a094a43db0a8a1f003bf 100644 (file)
@@ -19,8 +19,8 @@ struct cmdline {
        bool    iterate;
 };
 
-static int     ncmdline;
-struct cmdline *cmdline;
+static int             ncmdline;
+static struct cmdline  *cmdline;
 
 static int
 compare(const void *a, const void *b)
index 77866bc2237ea8ed9598def61dd5e21de6224e66..139c7c1b9e715eb8de818dddbaa1d32d63bffa28 100644 (file)
@@ -77,7 +77,7 @@ cache_init(
        return cache;
 }
 
-void
+static void
 cache_expand(
        struct cache *          cache)
 {
index d7543d4aa549b11680c5d3c9e8a691a9d3c89122..10dcbf3ae4816c6702a5e40990980183782947e7 100644 (file)
@@ -37,7 +37,7 @@ static int manage_zones(int); /* setup/teardown global zones */
  * dev_map - map open devices to fd.
  */
 #define MAX_DEVS 10    /* arbitary maximum */
-int nextfakedev = -1;  /* device number to give to next fake device */
+static int nextfakedev = -1;   /* device number to give to next fake device */
 static struct dev_to_fd {
        dev_t   dev;
        int     fd;
index c160e209a260980a419423966fc2bb48290c84a3..753b9396fbe538dafe9cde701704827ab7cf1740 100644 (file)
@@ -544,7 +544,7 @@ libxfs_bcompare(struct cache_node *node, cache_key_t key)
        return CACHE_MISS;
 }
 
-void
+static void
 libxfs_bprint(xfs_buf_t *bp)
 {
        fprintf(stderr, "Buffer %p blkno=%llu bytes=%u flags=0x%x count=%u\n",
@@ -624,7 +624,7 @@ libxfs_initbuf_map(xfs_buf_t *bp, struct xfs_buftarg *btp,
        bp->b_flags |= LIBXFS_B_DISCONTIG;
 }
 
-xfs_buf_t *
+static xfs_buf_t *
 __libxfs_getbufr(int blen)
 {
        xfs_buf_t       *bp;
@@ -681,7 +681,7 @@ libxfs_getbufr(struct xfs_buftarg *btp, xfs_daddr_t blkno, int bblen)
        return bp;
 }
 
-xfs_buf_t *
+static xfs_buf_t *
 libxfs_getbufr_map(struct xfs_buftarg *btp, xfs_daddr_t blkno, int bblen,
                struct xfs_buf_map *map, int nmaps)
 {
index eb99ef74d7edd4ce8bf10bf909700560e1c38970..993218615d008b745a1efb616b0e1876dab6e6ae 100644 (file)
@@ -230,7 +230,7 @@ xfs_flags2diflags2(
  * This was once shared with the kernel, but has diverged to the point
  * where it's no longer worth the hassle of maintaining common code.
  */
-int
+static int
 libxfs_ialloc(
        xfs_trans_t     *tp,
        xfs_inode_t     *pip,
@@ -380,7 +380,7 @@ libxfs_ialloc(
        return 0;
 }
 
-void
+static void
 libxfs_iprint(
        xfs_inode_t             *ip)
 {
@@ -753,7 +753,7 @@ xfs_inode_verifier_error(
  * repair can validate it against the state of the log.
  */
 xfs_lsn_t      libxfs_max_lsn = 0;
-pthread_mutex_t        libxfs_max_lsn_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t libxfs_max_lsn_lock = PTHREAD_MUTEX_INITIALIZER;
 
 bool
 xfs_log_check_lsn(
index 640c00ef2b67bae32c03dc8bd6189ac9023ee4a1..e2889f0fc93ce2cc5f38eb159f685e671f141d12 100644 (file)
@@ -24,7 +24,7 @@ typedef struct xlog_split_item {
        int                     si_skip;
 } xlog_split_item_t;
 
-xlog_split_item_t *split_list = NULL;
+static xlog_split_item_t *split_list = NULL;
 
 void
 print_xlog_op_line(void)
@@ -33,7 +33,7 @@ print_xlog_op_line(void)
           "--------------------------------------\n");
 }      /* print_xlog_op_line */
 
-void
+static void
 print_xlog_xhdr_line(void)
 {
     printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
@@ -58,7 +58,7 @@ print_stars(void)
  * Given a pointer to a data segment, print out the data as if it were
  * a log operation header.
  */
-void
+static void
 xlog_print_op_header(xlog_op_header_t  *op_head,
                     int                i,
                     char               **ptr)
@@ -98,7 +98,7 @@ xlog_print_op_header(xlog_op_header_t *op_head,
 }      /* xlog_print_op_header */
 
 
-void
+static void
 xlog_print_add_to_trans(xlog_tid_t     tid,
                        int             skip)
 {
@@ -115,7 +115,7 @@ xlog_print_add_to_trans(xlog_tid_t  tid,
 }      /* xlog_print_add_to_trans */
 
 
-int
+static int
 xlog_print_find_tid(xlog_tid_t tid, uint was_cont)
 {
     xlog_split_item_t *listp = split_list;
@@ -149,7 +149,7 @@ xlog_print_find_tid(xlog_tid_t tid, uint was_cont)
     return 1;
 }      /* xlog_print_find_tid */
 
-int
+static int
 xlog_print_trans_header(char **ptr, int len)
 {
     xfs_trans_header_t  *h;
@@ -181,7 +181,7 @@ xlog_print_trans_header(char **ptr, int len)
 }      /* xlog_print_trans_header */
 
 
-int
+static int
 xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
 {
     xfs_buf_log_format_t *f;
@@ -416,7 +416,7 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
 }      /* xlog_print_trans_buffer */
 
 
-int
+static int
 xlog_print_trans_qoff(char **ptr, uint len)
 {
     xfs_qoff_logformat_t *f;
@@ -435,7 +435,7 @@ xlog_print_trans_qoff(char **ptr, uint len)
 }      /* xlog_print_trans_qoff */
 
 
-void
+static void
 xlog_print_trans_inode_core(
        struct xfs_log_dinode   *ip)
 {
@@ -461,7 +461,7 @@ xlog_print_trans_inode_core(
     }
 }
 
-void
+static void
 xlog_print_dir2_sf(
        struct xlog     *log,
        xfs_dir2_sf_hdr_t *sfp,
@@ -496,7 +496,7 @@ xlog_print_dir2_sf(
        }
 }
 
-int
+static int
 xlog_print_trans_inode(
        struct xlog             *log,
        char                    **ptr,
@@ -647,7 +647,7 @@ xlog_print_trans_inode(
 }      /* xlog_print_trans_inode */
 
 
-int
+static int
 xlog_print_trans_dquot(char **ptr, int len, int *i, int num_ops)
 {
     xfs_dq_logformat_t *f;
@@ -755,7 +755,7 @@ xlog_print_lseek(struct xlog *log, int fd, xfs_daddr_t blkno, int whence)
 }      /* xlog_print_lseek */
 
 
-void
+static void
 print_lsn(char         *string,
          __be64        *lsn)
 {
@@ -764,7 +764,7 @@ print_lsn(char              *string,
 }
 
 
-int
+static int
 xlog_print_record(
        struct xlog             *log,
        int                     fd,
@@ -1019,7 +1019,7 @@ xlog_print_record(
 }      /* xlog_print_record */
 
 
-int
+static int
 xlog_print_rec_head(xlog_rec_header_t *head, int *len, int bad_hdr_warn)
 {
     int i;
@@ -1093,7 +1093,7 @@ xlog_print_rec_head(xlog_rec_header_t *head, int *len, int bad_hdr_warn)
     return(be32_to_cpu(head->h_num_logops));
 }      /* xlog_print_rec_head */
 
-void
+static void
 xlog_print_rec_xhead(xlog_rec_ext_header_t *head, int coverage)
 {
     int i;
@@ -1133,7 +1133,7 @@ print_xlog_bad_header(xfs_daddr_t blkno, char *buf)
            xlog_exit("Bad log record header");
 }      /* print_xlog_bad_header */
 
-void
+static void
 print_xlog_bad_data(xfs_daddr_t blkno)
 {
        print_stars();
index cd47313909b5d9529cc1e58dbcec76f93b5d3100..eafffe28d1124f4a15e043611c7b664ff7b91845 100644 (file)
@@ -430,7 +430,7 @@ xlog_recover_print_logitem(
        }
 }
 
-void
+static void
 xlog_recover_print_item(
        xlog_recover_item_t     *item)
 {
index 5aaa30c7b90b5cb9bee75771e865445ede45f12f..7754a2a6e22164f44e0e646188b57cceef083ae4 100644 (file)
@@ -25,9 +25,9 @@ int   print_overwrite;
 int     print_no_data;
 int     print_no_print;
 int     print_exit = 1; /* -e is now default. specify -c to override */
-int    print_operation = OP_PRINT;
+static int     print_operation = OP_PRINT;
 
-void
+static void
 usage(void)
 {
        fprintf(stderr, _("Usage: %s [options...] <device>\n\n\
@@ -52,7 +52,7 @@ Options:\n\
        exit(1);
 }
 
-int
+static int
 logstat(xfs_mount_t *mp)
 {
        int             fd;
index bb4246f2470e482baa4d4846bf924718c175072d..3375e0806de5b15c4a54121a035b7794221bd0f7 100644 (file)
@@ -8,9 +8,9 @@
 #include "xfs_metadump.h"
 
 char           *progname;
-int            show_progress = 0;
-int            show_info = 0;
-int            progress_since_warning = 0;
+static int     show_progress = 0;
+static int     show_info = 0;
+static int     progress_since_warning = 0;
 
 static void
 fatal(const char *msg, ...)
index 77eb5f0fcfa9388d14a6def21dbc552aeff9cc0a..d1387ddf0539173606ed60d03a6a0354a8e2b09c 100644 (file)
@@ -31,8 +31,8 @@
  * XXX: The configured block and sector sizes are defined as global variables so
  * that they don't need to be passed to getnum/cvtnum().
  */
-unsigned int           blocksize;
-unsigned int           sectorsize;
+static unsigned int            blocksize;
+static unsigned int            sectorsize;
 
 /*
  * Enums for each CLI parameter type are declared first so we can calculate the
@@ -216,9 +216,9 @@ struct opt_params {
  * about tables that haven't yet been defined. Work around this ordering
  * issue with extern definitions here.
  */
-extern struct opt_params sopts;
+static struct opt_params sopts;
 
-struct opt_params bopts = {
+static struct opt_params bopts = {
        .name = 'b',
        .subopts = {
                [B_SIZE] = "size",
@@ -235,7 +235,7 @@ struct opt_params bopts = {
        },
 };
 
-struct opt_params dopts = {
+static struct opt_params dopts = {
        .name = 'd',
        .subopts = {
                [D_AGCOUNT] = "agcount",
@@ -372,7 +372,7 @@ struct opt_params dopts = {
 };
 
 
-struct opt_params iopts = {
+static struct opt_params iopts = {
        .name = 'i',
        .subopts = {
                [I_ALIGN] = "align",
@@ -433,7 +433,7 @@ struct opt_params iopts = {
        },
 };
 
-struct opt_params lopts = {
+static struct opt_params lopts = {
        .name = 'l',
        .subopts = {
                [L_AGNUM] = "agnum",
@@ -532,7 +532,7 @@ struct opt_params lopts = {
        },
 };
 
-struct opt_params nopts = {
+static struct opt_params nopts = {
        .name = 'n',
        .subopts = {
                [N_SIZE] = "size",
@@ -563,7 +563,7 @@ struct opt_params nopts = {
        },
 };
 
-struct opt_params ropts = {
+static struct opt_params ropts = {
        .name = 'r',
        .subopts = {
                [R_EXTSIZE] = "extsize",
@@ -613,7 +613,7 @@ struct opt_params ropts = {
        },
 };
 
-struct opt_params sopts = {
+static struct opt_params sopts = {
        .name = 's',
        .subopts = {
                [S_SIZE] = "size",
@@ -643,7 +643,7 @@ struct opt_params sopts = {
        },
 };
 
-struct opt_params mopts = {
+static struct opt_params mopts = {
        .name = 'm',
        .subopts = {
                [M_CRC] = "crc",
@@ -1664,7 +1664,7 @@ sector_opts_parser(
        return 0;
 }
 
-struct subopts {
+static struct subopts {
        char            opt;
        struct opt_params *opts;
        int             (*parser)(struct opt_params     *opts,
@@ -2971,7 +2971,7 @@ _("Due to stripe alignment, the internal log size (%lld) is too large.\n"
        }
 }
 
-void
+static void
 validate_log_size(uint64_t logblocks, int blocklog, int min_logblocks)
 {
        if (logblocks < min_logblocks) {
index dd7717be5150874f3d5d4611cfc490aa8e3cef54..a402d0a67349fac77a9fd2972366f9d181b85929 100644 (file)
@@ -444,7 +444,7 @@ btree_lookup_prev(
        return value;
 }
 
-void *
+static void *
 btree_uncached_lookup(
        struct btree_root       *root,
        unsigned long           key)
index 0624d6daea7002ae793601bd03213224fc63789c..e7ef9eb234b3deabd605d0de9957adadaace8576 100644 (file)
@@ -144,7 +144,7 @@ release_extent_tree_node(extent_tree_node_t *node)
  * reused.  the duplicate and bno/bcnt extent trees for each AG
  * are recycled after they're no longer needed to save memory
  */
-void
+static void
 release_extent_tree(avltree_desc_t *tree)
 {
        extent_tree_node_t      *ext;
@@ -517,12 +517,12 @@ avl_ext_bcnt_end(avlnode_t *node)
        return((uintptr_t) ((extent_tree_node_t *)node)->ex_blockcount);
 }
 
-avlops_t avl_extent_bcnt_tree_ops = {
+static avlops_t avl_extent_bcnt_tree_ops = {
        avl_ext_bcnt_start,
        avl_ext_bcnt_end
 };
 
-avlops_t avl_extent_tree_ops = {
+static avlops_t avl_extent_tree_ops = {
        avl_ext_start,
        avl_ext_end
 };
@@ -714,7 +714,7 @@ avl64_ext_end(avl64node_t *node)
                ((rt_extent_tree_node_t *) node)->rt_blockcount);
 }
 
-avl64ops_t avl64_extent_tree_ops = {
+static avl64ops_t avl64_extent_tree_ops = {
        avl64_rt_ext_start,
        avl64_ext_end
 };
@@ -792,7 +792,7 @@ incore_ext_teardown(xfs_mount_t *mp)
        extent_bno_ptrs = NULL;
 }
 
-int
+static int
 count_extents(xfs_agnumber_t agno, avltree_desc_t *tree, int whichtree)
 {
        extent_tree_node_t *node;
index ed10d064d0a61ad35be414d37230de34784c85de..82956ae930051f4c927bad32e0744b63cec99860 100644 (file)
@@ -535,7 +535,7 @@ set_inode_free_alloc(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t ino)
        return(ino_rec);
 }
 
-void
+static void
 print_inode_list_int(xfs_agnumber_t agno, int uncertain)
 {
        ino_tree_node_t *ino_rec;
@@ -776,7 +776,7 @@ avl_ino_end(avlnode_t *node)
                XFS_INODES_PER_CHUNK));
 }
 
-avlops_t avl_ino_tree_ops = {
+static avlops_t avl_ino_tree_ops = {
        avl_ino_start,
        avl_ino_end
 };
index e2e4446a00cdf270b43778dc589696b26899370c..e017326951f59c05e01d0f1ad31dac1dbd62dcdc 100644 (file)
@@ -513,7 +513,7 @@ res_failed(
                do_error(_("xfs_trans_reserve returned %d\n"), err);
 }
 
-void
+static void
 mk_rbmino(xfs_mount_t *mp)
 {
        xfs_trans_t     *tp;
index b049fd1f1694712ac738ed7efd04db48b49eda82..5ee08229c07ecf682cf6d8a51926249bb6c0bfff 100644 (file)
@@ -81,7 +81,7 @@ progress_rpt_t progress_rpt_reports[] = {
        &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}
 };
 
-pthread_t      report_thread;
+static pthread_t       report_thread;
 
 typedef struct msg_block_s {
        pthread_mutex_t mutex;
index 94a4726b25de5abaddc2fc98adf72a5b1292435b..059422c56328fd21c93ff4fddab27ef21c2c9bfd 100644 (file)
@@ -71,7 +71,7 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest)
        memset(source->sb_fname, 0, 12);
 }
 
-int
+static int
 verify_sb_blocksize(xfs_sb_t *sb)
 {
        /* check to make sure blocksize is legal 2^N, 9 <= N <= 16 */
index 4bcc626ae59fbefeeda8a2d1e3f7e9177e678cbe..65a76e26bd25c1ab028bab6bf769b57d631b328b 100644 (file)
@@ -1449,7 +1449,7 @@ enum inobt_type {
        INOBT,
        FINOBT
 };
-const char *inobt_names[] =    {
+static const char *inobt_names[] = {
        "inobt",
        "finobt"
 };
index a77561d38b06c203716b021647d6e56e1eda4fe3..f928a86ac7032ca13b2f6686184374f389e3ad9b 100644 (file)
@@ -9,10 +9,10 @@
 int rtcp(char *, char *, int);
 int xfsrtextsize(char *path);
 
-int pflag;
+static int pflag;
 char *progname;
 
-void
+static void
 usage(void)
 {
        fprintf(stderr, _("%s [-e extsize] [-p] [-V] source target\n"), progname);
index 0059adb40f1a5f2f4809115cc79f96306b364591..0f0c9639b41d7cf352c14e9f4c9dc383610ca9b5 100644 (file)
@@ -305,7 +305,7 @@ _("Optimizations of %s are possible."), scrubbers[i].name);
 }
 
 /* Save a scrub context for later repairs. */
-bool
+static bool
 xfs_scrub_save_repair(
        struct scrub_ctx                *ctx,
        struct xfs_action_list          *alist,
index 68bd8a0237025ec3a3f5f9e0f6e9f7a87471d6f6..181a3446282b3d25188679e72864e6473c6e0802 100644 (file)
@@ -14,7 +14,7 @@
 char   *progname;
 int    exitcode;
 
-void
+static void
 usage(void)
 {
        fprintf(stderr,
@@ -54,7 +54,7 @@ init_check_command(
        return 1;
 }
 
-void
+static void
 init(
        int             argc,
        char            **argv)