util.h revision 1.2
11.2Sperseant/* $NetBSD: util.h,v 1.2 2025/10/18 22:20:02 perseant Exp $ */ 21.1Sperseant 31.1Sperseant/* Creat test image and filesystem, record superblock locations */ 41.1Sperseantvoid create_lfs(size_t, size_t, int, int); 51.1Sperseant 61.1Sperseant/* Write a well-known byte pattern into a file, appending if it exists */ 71.1Sperseantint write_file(const char *, off_t, int); 81.1Sperseant 91.1Sperseant/* Check the byte pattern and size of the file */ 101.1Sperseantint check_file(const char *, int); 111.1Sperseant 121.1Sperseant/* Check the file system for consistency */ 131.1Sperseantint fsck(void); 141.1Sperseant 151.1Sperseant/* Run dumplfs; for debugging */ 161.1Sperseantvoid dumplfs(void); 171.1Sperseant 181.1Sperseant#define MAXLINE 132 191.1Sperseant#define CHUNKSIZE 300 201.2Sperseant#define SEGSIZE 32768 211.1Sperseant 221.1Sperseant#define IMGNAME "disk.img" 231.1Sperseant#define FAKEBLK "/dev/blk" 241.1Sperseant#define LOGFILE "newfs.log" 251.1Sperseant 261.1Sperseant#define MP "/mp" 271.1Sperseant 281.1Sperseantextern long long sbaddr[2]; 29