fsck.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980, 1986, 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that: (1) source distributions retain this entire copyright
* notice and comment, and (2) distributions including binaries display
* the following acknowledgement: ``This product includes software
* developed by the University of California, Berkeley and its contributors''
* in the documentation or other materials provided with the distribution
* and in all advertising materials mentioning features or use of this
* software. Neither the name of the University nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* Copyright (c) 1996, 1998-1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _FSCK_H
#define _FSCK_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* to buffers */
/* inodes in pass1 */
#define FIRSTAVDP 256
#ifndef BUFSIZ
#define BUFSIZ 1024
#endif
#ifdef sparc
((x) & 0xff0000) >> 8 | ((x) >> 24) & 0xff)
#else
#define SWAP16(x) (x)
#define SWAP32(x) (x)
#define SWAP64(x) (x)
#endif
#define NOTBUSY 00 /* Not busy when busymarked is set */
struct dinode {
int dummy;
};
/*
* buffer cache structure.
*/
struct bufarea {
int b_size;
int b_errs;
int b_flags;
union {
char *b_buf; /* buffer space */
} b_un;
char b_dirty;
};
#define B_INUSE 1
struct pri_vol_desc *pvolp;
struct log_vol_desc *logvp;
struct unall_desc *unallp;
struct log_vol_int_desc *lvintp;
struct anch_vol_desc_ptr *avdp;
struct file_set_desc *fileset;
struct space_bmap_desc *spacep;
struct inodesc {
int (*id_func)(); /* function to be applied to blocks of inode */
int id_numfrags; /* number of frags contained in block */
int id_loc; /* for DATA nodes, current location in dir */
int id_entryno; /* for DATA nodes, current entry number */
char *id_name; /* for DATA nodes, name to find or enter */
char id_type; /* type of descriptor, DATA or ADDR */
};
/* file types */
#define DATA 1
#define ADDR 2
/*
* File entry cache structures.
*/
struct fileinfo {
#define FEGROW 512
char *devname; /* name of device being checked */
long secsize; /* actual disk sector size */
long fsbsize; /* file system block size (same as secsize) */
char nflag; /* assume a no response */
char yflag; /* assume a yes response */
int debug; /* output debugging info */
int rflag; /* check raw file systems */
int wflag; /* check only writable filesystems */
int fflag; /* check regardless of clean flag (force) */
int sflag; /* print status flag */
char preen; /* just fix normal inconsistencies */
char mountedfs; /* checking mounted device */
int exitstat; /* exit status (set to 8 if 'No' response) */
char hotroot; /* checking root device */
char havesb; /* superblock has been read */
int fsmodified; /* 1 => write done to file system */
int fsreadfd; /* file descriptor for reading file system */
int fswritefd; /* file descriptor for writing file system */
int iscorrupt; /* known to be corrupt/inconsistent */
int isdirty; /* 1 => write pending to file system */
int mountfd; /* fd of mount point */
char *busymap; /* ptr to primary blk busy map */
char *freemap; /* ptr to copy of disk map */
/*
* bit map related macros
*/
#define STOP 0x01
#define SKIP 0x02
#define KEEPON 0x04
#define ALTERED 0x08
#define FOUND 0x10
struct inoinfo *getinoinfo();
int findino();
char *setup();
#ifndef MNTTYPE_UDFS
#define MNTTYPE_UDFS "udfs"
#endif
#define SPACEMAP_OFF 24
/* Integrity descriptor types */
#define LVI_OPEN 0
#define LVI_CLOSE 1
#ifdef __cplusplus
}
#endif
#endif /* _FSCK_H */