1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * Copyright 1996, 1998, 2000, 2002-2003 Sun Microsystems, Inc. 3*7c478bd9Sstevel@tonic-gate * All rights reserved. 4*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 5*7c478bd9Sstevel@tonic-gate */ 6*7c478bd9Sstevel@tonic-gate 7*7c478bd9Sstevel@tonic-gate /* 8*7c478bd9Sstevel@tonic-gate * Copyright (c) 1980 Regents of the University of California. 9*7c478bd9Sstevel@tonic-gate * All rights reserved. The Berkeley software License Agreement 10*7c478bd9Sstevel@tonic-gate * specifies the terms and conditions for redistribution. 11*7c478bd9Sstevel@tonic-gate */ 12*7c478bd9Sstevel@tonic-gate 13*7c478bd9Sstevel@tonic-gate #ifndef _DUMP_H 14*7c478bd9Sstevel@tonic-gate #define _DUMP_H 15*7c478bd9Sstevel@tonic-gate 16*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 17*7c478bd9Sstevel@tonic-gate 18*7c478bd9Sstevel@tonic-gate #include <stdio.h> 19*7c478bd9Sstevel@tonic-gate #include <locale.h> 20*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 21*7c478bd9Sstevel@tonic-gate #include <ctype.h> 22*7c478bd9Sstevel@tonic-gate #include <string.h> 23*7c478bd9Sstevel@tonic-gate #include <syslog.h> 24*7c478bd9Sstevel@tonic-gate #include <errno.h> 25*7c478bd9Sstevel@tonic-gate #include <fcntl.h> 26*7c478bd9Sstevel@tonic-gate #include <utmpx.h> 27*7c478bd9Sstevel@tonic-gate #include <signal.h> 28*7c478bd9Sstevel@tonic-gate #include <stdlib.h> 29*7c478bd9Sstevel@tonic-gate #include <time.h> 30*7c478bd9Sstevel@tonic-gate #include <sys/param.h> /* for MAXBSIZE */ 31*7c478bd9Sstevel@tonic-gate #include <sys/stat.h> 32*7c478bd9Sstevel@tonic-gate #include <sys/time.h> 33*7c478bd9Sstevel@tonic-gate #include <sys/wait.h> 34*7c478bd9Sstevel@tonic-gate #include <sys/vnode.h> /* needed by inode.h */ 35*7c478bd9Sstevel@tonic-gate #include <setjmp.h> 36*7c478bd9Sstevel@tonic-gate #include <sys/mman.h> 37*7c478bd9Sstevel@tonic-gate #include <assert.h> 38*7c478bd9Sstevel@tonic-gate #include <dumpusg.h> 39*7c478bd9Sstevel@tonic-gate #include <kstat.h> 40*7c478bd9Sstevel@tonic-gate #include <sys/fssnap_if.h> 41*7c478bd9Sstevel@tonic-gate #include <libgen.h> 42*7c478bd9Sstevel@tonic-gate #include <limits.h> 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 45*7c478bd9Sstevel@tonic-gate extern "C" { 46*7c478bd9Sstevel@tonic-gate #endif 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate #define SUPPORTS_MTB_TAPE_FORMAT 49*7c478bd9Sstevel@tonic-gate #include <protocols/dumprestore.h> 50*7c478bd9Sstevel@tonic-gate #include <memutils.h> 51*7c478bd9Sstevel@tonic-gate #include <note.h> 52*7c478bd9Sstevel@tonic-gate 53*7c478bd9Sstevel@tonic-gate #define NI 16 54*7c478bd9Sstevel@tonic-gate #define MAXINOPB (MAXBSIZE / sizeof (struct dinode)) 55*7c478bd9Sstevel@tonic-gate #define MAXNINDIR (MAXBSIZE / sizeof (daddr32_t)) 56*7c478bd9Sstevel@tonic-gate 57*7c478bd9Sstevel@tonic-gate #ifndef roundup 58*7c478bd9Sstevel@tonic-gate #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) 59*7c478bd9Sstevel@tonic-gate #endif 60*7c478bd9Sstevel@tonic-gate #ifndef MIN 61*7c478bd9Sstevel@tonic-gate #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 62*7c478bd9Sstevel@tonic-gate #endif 63*7c478bd9Sstevel@tonic-gate #ifndef MAX 64*7c478bd9Sstevel@tonic-gate #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 65*7c478bd9Sstevel@tonic-gate #endif 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate /* 68*7c478bd9Sstevel@tonic-gate * Define an overflow-free version of howmany so that we don't 69*7c478bd9Sstevel@tonic-gate * run into trouble with large files. 70*7c478bd9Sstevel@tonic-gate */ 71*7c478bd9Sstevel@tonic-gate #define d_howmany(x, y) ((x) / (y) + ((x) % (y) != 0)) 72*7c478bd9Sstevel@tonic-gate 73*7c478bd9Sstevel@tonic-gate #define MWORD(m, i) (m[(ino_t)(i-1)/NBBY]) 74*7c478bd9Sstevel@tonic-gate #define MBIT(i) ((1<<((ino_t)(i-1)%NBBY))&0xff) 75*7c478bd9Sstevel@tonic-gate #define BIS(i, w) (MWORD(w, i) |= MBIT(i)) 76*7c478bd9Sstevel@tonic-gate #define BIC(i, w) (MWORD(w, i) &= ~MBIT(i)) 77*7c478bd9Sstevel@tonic-gate #define BIT(i, w) (MWORD(w, i) & MBIT(i)) 78*7c478bd9Sstevel@tonic-gate 79*7c478bd9Sstevel@tonic-gate uint_t msiz; 80*7c478bd9Sstevel@tonic-gate uchar_t *clrmap; 81*7c478bd9Sstevel@tonic-gate uchar_t *dirmap; 82*7c478bd9Sstevel@tonic-gate uchar_t *filmap; 83*7c478bd9Sstevel@tonic-gate uchar_t *nodmap; 84*7c478bd9Sstevel@tonic-gate uchar_t *shamap; 85*7c478bd9Sstevel@tonic-gate uchar_t *activemap; 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate /* 88*7c478bd9Sstevel@tonic-gate * All calculations done in 0.1" units! 89*7c478bd9Sstevel@tonic-gate */ 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate char *disk; /* name of the disk file */ 92*7c478bd9Sstevel@tonic-gate char *dname; /* name to put in /etc/dumpdates */ 93*7c478bd9Sstevel@tonic-gate int disk_dynamic; /* true if disk refers to dynamic storage */ 94*7c478bd9Sstevel@tonic-gate char *tape; /* name of the tape file */ 95*7c478bd9Sstevel@tonic-gate char *host; /* name of the remote tape host (may be "user@host") */ 96*7c478bd9Sstevel@tonic-gate char *dumpdev; /* hostname:device for current volume */ 97*7c478bd9Sstevel@tonic-gate char *sdumpdev; /* short form of dumpdev (no user name if remote) */ 98*7c478bd9Sstevel@tonic-gate char *increm; /* name of file containing incremental information */ 99*7c478bd9Sstevel@tonic-gate char *filesystem; /* name of the file system */ 100*7c478bd9Sstevel@tonic-gate char *myname; /* argv[0] without leading path components */ 101*7c478bd9Sstevel@tonic-gate char lastincno; /* increment number of previous dump */ 102*7c478bd9Sstevel@tonic-gate char incno; /* increment number */ 103*7c478bd9Sstevel@tonic-gate char *tlabel; /* what goes in tape header c_label field */ 104*7c478bd9Sstevel@tonic-gate int uflag; /* update flag */ 105*7c478bd9Sstevel@tonic-gate int fi; /* disk file descriptor */ 106*7c478bd9Sstevel@tonic-gate int to; /* tape file descriptor */ 107*7c478bd9Sstevel@tonic-gate int mapfd; /* block disk device descriptor for mmap */ 108*7c478bd9Sstevel@tonic-gate int pipeout; /* true => output to standard output */ 109*7c478bd9Sstevel@tonic-gate int tapeout; /* true => output to a tape drive */ 110*7c478bd9Sstevel@tonic-gate ino_t ino; /* current inumber; used globally */ 111*7c478bd9Sstevel@tonic-gate off_t pos; /* starting offset within ino; used globally */ 112*7c478bd9Sstevel@tonic-gate int leftover; /* number of tape recs left over from prev vol */ 113*7c478bd9Sstevel@tonic-gate int nsubdir; /* counts subdirs, for deciding to dump a dir */ 114*7c478bd9Sstevel@tonic-gate int newtape; /* new tape flag */ 115*7c478bd9Sstevel@tonic-gate int nadded; /* number of added sub directories */ 116*7c478bd9Sstevel@tonic-gate int dadded; /* directory added flag */ 117*7c478bd9Sstevel@tonic-gate int density; /* density in 0.1" units */ 118*7c478bd9Sstevel@tonic-gate ulong_t tsize; /* tape size in 0.1" units */ 119*7c478bd9Sstevel@tonic-gate u_offset_t esize; /* estimated tape size, blocks */ 120*7c478bd9Sstevel@tonic-gate u_offset_t o_esize; /* number of header blocks (overhead) */ 121*7c478bd9Sstevel@tonic-gate u_offset_t f_esize; /* number of TP_BSIZE blocks for files/maps */ 122*7c478bd9Sstevel@tonic-gate uint_t etapes; /* estimated number of tapes */ 123*7c478bd9Sstevel@tonic-gate uint_t ntrec; /* 1K records per tape block */ 124*7c478bd9Sstevel@tonic-gate int tenthsperirg; /* 1/10" per tape inter-record gap */ 125*7c478bd9Sstevel@tonic-gate dev_t partial_dev; /* id of BLOCK device used in partial mode */ 126*7c478bd9Sstevel@tonic-gate pid_t dumppid; /* process-ID of top-level process */ 127*7c478bd9Sstevel@tonic-gate 128*7c478bd9Sstevel@tonic-gate int verify; /* verify each volume */ 129*7c478bd9Sstevel@tonic-gate int doingverify; /* true => doing a verify pass */ 130*7c478bd9Sstevel@tonic-gate int active; /* recopy active files */ 131*7c478bd9Sstevel@tonic-gate int doingactive; /* true => redumping active files */ 132*7c478bd9Sstevel@tonic-gate int archive; /* true => saving a archive in archivefile */ 133*7c478bd9Sstevel@tonic-gate char *archivefile; /* name of archivefile */ 134*7c478bd9Sstevel@tonic-gate int notify; /* notify operator flag */ 135*7c478bd9Sstevel@tonic-gate int diskette; /* true if dumping to a diskette */ 136*7c478bd9Sstevel@tonic-gate int cartridge; /* true if dumping to a cartridge tape */ 137*7c478bd9Sstevel@tonic-gate uint_t tracks; /* number of tracks on a cartridge tape */ 138*7c478bd9Sstevel@tonic-gate int printsize; /* just print estimated size and exit */ 139*7c478bd9Sstevel@tonic-gate int offline; /* take tape offline after rewinding */ 140*7c478bd9Sstevel@tonic-gate int autoload; /* wait for next tape to autoload; implies offline */ 141*7c478bd9Sstevel@tonic-gate int autoload_tries; /* number of times to check on autoload */ 142*7c478bd9Sstevel@tonic-gate int autoload_period; /* seconds, tries*period = total wait time */ 143*7c478bd9Sstevel@tonic-gate int doposition; /* move to specified... */ 144*7c478bd9Sstevel@tonic-gate daddr32_t filenum; /* position of dump on 1st volume */ 145*7c478bd9Sstevel@tonic-gate int dumpstate; /* dump output state (see below) */ 146*7c478bd9Sstevel@tonic-gate int dumptoarchive; /* mark records to be archived */ 147*7c478bd9Sstevel@tonic-gate 148*7c478bd9Sstevel@tonic-gate int blockswritten; /* number of blocks written on current tape */ 149*7c478bd9Sstevel@tonic-gate uint_t tapeno; /* current tape number */ 150*7c478bd9Sstevel@tonic-gate 151*7c478bd9Sstevel@tonic-gate struct fs *sblock; /* the file system super block */ 152*7c478bd9Sstevel@tonic-gate int shortmeta; /* current file has small amount of metadata */ 153*7c478bd9Sstevel@tonic-gate union u_shadow c_shadow_save[1]; 154*7c478bd9Sstevel@tonic-gate 155*7c478bd9Sstevel@tonic-gate time_t *telapsed; /* time spent writing previous tapes */ 156*7c478bd9Sstevel@tonic-gate time_t *tstart_writing; /* when we started writing the latest tape */ 157*7c478bd9Sstevel@tonic-gate time_t *tschedule; /* when next to give a remaining-time estimate */ 158*7c478bd9Sstevel@tonic-gate 159*7c478bd9Sstevel@tonic-gate char *debug_chdir; /* non-NULL means to mkdir this/pid, and chdir there, */ 160*7c478bd9Sstevel@tonic-gate /* once for each separate child */ 161*7c478bd9Sstevel@tonic-gate 162*7c478bd9Sstevel@tonic-gate /* 163*7c478bd9Sstevel@tonic-gate * Defines for the msec part of 164*7c478bd9Sstevel@tonic-gate * inode-based times, since we're 165*7c478bd9Sstevel@tonic-gate * not part of the kernel. 166*7c478bd9Sstevel@tonic-gate */ 167*7c478bd9Sstevel@tonic-gate #define di_atspare di_ic.ic_atspare 168*7c478bd9Sstevel@tonic-gate #define di_mtspare di_ic.ic_mtspare 169*7c478bd9Sstevel@tonic-gate #define di_ctspare di_ic.ic_ctspare 170*7c478bd9Sstevel@tonic-gate 171*7c478bd9Sstevel@tonic-gate #define HOUR (60L*60L) 172*7c478bd9Sstevel@tonic-gate #define DAY (24L*HOUR) 173*7c478bd9Sstevel@tonic-gate #define YEAR (365L*DAY) 174*7c478bd9Sstevel@tonic-gate 175*7c478bd9Sstevel@tonic-gate /* 176*7c478bd9Sstevel@tonic-gate * Dump output states 177*7c478bd9Sstevel@tonic-gate */ 178*7c478bd9Sstevel@tonic-gate #define DS_INIT 0 179*7c478bd9Sstevel@tonic-gate #define DS_START 1 180*7c478bd9Sstevel@tonic-gate #define DS_CLRI 2 181*7c478bd9Sstevel@tonic-gate #define DS_BITS 3 182*7c478bd9Sstevel@tonic-gate #define DS_DIRS 4 183*7c478bd9Sstevel@tonic-gate #define DS_FILES 5 184*7c478bd9Sstevel@tonic-gate #define DS_END 6 185*7c478bd9Sstevel@tonic-gate #define DS_DONE 7 186*7c478bd9Sstevel@tonic-gate 187*7c478bd9Sstevel@tonic-gate /* 188*7c478bd9Sstevel@tonic-gate * Exit status codes 189*7c478bd9Sstevel@tonic-gate */ 190*7c478bd9Sstevel@tonic-gate #define X_FINOK 0 /* normal exit */ 191*7c478bd9Sstevel@tonic-gate #define X_REWRITE 2 /* restart writing from the check point */ 192*7c478bd9Sstevel@tonic-gate #define X_ABORT 3 /* abort all of dump; no checkpoint restart */ 193*7c478bd9Sstevel@tonic-gate #define X_VERIFY 4 /* verify the reel just written */ 194*7c478bd9Sstevel@tonic-gate #define X_RESTART 5 /* abort all progress so far; attempt restart */ 195*7c478bd9Sstevel@tonic-gate 196*7c478bd9Sstevel@tonic-gate #define NINCREM "/etc/dumpdates" /* new format incremental info */ 197*7c478bd9Sstevel@tonic-gate 198*7c478bd9Sstevel@tonic-gate #define TAPE "/dev/rmt/0b" /* default tape device */ 199*7c478bd9Sstevel@tonic-gate #define OPGRENT "sys" /* group entry to notify */ 200*7c478bd9Sstevel@tonic-gate #define DIALUP "ttyd" /* prefix for dialups */ 201*7c478bd9Sstevel@tonic-gate 202*7c478bd9Sstevel@tonic-gate #define DISKETTE "/dev/rfd0c" 203*7c478bd9Sstevel@tonic-gate 204*7c478bd9Sstevel@tonic-gate #define NBUF 64 /* number of output buffers */ 205*7c478bd9Sstevel@tonic-gate #define MAXNTREC 256 /* max tape blocking factor (in Kb) */ 206*7c478bd9Sstevel@tonic-gate 207*7c478bd9Sstevel@tonic-gate /* 208*7c478bd9Sstevel@tonic-gate * The contents of the file NINCREM are maintained both on 209*7c478bd9Sstevel@tonic-gate * a linked list and then (eventually) arrayified. 210*7c478bd9Sstevel@tonic-gate */ 211*7c478bd9Sstevel@tonic-gate struct idates { 212*7c478bd9Sstevel@tonic-gate char id_name[MAXNAMLEN+3]; 213*7c478bd9Sstevel@tonic-gate char id_incno; 214*7c478bd9Sstevel@tonic-gate time32_t id_ddate; 215*7c478bd9Sstevel@tonic-gate }; 216*7c478bd9Sstevel@tonic-gate 217*7c478bd9Sstevel@tonic-gate size_t nidates; /* number of records (might be zero) */ 218*7c478bd9Sstevel@tonic-gate struct idates **idatev; /* the arrayfied version */ 219*7c478bd9Sstevel@tonic-gate #define ITITERATE(i, ip) \ 220*7c478bd9Sstevel@tonic-gate for (i = 0; i < nidates && (ip = idatev[i]) != NULL; i++) 221*7c478bd9Sstevel@tonic-gate 222*7c478bd9Sstevel@tonic-gate /* 223*7c478bd9Sstevel@tonic-gate * Function declarations 224*7c478bd9Sstevel@tonic-gate */ 225*7c478bd9Sstevel@tonic-gate #ifdef __STDC__ 226*7c478bd9Sstevel@tonic-gate /* 227*7c478bd9Sstevel@tonic-gate * dumpfstab.c 228*7c478bd9Sstevel@tonic-gate */ 229*7c478bd9Sstevel@tonic-gate extern void mnttabread(void); 230*7c478bd9Sstevel@tonic-gate extern struct mntent *mnttabsearch(char *, int); 231*7c478bd9Sstevel@tonic-gate extern void setmnttab(void); 232*7c478bd9Sstevel@tonic-gate extern struct mntent *getmnttab(void); 233*7c478bd9Sstevel@tonic-gate /* 234*7c478bd9Sstevel@tonic-gate * dumpitime.c 235*7c478bd9Sstevel@tonic-gate */ 236*7c478bd9Sstevel@tonic-gate extern char *prdate(time_t); 237*7c478bd9Sstevel@tonic-gate extern void inititimes(void); 238*7c478bd9Sstevel@tonic-gate extern void getitime(void); 239*7c478bd9Sstevel@tonic-gate extern void putitime(void); 240*7c478bd9Sstevel@tonic-gate extern void est(struct dinode *); 241*7c478bd9Sstevel@tonic-gate extern time32_t is_fssnap_dump(char *); 242*7c478bd9Sstevel@tonic-gate extern void bmapest(uchar_t *); 243*7c478bd9Sstevel@tonic-gate /* 244*7c478bd9Sstevel@tonic-gate * dumplabel.c 245*7c478bd9Sstevel@tonic-gate */ 246*7c478bd9Sstevel@tonic-gate extern void getlabel(void); 247*7c478bd9Sstevel@tonic-gate /* 248*7c478bd9Sstevel@tonic-gate * dumpmain.c 249*7c478bd9Sstevel@tonic-gate */ 250*7c478bd9Sstevel@tonic-gate extern void child_chdir(void); 251*7c478bd9Sstevel@tonic-gate extern char *unrawname(char *); 252*7c478bd9Sstevel@tonic-gate extern void sigAbort(int); 253*7c478bd9Sstevel@tonic-gate extern char *rawname(char *); 254*7c478bd9Sstevel@tonic-gate extern char *lf_rawname(char *); 255*7c478bd9Sstevel@tonic-gate extern time32_t timeclock(time32_t); 256*7c478bd9Sstevel@tonic-gate #ifdef signal 257*7c478bd9Sstevel@tonic-gate extern void (*nsignal(int, void (*)(int)))(int); 258*7c478bd9Sstevel@tonic-gate #endif 259*7c478bd9Sstevel@tonic-gate extern int safe_file_open(const char *file, int mode, int perms); 260*7c478bd9Sstevel@tonic-gate extern int safe_device_open(const char *file, int mode, int perms); 261*7c478bd9Sstevel@tonic-gate extern FILE *safe_fopen(const char *filename, const char *smode, int perms); 262*7c478bd9Sstevel@tonic-gate /* 263*7c478bd9Sstevel@tonic-gate * dumponline.c 264*7c478bd9Sstevel@tonic-gate */ 265*7c478bd9Sstevel@tonic-gate extern void allocino(void); 266*7c478bd9Sstevel@tonic-gate extern void freeino(void); 267*7c478bd9Sstevel@tonic-gate extern void saveino(ino_t, struct dinode *); 268*7c478bd9Sstevel@tonic-gate extern void resetino(ino_t); 269*7c478bd9Sstevel@tonic-gate extern long getigen(ino_t); 270*7c478bd9Sstevel@tonic-gate extern int lf_ismounted(char *, char *); 271*7c478bd9Sstevel@tonic-gate extern int isoperator(uid_t, gid_t); 272*7c478bd9Sstevel@tonic-gate extern int lockfs(char *, char *); 273*7c478bd9Sstevel@tonic-gate extern int openi(ino_t, long, char *); 274*7c478bd9Sstevel@tonic-gate extern caddr_t mapfile(int, off_t, off_t, int); 275*7c478bd9Sstevel@tonic-gate extern void unmapfile(void); 276*7c478bd9Sstevel@tonic-gate extern void stattoi(struct stat *, struct dinode *); 277*7c478bd9Sstevel@tonic-gate extern void dumpfile(int, caddr_t, off_t, off_t, off_t, int, int); 278*7c478bd9Sstevel@tonic-gate extern void activepass(void); 279*7c478bd9Sstevel@tonic-gate /* 280*7c478bd9Sstevel@tonic-gate * dumpoptr.c 281*7c478bd9Sstevel@tonic-gate */ 282*7c478bd9Sstevel@tonic-gate extern int query(char *); 283*7c478bd9Sstevel@tonic-gate extern int query_once(char *, int); 284*7c478bd9Sstevel@tonic-gate extern void interrupt(int); 285*7c478bd9Sstevel@tonic-gate extern void broadcast(char *); 286*7c478bd9Sstevel@tonic-gate extern void timeest(int, int); 287*7c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/ 288*7c478bd9Sstevel@tonic-gate extern void msg(const char *, ...); 289*7c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/ 290*7c478bd9Sstevel@tonic-gate extern void msgtail(const char *, ...); 291*7c478bd9Sstevel@tonic-gate extern void lastdump(int); 292*7c478bd9Sstevel@tonic-gate extern char *getresponse(char *, char *); 293*7c478bd9Sstevel@tonic-gate /* 294*7c478bd9Sstevel@tonic-gate * dumptape.c 295*7c478bd9Sstevel@tonic-gate */ 296*7c478bd9Sstevel@tonic-gate extern void alloctape(void); 297*7c478bd9Sstevel@tonic-gate extern void reset(void); 298*7c478bd9Sstevel@tonic-gate extern void spclrec(void); 299*7c478bd9Sstevel@tonic-gate extern void taprec(uchar_t *, int, int); 300*7c478bd9Sstevel@tonic-gate extern void dmpblk(daddr32_t, size_t, off_t); 301*7c478bd9Sstevel@tonic-gate extern void toslave(void (*)(ino_t), ino_t); 302*7c478bd9Sstevel@tonic-gate extern void doinode(ino_t); 303*7c478bd9Sstevel@tonic-gate extern void dospcl(ino_t); 304*7c478bd9Sstevel@tonic-gate extern void flushcmds(void); 305*7c478bd9Sstevel@tonic-gate extern void flusht(void); 306*7c478bd9Sstevel@tonic-gate extern void nextdevice(void); 307*7c478bd9Sstevel@tonic-gate extern int isrewind(int); 308*7c478bd9Sstevel@tonic-gate extern void trewind(void); 309*7c478bd9Sstevel@tonic-gate extern void close_rewind(void); 310*7c478bd9Sstevel@tonic-gate extern void changevol(void); 311*7c478bd9Sstevel@tonic-gate extern void otape(int); 312*7c478bd9Sstevel@tonic-gate extern void dumpabort(void); 313*7c478bd9Sstevel@tonic-gate extern void dumpailing(void); 314*7c478bd9Sstevel@tonic-gate extern void Exit(int); 315*7c478bd9Sstevel@tonic-gate extern void positiontape(char *); 316*7c478bd9Sstevel@tonic-gate /* 317*7c478bd9Sstevel@tonic-gate * dumptraverse.c 318*7c478bd9Sstevel@tonic-gate */ 319*7c478bd9Sstevel@tonic-gate extern void pass(void (*)(struct dinode *), uchar_t *); 320*7c478bd9Sstevel@tonic-gate extern void mark(struct dinode *); 321*7c478bd9Sstevel@tonic-gate extern void active_mark(struct dinode *); 322*7c478bd9Sstevel@tonic-gate extern void markshad(struct dinode *); 323*7c478bd9Sstevel@tonic-gate extern void estshad(struct dinode *); 324*7c478bd9Sstevel@tonic-gate extern void freeshad(); 325*7c478bd9Sstevel@tonic-gate extern void add(struct dinode *); 326*7c478bd9Sstevel@tonic-gate extern void dirdump(struct dinode *); 327*7c478bd9Sstevel@tonic-gate extern void dump(struct dinode *); 328*7c478bd9Sstevel@tonic-gate extern void lf_dump(struct dinode *); 329*7c478bd9Sstevel@tonic-gate extern void dumpblocks(ino_t); 330*7c478bd9Sstevel@tonic-gate extern void bitmap(uchar_t *, int); 331*7c478bd9Sstevel@tonic-gate extern struct dinode *getino(ino_t); 332*7c478bd9Sstevel@tonic-gate extern void bread(diskaddr_t, uchar_t *, size_t); 333*7c478bd9Sstevel@tonic-gate extern int hasshortmeta(struct dinode **ip); 334*7c478bd9Sstevel@tonic-gate /* 335*7c478bd9Sstevel@tonic-gate * lftw.c 336*7c478bd9Sstevel@tonic-gate */ 337*7c478bd9Sstevel@tonic-gate extern int lftw(const char *, 338*7c478bd9Sstevel@tonic-gate int (*)(const char *, const struct stat *, int), int); 339*7c478bd9Sstevel@tonic-gate extern int lf_lftw(const char *, 340*7c478bd9Sstevel@tonic-gate int (*)(const char *, const struct stat64 *, int), int); 341*7c478bd9Sstevel@tonic-gate /* 342*7c478bd9Sstevel@tonic-gate * partial.c 343*7c478bd9Sstevel@tonic-gate */ 344*7c478bd9Sstevel@tonic-gate extern void partial_check(void); 345*7c478bd9Sstevel@tonic-gate extern void lf_partial_check(void); 346*7c478bd9Sstevel@tonic-gate extern int partial_mark(int, char **); 347*7c478bd9Sstevel@tonic-gate /* 348*7c478bd9Sstevel@tonic-gate * unctime.c 349*7c478bd9Sstevel@tonic-gate */ 350*7c478bd9Sstevel@tonic-gate extern time_t unctime(char *); 351*7c478bd9Sstevel@tonic-gate #else /* !STDC */ 352*7c478bd9Sstevel@tonic-gate /* 353*7c478bd9Sstevel@tonic-gate * dumpfstab.c 354*7c478bd9Sstevel@tonic-gate */ 355*7c478bd9Sstevel@tonic-gate extern void mnttabread(); 356*7c478bd9Sstevel@tonic-gate extern struct mntent *mnttabsearch(); 357*7c478bd9Sstevel@tonic-gate extern void setmnttab(); 358*7c478bd9Sstevel@tonic-gate extern struct mntent *getmnttab(); 359*7c478bd9Sstevel@tonic-gate /* 360*7c478bd9Sstevel@tonic-gate * dumpitime.c 361*7c478bd9Sstevel@tonic-gate */ 362*7c478bd9Sstevel@tonic-gate extern char *prdate(); 363*7c478bd9Sstevel@tonic-gate extern void inititimes(); 364*7c478bd9Sstevel@tonic-gate extern void getitime(); 365*7c478bd9Sstevel@tonic-gate extern void putitime(); 366*7c478bd9Sstevel@tonic-gate extern void est(); 367*7c478bd9Sstevel@tonic-gate extern time32_t is_fssnap_dump(); 368*7c478bd9Sstevel@tonic-gate extern void bmapest(); 369*7c478bd9Sstevel@tonic-gate /* 370*7c478bd9Sstevel@tonic-gate * dumplabel.c 371*7c478bd9Sstevel@tonic-gate */ 372*7c478bd9Sstevel@tonic-gate extern void getlabel(); 373*7c478bd9Sstevel@tonic-gate /* 374*7c478bd9Sstevel@tonic-gate * dumpmain.c 375*7c478bd9Sstevel@tonic-gate */ 376*7c478bd9Sstevel@tonic-gate extern void child_chdir(); 377*7c478bd9Sstevel@tonic-gate extern char *unrawname(); 378*7c478bd9Sstevel@tonic-gate extern void sigAbort(); 379*7c478bd9Sstevel@tonic-gate extern char *rawname(); 380*7c478bd9Sstevel@tonic-gate extern char *lf_rawname(); 381*7c478bd9Sstevel@tonic-gate extern time_t timeclock(); 382*7c478bd9Sstevel@tonic-gate #ifdef signal 383*7c478bd9Sstevel@tonic-gate extern void nsignal(); 384*7c478bd9Sstevel@tonic-gate #endif 385*7c478bd9Sstevel@tonic-gate extern int safe_file_open(); 386*7c478bd9Sstevel@tonic-gate extern int safe_device_open(); 387*7c478bd9Sstevel@tonic-gate extern FILE *safe_fopen(); 388*7c478bd9Sstevel@tonic-gate /* 389*7c478bd9Sstevel@tonic-gate * dumponline.c 390*7c478bd9Sstevel@tonic-gate */ 391*7c478bd9Sstevel@tonic-gate extern void allocino(); 392*7c478bd9Sstevel@tonic-gate extern void freeino(); 393*7c478bd9Sstevel@tonic-gate extern void saveino(); 394*7c478bd9Sstevel@tonic-gate extern void resetino(); 395*7c478bd9Sstevel@tonic-gate extern long getigen(); 396*7c478bd9Sstevel@tonic-gate extern int lf_ismounted(); 397*7c478bd9Sstevel@tonic-gate extern int isoperator(); 398*7c478bd9Sstevel@tonic-gate extern ulong_t lockfs(); 399*7c478bd9Sstevel@tonic-gate extern int openi(); 400*7c478bd9Sstevel@tonic-gate extern caddr_t mapfile(); 401*7c478bd9Sstevel@tonic-gate extern void unmapfile(); 402*7c478bd9Sstevel@tonic-gate extern void stattoi(); 403*7c478bd9Sstevel@tonic-gate extern void dumpfile(); 404*7c478bd9Sstevel@tonic-gate extern void activepass(); 405*7c478bd9Sstevel@tonic-gate /* 406*7c478bd9Sstevel@tonic-gate * dumpoptr.c 407*7c478bd9Sstevel@tonic-gate */ 408*7c478bd9Sstevel@tonic-gate extern int query(); 409*7c478bd9Sstevel@tonic-gate extern int query_once(); 410*7c478bd9Sstevel@tonic-gate extern void interrupt(); 411*7c478bd9Sstevel@tonic-gate extern void broadcast(); 412*7c478bd9Sstevel@tonic-gate extern void timeest(); 413*7c478bd9Sstevel@tonic-gate extern void msg(); 414*7c478bd9Sstevel@tonic-gate extern void msgtail(); 415*7c478bd9Sstevel@tonic-gate extern void lastdump(); 416*7c478bd9Sstevel@tonic-gate extern char *getresponse(); 417*7c478bd9Sstevel@tonic-gate /* 418*7c478bd9Sstevel@tonic-gate * dumptape.c 419*7c478bd9Sstevel@tonic-gate */ 420*7c478bd9Sstevel@tonic-gate extern void alloctape(); 421*7c478bd9Sstevel@tonic-gate extern void reset(); 422*7c478bd9Sstevel@tonic-gate extern void spclrec(); 423*7c478bd9Sstevel@tonic-gate extern void taprec(); 424*7c478bd9Sstevel@tonic-gate extern void dmpblk(); 425*7c478bd9Sstevel@tonic-gate extern void toslave(); 426*7c478bd9Sstevel@tonic-gate extern void doinode(); 427*7c478bd9Sstevel@tonic-gate extern void dospcl(); 428*7c478bd9Sstevel@tonic-gate extern void flushcmds(); 429*7c478bd9Sstevel@tonic-gate extern void flusht(); 430*7c478bd9Sstevel@tonic-gate extern void nextdevice(); 431*7c478bd9Sstevel@tonic-gate extern int isrewind(); 432*7c478bd9Sstevel@tonic-gate extern void trewind(); 433*7c478bd9Sstevel@tonic-gate extern void close_rewind(); 434*7c478bd9Sstevel@tonic-gate extern void changevol(); 435*7c478bd9Sstevel@tonic-gate extern void otape(); 436*7c478bd9Sstevel@tonic-gate extern void dumpabort(); 437*7c478bd9Sstevel@tonic-gate extern void dumpailing(); 438*7c478bd9Sstevel@tonic-gate extern void Exit(); 439*7c478bd9Sstevel@tonic-gate extern void positiontape(); 440*7c478bd9Sstevel@tonic-gate /* 441*7c478bd9Sstevel@tonic-gate * dumptraverse.c 442*7c478bd9Sstevel@tonic-gate */ 443*7c478bd9Sstevel@tonic-gate extern void pass(); 444*7c478bd9Sstevel@tonic-gate extern void mark(); 445*7c478bd9Sstevel@tonic-gate extern void active_mark(); 446*7c478bd9Sstevel@tonic-gate extern void markshad(); 447*7c478bd9Sstevel@tonic-gate extern void estshad(); 448*7c478bd9Sstevel@tonic-gate extern void freeshad(); 449*7c478bd9Sstevel@tonic-gate extern void add(); 450*7c478bd9Sstevel@tonic-gate extern void dirdump(); 451*7c478bd9Sstevel@tonic-gate extern void dump(); 452*7c478bd9Sstevel@tonic-gate extern void lf_dump(); 453*7c478bd9Sstevel@tonic-gate extern void dumpblocks(); 454*7c478bd9Sstevel@tonic-gate extern void bitmap(); 455*7c478bd9Sstevel@tonic-gate extern struct dinode *getino(); 456*7c478bd9Sstevel@tonic-gate extern void bread(); 457*7c478bd9Sstevel@tonic-gate extern int hasshortmeta(); 458*7c478bd9Sstevel@tonic-gate /* 459*7c478bd9Sstevel@tonic-gate * lftw.c 460*7c478bd9Sstevel@tonic-gate */ 461*7c478bd9Sstevel@tonic-gate extern int lftw(); 462*7c478bd9Sstevel@tonic-gate extern int lf_lftw(); 463*7c478bd9Sstevel@tonic-gate /* 464*7c478bd9Sstevel@tonic-gate * partial.c 465*7c478bd9Sstevel@tonic-gate */ 466*7c478bd9Sstevel@tonic-gate extern void partial_check(); 467*7c478bd9Sstevel@tonic-gate extern void lf_partial_check(); 468*7c478bd9Sstevel@tonic-gate extern int partial_mark(); 469*7c478bd9Sstevel@tonic-gate /* 470*7c478bd9Sstevel@tonic-gate * unctime.c 471*7c478bd9Sstevel@tonic-gate */ 472*7c478bd9Sstevel@tonic-gate extern time_t unctime(); 473*7c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 474*7c478bd9Sstevel@tonic-gate 475*7c478bd9Sstevel@tonic-gate /* Insufficiently-featureful system header files... */ 476*7c478bd9Sstevel@tonic-gate NOTE(ALIGNMENT(mmap, 8)) 477*7c478bd9Sstevel@tonic-gate 478*7c478bd9Sstevel@tonic-gate 479*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 480*7c478bd9Sstevel@tonic-gate } 481*7c478bd9Sstevel@tonic-gate #endif 482*7c478bd9Sstevel@tonic-gate 483*7c478bd9Sstevel@tonic-gate #endif /* _DUMP_H */ 484