1/*
2 * Copyright (c) 1980, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 25 unchanged lines hidden (view full) ---
34 The Regents of the University of California. All rights reserved.\n";
35#endif /* not lint */
36
37#ifndef lint
38static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95";
39#endif /* not lint */
40#endif
41#include <sys/cdefs.h>
42__FBSDID("$FreeBSD: head/sbin/fsck_ffs/main.c 141611 2005-02-10 09:19:34Z ru $");
43
44#include <sys/param.h>
45#include <sys/stat.h>
46#include <sys/file.h>
47#include <sys/time.h>
48#include <sys/mount.h>
49#include <sys/resource.h>
50#include <sys/sysctl.h>
--- 181 unchanged lines hidden (view full) ---
232 size = MIBSIZE;
233 if (sysctlnametomib("vfs.ffs.adjrefcnt", adjrefcnt, &size) < 0)
234 exit(6); /* Lacks kernel support */
235 if ((mntp == NULL && sblock.fs_clean == 1) ||
236 (mntp != NULL && (sblock.fs_flags & FS_UNCLEAN) == 0))
237 exit(7); /* Filesystem clean, report it now */
238 exit(0);
239 }
240 /*
241 * If we are to do a background check:
242 * Get the mount point information of the file system
243 * create snapshot file
244 * return created snapshot file
245 * if not found, clear bkgrdflag and proceed with normal fsck
246 */
247 if (bkgrdflag) {
--- 184 unchanged lines hidden (view full) ---
432 sblock.fs_time = time(NULL);
433 sbdirty();
434 }
435 if (cvtlevel && sblk.b_dirty) {
436 /*
437 * Write out the duplicate super blocks
438 */
439 for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
440 bwrite(fswritefd, (char *)&sblock,
441 fsbtodb(&sblock, cgsblock(&sblock, cylno)),
442 SBLOCKSIZE);
443 }
444 if (rerun)
445 resolved = 0;
446
447 /*
448 * Check to see if the file system is mounted read-write.
--- 90 unchanged lines hidden ---
2 * Copyright (c) 1980, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 25 unchanged lines hidden (view full) ---
34 The Regents of the University of California. All rights reserved.\n";
35#endif /* not lint */
36
37#ifndef lint
38static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95";
39#endif /* not lint */
40#endif
41#include <sys/cdefs.h>
42__FBSDID("$FreeBSD: head/sbin/fsck_ffs/main.c 141611 2005-02-10 09:19:34Z ru $");
43
44#include <sys/param.h>
45#include <sys/stat.h>
46#include <sys/file.h>
47#include <sys/time.h>
48#include <sys/mount.h>
49#include <sys/resource.h>
50#include <sys/sysctl.h>
--- 181 unchanged lines hidden (view full) ---
232 size = MIBSIZE;
233 if (sysctlnametomib("vfs.ffs.adjrefcnt", adjrefcnt, &size) < 0)
234 exit(6); /* Lacks kernel support */
235 if ((mntp == NULL && sblock.fs_clean == 1) ||
236 (mntp != NULL && (sblock.fs_flags & FS_UNCLEAN) == 0))
237 exit(7); /* Filesystem clean, report it now */
238 exit(0);
239 }
240 /*
241 * If we are to do a background check:
242 * Get the mount point information of the file system
243 * create snapshot file
244 * return created snapshot file
245 * if not found, clear bkgrdflag and proceed with normal fsck
246 */
247 if (bkgrdflag) {
--- 184 unchanged lines hidden (view full) ---
432 sblock.fs_time = time(NULL);
433 sbdirty();
434 }
435 if (cvtlevel && sblk.b_dirty) {
436 /*
437 * Write out the duplicate super blocks
438 */
439 for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
440 bwrite(fswritefd, (char *)&sblock,
441 fsbtodb(&sblock, cgsblock(&sblock, cylno)),
442 SBLOCKSIZE);
443 }
444 if (rerun)
445 resolved = 0;
446
447 /*
448 * Check to see if the file system is mounted read-write.
--- 90 unchanged lines hidden ---