17c478bd9Sstevel@tonic-gate /* 2*bf545727SJim Rice * CDDL HEADER START 3*bf545727SJim Rice * 4*bf545727SJim Rice * The contents of this file are subject to the terms of the 5*bf545727SJim Rice * Common Development and Distribution License (the "License"). 6*bf545727SJim Rice * You may not use this file except in compliance with the License. 7*bf545727SJim Rice * 8*bf545727SJim Rice * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*bf545727SJim Rice * or http://www.opensolaris.org/os/licensing. 10*bf545727SJim Rice * See the License for the specific language governing permissions 11*bf545727SJim Rice * and limitations under the License. 12*bf545727SJim Rice * 13*bf545727SJim Rice * When distributing Covered Code, include this CDDL HEADER in each 14*bf545727SJim Rice * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*bf545727SJim Rice * If applicable, add the following below this CDDL HEADER, with the 16*bf545727SJim Rice * fields enclosed by brackets "[]" replaced with your own identifying 17*bf545727SJim Rice * information: Portions Copyright [yyyy] [name of copyright owner] 18*bf545727SJim Rice * 19*bf545727SJim Rice * CDDL HEADER END 20*bf545727SJim Rice */ 21*bf545727SJim Rice /* 22*bf545727SJim Rice * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate /* 277c478bd9Sstevel@tonic-gate * Copyright (c) 1980 Regents of the University of California. 287c478bd9Sstevel@tonic-gate * All rights reserved. The Berkeley software License Agreement 297c478bd9Sstevel@tonic-gate * specifies the terms and conditions for redistribution. 307c478bd9Sstevel@tonic-gate */ 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #ifndef _DUMP_H 337c478bd9Sstevel@tonic-gate #define _DUMP_H 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #include <stdio.h> 367c478bd9Sstevel@tonic-gate #include <locale.h> 377c478bd9Sstevel@tonic-gate #include <sys/types.h> 387c478bd9Sstevel@tonic-gate #include <ctype.h> 397c478bd9Sstevel@tonic-gate #include <string.h> 407c478bd9Sstevel@tonic-gate #include <syslog.h> 417c478bd9Sstevel@tonic-gate #include <errno.h> 427c478bd9Sstevel@tonic-gate #include <fcntl.h> 437c478bd9Sstevel@tonic-gate #include <utmpx.h> 447c478bd9Sstevel@tonic-gate #include <signal.h> 457c478bd9Sstevel@tonic-gate #include <stdlib.h> 467c478bd9Sstevel@tonic-gate #include <time.h> 477c478bd9Sstevel@tonic-gate #include <sys/param.h> /* for MAXBSIZE */ 487c478bd9Sstevel@tonic-gate #include <sys/stat.h> 497c478bd9Sstevel@tonic-gate #include <sys/time.h> 507c478bd9Sstevel@tonic-gate #include <sys/wait.h> 517c478bd9Sstevel@tonic-gate #include <sys/vnode.h> /* needed by inode.h */ 527c478bd9Sstevel@tonic-gate #include <setjmp.h> 537c478bd9Sstevel@tonic-gate #include <sys/mman.h> 547c478bd9Sstevel@tonic-gate #include <assert.h> 557c478bd9Sstevel@tonic-gate #include <dumpusg.h> 567c478bd9Sstevel@tonic-gate #include <kstat.h> 577c478bd9Sstevel@tonic-gate #include <sys/fssnap_if.h> 587c478bd9Sstevel@tonic-gate #include <libgen.h> 597c478bd9Sstevel@tonic-gate #include <limits.h> 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate #ifdef __cplusplus 627c478bd9Sstevel@tonic-gate extern "C" { 637c478bd9Sstevel@tonic-gate #endif 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate #define SUPPORTS_MTB_TAPE_FORMAT 667c478bd9Sstevel@tonic-gate #include <protocols/dumprestore.h> 677c478bd9Sstevel@tonic-gate #include <memutils.h> 687c478bd9Sstevel@tonic-gate #include <note.h> 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate #define NI 16 717c478bd9Sstevel@tonic-gate #define MAXINOPB (MAXBSIZE / sizeof (struct dinode)) 727c478bd9Sstevel@tonic-gate #define MAXNINDIR (MAXBSIZE / sizeof (daddr32_t)) 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate #ifndef roundup 757c478bd9Sstevel@tonic-gate #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) 767c478bd9Sstevel@tonic-gate #endif 777c478bd9Sstevel@tonic-gate #ifndef MIN 787c478bd9Sstevel@tonic-gate #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 797c478bd9Sstevel@tonic-gate #endif 807c478bd9Sstevel@tonic-gate #ifndef MAX 817c478bd9Sstevel@tonic-gate #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 827c478bd9Sstevel@tonic-gate #endif 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate /* 857c478bd9Sstevel@tonic-gate * Define an overflow-free version of howmany so that we don't 867c478bd9Sstevel@tonic-gate * run into trouble with large files. 877c478bd9Sstevel@tonic-gate */ 887c478bd9Sstevel@tonic-gate #define d_howmany(x, y) ((x) / (y) + ((x) % (y) != 0)) 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate #define MWORD(m, i) (m[(ino_t)(i-1)/NBBY]) 917c478bd9Sstevel@tonic-gate #define MBIT(i) ((1<<((ino_t)(i-1)%NBBY))&0xff) 927c478bd9Sstevel@tonic-gate #define BIS(i, w) (MWORD(w, i) |= MBIT(i)) 937c478bd9Sstevel@tonic-gate #define BIC(i, w) (MWORD(w, i) &= ~MBIT(i)) 947c478bd9Sstevel@tonic-gate #define BIT(i, w) (MWORD(w, i) & MBIT(i)) 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate uint_t msiz; 977c478bd9Sstevel@tonic-gate uchar_t *clrmap; 987c478bd9Sstevel@tonic-gate uchar_t *dirmap; 997c478bd9Sstevel@tonic-gate uchar_t *filmap; 1007c478bd9Sstevel@tonic-gate uchar_t *nodmap; 1017c478bd9Sstevel@tonic-gate uchar_t *shamap; 1027c478bd9Sstevel@tonic-gate uchar_t *activemap; 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate /* 1057c478bd9Sstevel@tonic-gate * All calculations done in 0.1" units! 1067c478bd9Sstevel@tonic-gate */ 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate char *disk; /* name of the disk file */ 1097c478bd9Sstevel@tonic-gate char *dname; /* name to put in /etc/dumpdates */ 1107c478bd9Sstevel@tonic-gate int disk_dynamic; /* true if disk refers to dynamic storage */ 1117c478bd9Sstevel@tonic-gate char *tape; /* name of the tape file */ 1127c478bd9Sstevel@tonic-gate char *host; /* name of the remote tape host (may be "user@host") */ 1137c478bd9Sstevel@tonic-gate char *dumpdev; /* hostname:device for current volume */ 1147c478bd9Sstevel@tonic-gate char *sdumpdev; /* short form of dumpdev (no user name if remote) */ 1157c478bd9Sstevel@tonic-gate char *increm; /* name of file containing incremental information */ 1167c478bd9Sstevel@tonic-gate char *filesystem; /* name of the file system */ 1177c478bd9Sstevel@tonic-gate char *myname; /* argv[0] without leading path components */ 1187c478bd9Sstevel@tonic-gate char lastincno; /* increment number of previous dump */ 1197c478bd9Sstevel@tonic-gate char incno; /* increment number */ 1207c478bd9Sstevel@tonic-gate char *tlabel; /* what goes in tape header c_label field */ 1217c478bd9Sstevel@tonic-gate int uflag; /* update flag */ 1227c478bd9Sstevel@tonic-gate int fi; /* disk file descriptor */ 1237c478bd9Sstevel@tonic-gate int to; /* tape file descriptor */ 1247c478bd9Sstevel@tonic-gate int mapfd; /* block disk device descriptor for mmap */ 1257c478bd9Sstevel@tonic-gate int pipeout; /* true => output to standard output */ 1267c478bd9Sstevel@tonic-gate int tapeout; /* true => output to a tape drive */ 1277c478bd9Sstevel@tonic-gate ino_t ino; /* current inumber; used globally */ 1287c478bd9Sstevel@tonic-gate off_t pos; /* starting offset within ino; used globally */ 1297c478bd9Sstevel@tonic-gate int leftover; /* number of tape recs left over from prev vol */ 1307c478bd9Sstevel@tonic-gate int nsubdir; /* counts subdirs, for deciding to dump a dir */ 1317c478bd9Sstevel@tonic-gate int newtape; /* new tape flag */ 1327c478bd9Sstevel@tonic-gate int nadded; /* number of added sub directories */ 1337c478bd9Sstevel@tonic-gate int dadded; /* directory added flag */ 1347c478bd9Sstevel@tonic-gate int density; /* density in 0.1" units */ 1357c478bd9Sstevel@tonic-gate ulong_t tsize; /* tape size in 0.1" units */ 1367c478bd9Sstevel@tonic-gate u_offset_t esize; /* estimated tape size, blocks */ 1377c478bd9Sstevel@tonic-gate u_offset_t o_esize; /* number of header blocks (overhead) */ 1387c478bd9Sstevel@tonic-gate u_offset_t f_esize; /* number of TP_BSIZE blocks for files/maps */ 1397c478bd9Sstevel@tonic-gate uint_t etapes; /* estimated number of tapes */ 1407c478bd9Sstevel@tonic-gate uint_t ntrec; /* 1K records per tape block */ 1417c478bd9Sstevel@tonic-gate int tenthsperirg; /* 1/10" per tape inter-record gap */ 1427c478bd9Sstevel@tonic-gate dev_t partial_dev; /* id of BLOCK device used in partial mode */ 1437c478bd9Sstevel@tonic-gate pid_t dumppid; /* process-ID of top-level process */ 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gate int verify; /* verify each volume */ 1467c478bd9Sstevel@tonic-gate int doingverify; /* true => doing a verify pass */ 1477c478bd9Sstevel@tonic-gate int active; /* recopy active files */ 1487c478bd9Sstevel@tonic-gate int doingactive; /* true => redumping active files */ 1497c478bd9Sstevel@tonic-gate int archive; /* true => saving a archive in archivefile */ 1507c478bd9Sstevel@tonic-gate char *archivefile; /* name of archivefile */ 151*bf545727SJim Rice int archive_opened; /* have opened/created the archivefile */ 1527c478bd9Sstevel@tonic-gate int notify; /* notify operator flag */ 1537c478bd9Sstevel@tonic-gate int diskette; /* true if dumping to a diskette */ 1547c478bd9Sstevel@tonic-gate int cartridge; /* true if dumping to a cartridge tape */ 1557c478bd9Sstevel@tonic-gate uint_t tracks; /* number of tracks on a cartridge tape */ 1567c478bd9Sstevel@tonic-gate int printsize; /* just print estimated size and exit */ 1577c478bd9Sstevel@tonic-gate int offline; /* take tape offline after rewinding */ 1587c478bd9Sstevel@tonic-gate int autoload; /* wait for next tape to autoload; implies offline */ 1597c478bd9Sstevel@tonic-gate int autoload_tries; /* number of times to check on autoload */ 1607c478bd9Sstevel@tonic-gate int autoload_period; /* seconds, tries*period = total wait time */ 1617c478bd9Sstevel@tonic-gate int doposition; /* move to specified... */ 1627c478bd9Sstevel@tonic-gate daddr32_t filenum; /* position of dump on 1st volume */ 1637c478bd9Sstevel@tonic-gate int dumpstate; /* dump output state (see below) */ 1647c478bd9Sstevel@tonic-gate int dumptoarchive; /* mark records to be archived */ 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gate int blockswritten; /* number of blocks written on current tape */ 1677c478bd9Sstevel@tonic-gate uint_t tapeno; /* current tape number */ 1687c478bd9Sstevel@tonic-gate 1697c478bd9Sstevel@tonic-gate struct fs *sblock; /* the file system super block */ 1707c478bd9Sstevel@tonic-gate int shortmeta; /* current file has small amount of metadata */ 1717c478bd9Sstevel@tonic-gate union u_shadow c_shadow_save[1]; 1727c478bd9Sstevel@tonic-gate 1737c478bd9Sstevel@tonic-gate time_t *telapsed; /* time spent writing previous tapes */ 1747c478bd9Sstevel@tonic-gate time_t *tstart_writing; /* when we started writing the latest tape */ 1757c478bd9Sstevel@tonic-gate time_t *tschedule; /* when next to give a remaining-time estimate */ 1767c478bd9Sstevel@tonic-gate 1777c478bd9Sstevel@tonic-gate char *debug_chdir; /* non-NULL means to mkdir this/pid, and chdir there, */ 1787c478bd9Sstevel@tonic-gate /* once for each separate child */ 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate /* 1817c478bd9Sstevel@tonic-gate * Defines for the msec part of 1827c478bd9Sstevel@tonic-gate * inode-based times, since we're 1837c478bd9Sstevel@tonic-gate * not part of the kernel. 1847c478bd9Sstevel@tonic-gate */ 1857c478bd9Sstevel@tonic-gate #define di_atspare di_ic.ic_atspare 1867c478bd9Sstevel@tonic-gate #define di_mtspare di_ic.ic_mtspare 1877c478bd9Sstevel@tonic-gate #define di_ctspare di_ic.ic_ctspare 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate #define HOUR (60L*60L) 1907c478bd9Sstevel@tonic-gate #define DAY (24L*HOUR) 1917c478bd9Sstevel@tonic-gate #define YEAR (365L*DAY) 1927c478bd9Sstevel@tonic-gate 1937c478bd9Sstevel@tonic-gate /* 1947c478bd9Sstevel@tonic-gate * Dump output states 1957c478bd9Sstevel@tonic-gate */ 1967c478bd9Sstevel@tonic-gate #define DS_INIT 0 1977c478bd9Sstevel@tonic-gate #define DS_START 1 1987c478bd9Sstevel@tonic-gate #define DS_CLRI 2 1997c478bd9Sstevel@tonic-gate #define DS_BITS 3 2007c478bd9Sstevel@tonic-gate #define DS_DIRS 4 2017c478bd9Sstevel@tonic-gate #define DS_FILES 5 2027c478bd9Sstevel@tonic-gate #define DS_END 6 2037c478bd9Sstevel@tonic-gate #define DS_DONE 7 2047c478bd9Sstevel@tonic-gate 2057c478bd9Sstevel@tonic-gate /* 2067c478bd9Sstevel@tonic-gate * Exit status codes 2077c478bd9Sstevel@tonic-gate */ 2087c478bd9Sstevel@tonic-gate #define X_FINOK 0 /* normal exit */ 2097c478bd9Sstevel@tonic-gate #define X_REWRITE 2 /* restart writing from the check point */ 2107c478bd9Sstevel@tonic-gate #define X_ABORT 3 /* abort all of dump; no checkpoint restart */ 2117c478bd9Sstevel@tonic-gate #define X_VERIFY 4 /* verify the reel just written */ 2127c478bd9Sstevel@tonic-gate #define X_RESTART 5 /* abort all progress so far; attempt restart */ 2137c478bd9Sstevel@tonic-gate 2147c478bd9Sstevel@tonic-gate #define NINCREM "/etc/dumpdates" /* new format incremental info */ 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate #define TAPE "/dev/rmt/0b" /* default tape device */ 2177c478bd9Sstevel@tonic-gate #define OPGRENT "sys" /* group entry to notify */ 2187c478bd9Sstevel@tonic-gate #define DIALUP "ttyd" /* prefix for dialups */ 2197c478bd9Sstevel@tonic-gate 2207c478bd9Sstevel@tonic-gate #define DISKETTE "/dev/rfd0c" 2217c478bd9Sstevel@tonic-gate 2227c478bd9Sstevel@tonic-gate #define NBUF 64 /* number of output buffers */ 2237c478bd9Sstevel@tonic-gate #define MAXNTREC 256 /* max tape blocking factor (in Kb) */ 2247c478bd9Sstevel@tonic-gate 2257c478bd9Sstevel@tonic-gate /* 2267c478bd9Sstevel@tonic-gate * The contents of the file NINCREM are maintained both on 2277c478bd9Sstevel@tonic-gate * a linked list and then (eventually) arrayified. 2287c478bd9Sstevel@tonic-gate */ 2297c478bd9Sstevel@tonic-gate struct idates { 2307c478bd9Sstevel@tonic-gate char id_name[MAXNAMLEN+3]; 2317c478bd9Sstevel@tonic-gate char id_incno; 2327c478bd9Sstevel@tonic-gate time32_t id_ddate; 2337c478bd9Sstevel@tonic-gate }; 2347c478bd9Sstevel@tonic-gate 2357c478bd9Sstevel@tonic-gate size_t nidates; /* number of records (might be zero) */ 2367c478bd9Sstevel@tonic-gate struct idates **idatev; /* the arrayfied version */ 2377c478bd9Sstevel@tonic-gate #define ITITERATE(i, ip) \ 2387c478bd9Sstevel@tonic-gate for (i = 0; i < nidates && (ip = idatev[i]) != NULL; i++) 2397c478bd9Sstevel@tonic-gate 2407c478bd9Sstevel@tonic-gate /* 2417c478bd9Sstevel@tonic-gate * Function declarations 2427c478bd9Sstevel@tonic-gate */ 2437c478bd9Sstevel@tonic-gate #ifdef __STDC__ 2447c478bd9Sstevel@tonic-gate /* 2457c478bd9Sstevel@tonic-gate * dumpfstab.c 2467c478bd9Sstevel@tonic-gate */ 2477c478bd9Sstevel@tonic-gate extern void mnttabread(void); 2487c478bd9Sstevel@tonic-gate extern struct mntent *mnttabsearch(char *, int); 2497c478bd9Sstevel@tonic-gate extern void setmnttab(void); 2507c478bd9Sstevel@tonic-gate extern struct mntent *getmnttab(void); 2517c478bd9Sstevel@tonic-gate /* 2527c478bd9Sstevel@tonic-gate * dumpitime.c 2537c478bd9Sstevel@tonic-gate */ 2547c478bd9Sstevel@tonic-gate extern char *prdate(time_t); 2557c478bd9Sstevel@tonic-gate extern void inititimes(void); 2567c478bd9Sstevel@tonic-gate extern void getitime(void); 2577c478bd9Sstevel@tonic-gate extern void putitime(void); 2587c478bd9Sstevel@tonic-gate extern void est(struct dinode *); 2597c478bd9Sstevel@tonic-gate extern time32_t is_fssnap_dump(char *); 2607c478bd9Sstevel@tonic-gate extern void bmapest(uchar_t *); 2617c478bd9Sstevel@tonic-gate /* 2627c478bd9Sstevel@tonic-gate * dumplabel.c 2637c478bd9Sstevel@tonic-gate */ 2647c478bd9Sstevel@tonic-gate extern void getlabel(void); 2657c478bd9Sstevel@tonic-gate /* 2667c478bd9Sstevel@tonic-gate * dumpmain.c 2677c478bd9Sstevel@tonic-gate */ 2687c478bd9Sstevel@tonic-gate extern void child_chdir(void); 2697c478bd9Sstevel@tonic-gate extern char *unrawname(char *); 2707c478bd9Sstevel@tonic-gate extern void sigAbort(int); 2717c478bd9Sstevel@tonic-gate extern char *rawname(char *); 2727c478bd9Sstevel@tonic-gate extern char *lf_rawname(char *); 2737c478bd9Sstevel@tonic-gate extern time32_t timeclock(time32_t); 2747c478bd9Sstevel@tonic-gate #ifdef signal 2757c478bd9Sstevel@tonic-gate extern void (*nsignal(int, void (*)(int)))(int); 2767c478bd9Sstevel@tonic-gate #endif 2777c478bd9Sstevel@tonic-gate extern int safe_file_open(const char *file, int mode, int perms); 2787c478bd9Sstevel@tonic-gate extern int safe_device_open(const char *file, int mode, int perms); 2797c478bd9Sstevel@tonic-gate extern FILE *safe_fopen(const char *filename, const char *smode, int perms); 2807c478bd9Sstevel@tonic-gate /* 2817c478bd9Sstevel@tonic-gate * dumponline.c 2827c478bd9Sstevel@tonic-gate */ 2837c478bd9Sstevel@tonic-gate extern void allocino(void); 2847c478bd9Sstevel@tonic-gate extern void freeino(void); 2857c478bd9Sstevel@tonic-gate extern void saveino(ino_t, struct dinode *); 2867c478bd9Sstevel@tonic-gate extern void resetino(ino_t); 2877c478bd9Sstevel@tonic-gate extern long getigen(ino_t); 2887c478bd9Sstevel@tonic-gate extern int lf_ismounted(char *, char *); 2897c478bd9Sstevel@tonic-gate extern int isoperator(uid_t, gid_t); 2907c478bd9Sstevel@tonic-gate extern int lockfs(char *, char *); 2917c478bd9Sstevel@tonic-gate extern int openi(ino_t, long, char *); 2927c478bd9Sstevel@tonic-gate extern caddr_t mapfile(int, off_t, off_t, int); 2937c478bd9Sstevel@tonic-gate extern void unmapfile(void); 2947c478bd9Sstevel@tonic-gate extern void stattoi(struct stat *, struct dinode *); 2957c478bd9Sstevel@tonic-gate extern void dumpfile(int, caddr_t, off_t, off_t, off_t, int, int); 2967c478bd9Sstevel@tonic-gate extern void activepass(void); 2977c478bd9Sstevel@tonic-gate /* 2987c478bd9Sstevel@tonic-gate * dumpoptr.c 2997c478bd9Sstevel@tonic-gate */ 3007c478bd9Sstevel@tonic-gate extern int query(char *); 3017c478bd9Sstevel@tonic-gate extern int query_once(char *, int); 3027c478bd9Sstevel@tonic-gate extern void interrupt(int); 3037c478bd9Sstevel@tonic-gate extern void broadcast(char *); 3047c478bd9Sstevel@tonic-gate extern void timeest(int, int); 3057c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/ 3067c478bd9Sstevel@tonic-gate extern void msg(const char *, ...); 3077c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/ 3087c478bd9Sstevel@tonic-gate extern void msgtail(const char *, ...); 3097c478bd9Sstevel@tonic-gate extern void lastdump(int); 3107c478bd9Sstevel@tonic-gate extern char *getresponse(char *, char *); 3117c478bd9Sstevel@tonic-gate /* 3127c478bd9Sstevel@tonic-gate * dumptape.c 3137c478bd9Sstevel@tonic-gate */ 3147c478bd9Sstevel@tonic-gate extern void alloctape(void); 3157c478bd9Sstevel@tonic-gate extern void reset(void); 3167c478bd9Sstevel@tonic-gate extern void spclrec(void); 3177c478bd9Sstevel@tonic-gate extern void taprec(uchar_t *, int, int); 3187c478bd9Sstevel@tonic-gate extern void dmpblk(daddr32_t, size_t, off_t); 3197c478bd9Sstevel@tonic-gate extern void toslave(void (*)(ino_t), ino_t); 3207c478bd9Sstevel@tonic-gate extern void doinode(ino_t); 3217c478bd9Sstevel@tonic-gate extern void dospcl(ino_t); 3227c478bd9Sstevel@tonic-gate extern void flushcmds(void); 3237c478bd9Sstevel@tonic-gate extern void flusht(void); 3247c478bd9Sstevel@tonic-gate extern void nextdevice(void); 3257c478bd9Sstevel@tonic-gate extern int isrewind(int); 3267c478bd9Sstevel@tonic-gate extern void trewind(void); 3277c478bd9Sstevel@tonic-gate extern void close_rewind(void); 3287c478bd9Sstevel@tonic-gate extern void changevol(void); 3297c478bd9Sstevel@tonic-gate extern void otape(int); 3307c478bd9Sstevel@tonic-gate extern void dumpabort(void); 3317c478bd9Sstevel@tonic-gate extern void dumpailing(void); 3327c478bd9Sstevel@tonic-gate extern void Exit(int); 3337c478bd9Sstevel@tonic-gate extern void positiontape(char *); 3347c478bd9Sstevel@tonic-gate /* 3357c478bd9Sstevel@tonic-gate * dumptraverse.c 3367c478bd9Sstevel@tonic-gate */ 3377c478bd9Sstevel@tonic-gate extern void pass(void (*)(struct dinode *), uchar_t *); 3387c478bd9Sstevel@tonic-gate extern void mark(struct dinode *); 3397c478bd9Sstevel@tonic-gate extern void active_mark(struct dinode *); 3407c478bd9Sstevel@tonic-gate extern void markshad(struct dinode *); 3417c478bd9Sstevel@tonic-gate extern void estshad(struct dinode *); 3427c478bd9Sstevel@tonic-gate extern void freeshad(); 3437c478bd9Sstevel@tonic-gate extern void add(struct dinode *); 3447c478bd9Sstevel@tonic-gate extern void dirdump(struct dinode *); 3457c478bd9Sstevel@tonic-gate extern void dump(struct dinode *); 3467c478bd9Sstevel@tonic-gate extern void lf_dump(struct dinode *); 3477c478bd9Sstevel@tonic-gate extern void dumpblocks(ino_t); 3487c478bd9Sstevel@tonic-gate extern void bitmap(uchar_t *, int); 3497c478bd9Sstevel@tonic-gate extern struct dinode *getino(ino_t); 3507c478bd9Sstevel@tonic-gate extern void bread(diskaddr_t, uchar_t *, size_t); 3517c478bd9Sstevel@tonic-gate extern int hasshortmeta(struct dinode **ip); 3527c478bd9Sstevel@tonic-gate /* 3537c478bd9Sstevel@tonic-gate * lftw.c 3547c478bd9Sstevel@tonic-gate */ 3557c478bd9Sstevel@tonic-gate extern int lftw(const char *, 3567c478bd9Sstevel@tonic-gate int (*)(const char *, const struct stat *, int), int); 3577c478bd9Sstevel@tonic-gate extern int lf_lftw(const char *, 3587c478bd9Sstevel@tonic-gate int (*)(const char *, const struct stat64 *, int), int); 3597c478bd9Sstevel@tonic-gate /* 3607c478bd9Sstevel@tonic-gate * partial.c 3617c478bd9Sstevel@tonic-gate */ 3627c478bd9Sstevel@tonic-gate extern void partial_check(void); 3637c478bd9Sstevel@tonic-gate extern void lf_partial_check(void); 3647c478bd9Sstevel@tonic-gate extern int partial_mark(int, char **); 3657c478bd9Sstevel@tonic-gate /* 3667c478bd9Sstevel@tonic-gate * unctime.c 3677c478bd9Sstevel@tonic-gate */ 3687c478bd9Sstevel@tonic-gate extern time_t unctime(char *); 3697c478bd9Sstevel@tonic-gate #else /* !STDC */ 3707c478bd9Sstevel@tonic-gate /* 3717c478bd9Sstevel@tonic-gate * dumpfstab.c 3727c478bd9Sstevel@tonic-gate */ 3737c478bd9Sstevel@tonic-gate extern void mnttabread(); 3747c478bd9Sstevel@tonic-gate extern struct mntent *mnttabsearch(); 3757c478bd9Sstevel@tonic-gate extern void setmnttab(); 3767c478bd9Sstevel@tonic-gate extern struct mntent *getmnttab(); 3777c478bd9Sstevel@tonic-gate /* 3787c478bd9Sstevel@tonic-gate * dumpitime.c 3797c478bd9Sstevel@tonic-gate */ 3807c478bd9Sstevel@tonic-gate extern char *prdate(); 3817c478bd9Sstevel@tonic-gate extern void inititimes(); 3827c478bd9Sstevel@tonic-gate extern void getitime(); 3837c478bd9Sstevel@tonic-gate extern void putitime(); 3847c478bd9Sstevel@tonic-gate extern void est(); 3857c478bd9Sstevel@tonic-gate extern time32_t is_fssnap_dump(); 3867c478bd9Sstevel@tonic-gate extern void bmapest(); 3877c478bd9Sstevel@tonic-gate /* 3887c478bd9Sstevel@tonic-gate * dumplabel.c 3897c478bd9Sstevel@tonic-gate */ 3907c478bd9Sstevel@tonic-gate extern void getlabel(); 3917c478bd9Sstevel@tonic-gate /* 3927c478bd9Sstevel@tonic-gate * dumpmain.c 3937c478bd9Sstevel@tonic-gate */ 3947c478bd9Sstevel@tonic-gate extern void child_chdir(); 3957c478bd9Sstevel@tonic-gate extern char *unrawname(); 3967c478bd9Sstevel@tonic-gate extern void sigAbort(); 3977c478bd9Sstevel@tonic-gate extern char *rawname(); 3987c478bd9Sstevel@tonic-gate extern char *lf_rawname(); 3997c478bd9Sstevel@tonic-gate extern time_t timeclock(); 4007c478bd9Sstevel@tonic-gate #ifdef signal 4017c478bd9Sstevel@tonic-gate extern void nsignal(); 4027c478bd9Sstevel@tonic-gate #endif 4037c478bd9Sstevel@tonic-gate extern int safe_file_open(); 4047c478bd9Sstevel@tonic-gate extern int safe_device_open(); 4057c478bd9Sstevel@tonic-gate extern FILE *safe_fopen(); 4067c478bd9Sstevel@tonic-gate /* 4077c478bd9Sstevel@tonic-gate * dumponline.c 4087c478bd9Sstevel@tonic-gate */ 4097c478bd9Sstevel@tonic-gate extern void allocino(); 4107c478bd9Sstevel@tonic-gate extern void freeino(); 4117c478bd9Sstevel@tonic-gate extern void saveino(); 4127c478bd9Sstevel@tonic-gate extern void resetino(); 4137c478bd9Sstevel@tonic-gate extern long getigen(); 4147c478bd9Sstevel@tonic-gate extern int lf_ismounted(); 4157c478bd9Sstevel@tonic-gate extern int isoperator(); 4167c478bd9Sstevel@tonic-gate extern ulong_t lockfs(); 4177c478bd9Sstevel@tonic-gate extern int openi(); 4187c478bd9Sstevel@tonic-gate extern caddr_t mapfile(); 4197c478bd9Sstevel@tonic-gate extern void unmapfile(); 4207c478bd9Sstevel@tonic-gate extern void stattoi(); 4217c478bd9Sstevel@tonic-gate extern void dumpfile(); 4227c478bd9Sstevel@tonic-gate extern void activepass(); 4237c478bd9Sstevel@tonic-gate /* 4247c478bd9Sstevel@tonic-gate * dumpoptr.c 4257c478bd9Sstevel@tonic-gate */ 4267c478bd9Sstevel@tonic-gate extern int query(); 4277c478bd9Sstevel@tonic-gate extern int query_once(); 4287c478bd9Sstevel@tonic-gate extern void interrupt(); 4297c478bd9Sstevel@tonic-gate extern void broadcast(); 4307c478bd9Sstevel@tonic-gate extern void timeest(); 4317c478bd9Sstevel@tonic-gate extern void msg(); 4327c478bd9Sstevel@tonic-gate extern void msgtail(); 4337c478bd9Sstevel@tonic-gate extern void lastdump(); 4347c478bd9Sstevel@tonic-gate extern char *getresponse(); 4357c478bd9Sstevel@tonic-gate /* 4367c478bd9Sstevel@tonic-gate * dumptape.c 4377c478bd9Sstevel@tonic-gate */ 4387c478bd9Sstevel@tonic-gate extern void alloctape(); 4397c478bd9Sstevel@tonic-gate extern void reset(); 4407c478bd9Sstevel@tonic-gate extern void spclrec(); 4417c478bd9Sstevel@tonic-gate extern void taprec(); 4427c478bd9Sstevel@tonic-gate extern void dmpblk(); 4437c478bd9Sstevel@tonic-gate extern void toslave(); 4447c478bd9Sstevel@tonic-gate extern void doinode(); 4457c478bd9Sstevel@tonic-gate extern void dospcl(); 4467c478bd9Sstevel@tonic-gate extern void flushcmds(); 4477c478bd9Sstevel@tonic-gate extern void flusht(); 4487c478bd9Sstevel@tonic-gate extern void nextdevice(); 4497c478bd9Sstevel@tonic-gate extern int isrewind(); 4507c478bd9Sstevel@tonic-gate extern void trewind(); 4517c478bd9Sstevel@tonic-gate extern void close_rewind(); 4527c478bd9Sstevel@tonic-gate extern void changevol(); 4537c478bd9Sstevel@tonic-gate extern void otape(); 4547c478bd9Sstevel@tonic-gate extern void dumpabort(); 4557c478bd9Sstevel@tonic-gate extern void dumpailing(); 4567c478bd9Sstevel@tonic-gate extern void Exit(); 4577c478bd9Sstevel@tonic-gate extern void positiontape(); 4587c478bd9Sstevel@tonic-gate /* 4597c478bd9Sstevel@tonic-gate * dumptraverse.c 4607c478bd9Sstevel@tonic-gate */ 4617c478bd9Sstevel@tonic-gate extern void pass(); 4627c478bd9Sstevel@tonic-gate extern void mark(); 4637c478bd9Sstevel@tonic-gate extern void active_mark(); 4647c478bd9Sstevel@tonic-gate extern void markshad(); 4657c478bd9Sstevel@tonic-gate extern void estshad(); 4667c478bd9Sstevel@tonic-gate extern void freeshad(); 4677c478bd9Sstevel@tonic-gate extern void add(); 4687c478bd9Sstevel@tonic-gate extern void dirdump(); 4697c478bd9Sstevel@tonic-gate extern void dump(); 4707c478bd9Sstevel@tonic-gate extern void lf_dump(); 4717c478bd9Sstevel@tonic-gate extern void dumpblocks(); 4727c478bd9Sstevel@tonic-gate extern void bitmap(); 4737c478bd9Sstevel@tonic-gate extern struct dinode *getino(); 4747c478bd9Sstevel@tonic-gate extern void bread(); 4757c478bd9Sstevel@tonic-gate extern int hasshortmeta(); 4767c478bd9Sstevel@tonic-gate /* 4777c478bd9Sstevel@tonic-gate * lftw.c 4787c478bd9Sstevel@tonic-gate */ 4797c478bd9Sstevel@tonic-gate extern int lftw(); 4807c478bd9Sstevel@tonic-gate extern int lf_lftw(); 4817c478bd9Sstevel@tonic-gate /* 4827c478bd9Sstevel@tonic-gate * partial.c 4837c478bd9Sstevel@tonic-gate */ 4847c478bd9Sstevel@tonic-gate extern void partial_check(); 4857c478bd9Sstevel@tonic-gate extern void lf_partial_check(); 4867c478bd9Sstevel@tonic-gate extern int partial_mark(); 4877c478bd9Sstevel@tonic-gate /* 4887c478bd9Sstevel@tonic-gate * unctime.c 4897c478bd9Sstevel@tonic-gate */ 4907c478bd9Sstevel@tonic-gate extern time_t unctime(); 4917c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 4927c478bd9Sstevel@tonic-gate 4937c478bd9Sstevel@tonic-gate /* Insufficiently-featureful system header files... */ 4947c478bd9Sstevel@tonic-gate NOTE(ALIGNMENT(mmap, 8)) 4957c478bd9Sstevel@tonic-gate 4967c478bd9Sstevel@tonic-gate 4977c478bd9Sstevel@tonic-gate #ifdef __cplusplus 4987c478bd9Sstevel@tonic-gate } 4997c478bd9Sstevel@tonic-gate #endif 5007c478bd9Sstevel@tonic-gate 5017c478bd9Sstevel@tonic-gate #endif /* _DUMP_H */ 502