+// SPDX-License-Identifier: GPL-2.0
/*
- * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like. Any license provided herein, whether implied or
- * otherwise, applies only to this software file. Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA 94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
*/
-#include <libxfs.h>
-
-#define EXTERN
#include "globals.h"
+/* global variables for xfs_repair */
+
+/* arguments and argument flag variables */
+
+char *fs_name; /* name of filesystem */
+int verbose; /* verbose flag, mostly for debugging */
+
+
+/* for reading stuff in manually (bypassing libsim) */
+
+char *iobuf; /* large buffer */
+int iobuf_size;
+char *smallbuf; /* small (1-4 page) buffer */
+int smallbuf_size;
+int sbbuf_size;
+
+/* direct I/O info */
+
+int minio_align; /* min I/O size and alignment */
+int mem_align; /* memory alignment */
+int max_iosize; /* max I/O size */
+
+/* file descriptors */
+
+int fs_fd; /* filesystem fd */
+
+/* command-line flags */
+
+int verbose;
+int no_modify;
+int dangerously; /* live dangerously ... fix ro mount */
+int isa_file;
+int zap_log;
+int dumpcore; /* abort, not exit on fatal errs */
+int force_geo; /* can set geo on low confidence info */
+int assume_xfs; /* assume we have an xfs fs */
+char *log_name; /* Name of log device */
+int log_spec; /* Log dev specified as option */
+char *rt_name; /* Name of realtime device */
+int rt_spec; /* Realtime dev specified as option */
+int convert_lazy_count; /* Convert lazy-count mode on/off */
+int lazy_count; /* What to set if to if converting */
+
+/* misc status variables */
+
+int primary_sb_modified;
+int bad_ino_btree;
+int copied_sunit;
+int fs_is_dirty;
+
+/* for hunting down the root inode */
+
+int need_root_inode;
+int need_root_dotdot;
+
+int need_rbmino;
+int need_rsumino;
+
+int lost_quotas;
+int have_uquotino;
+int have_gquotino;
+int have_pquotino;
+int lost_uquotino;
+int lost_gquotino;
+int lost_pquotino;
+
+xfs_agino_t first_prealloc_ino;
+xfs_agino_t last_prealloc_ino;
+xfs_agblock_t bnobt_root;
+xfs_agblock_t bcntbt_root;
+xfs_agblock_t inobt_root;
+
+/* configuration vars -- fs geometry dependent */
+
+int inodes_per_block;
+int inodes_per_cluster;
+unsigned int glob_agcount;
+int chunks_pblock; /* # of 64-ino chunks per allocation */
+int max_symlink_blocks;
+int64_t fs_max_file_offset;
+
+/* realtime info */
+
+xfs_rtword_t *btmcompute;
+xfs_suminfo_t *sumcompute;
+
+/* inode tree records have full or partial backptr fields ? */
+
+int full_ino_ex_data; /*
+ * if 1, use ino_ex_data_t component
+ * of ino_un union, if 0, use
+ * parent_list_t component. see
+ * incore.h for more details
+ */
+
+#define ORPHANAGE "lost+found"
+
+/* superblock counters */
+
+uint64_t sb_icount; /* allocated (made) inodes */
+uint64_t sb_ifree; /* free inodes */
+uint64_t sb_fdblocks; /* free data blocks */
+uint64_t sb_frextents; /* free realtime extents */
+
+/* superblock geometry info */
+
+xfs_extlen_t sb_inoalignmt;
+uint32_t sb_unit;
+uint32_t sb_width;
+
+struct aglock *ag_locks;
+
+int report_interval;
+uint64_t *prog_rpt_done;
+
+int ag_stride;
+int thread_count;