setup.c (57573) | setup.c (62668) |
---|---|
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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static const char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95"; 37#endif 38static const char rcsid[] = | 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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static const char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95"; 37#endif 38static const char rcsid[] = |
39 "$FreeBSD: head/sbin/fsck_ffs/setup.c 57573 2000-02-28 20:02:41Z mckusick $"; | 39 "$FreeBSD: head/sbin/fsck_ffs/setup.c 62668 2000-07-06 02:03:11Z mckusick $"; |
40#endif /* not lint */ 41 42#define DKTYPENAMES 43#include <sys/param.h> 44#include <sys/stat.h> 45#include <sys/disklabel.h> 46#include <sys/file.h> 47 --- 29 unchanged lines hidden (view full) --- 77 long skipclean, bmapsize; 78 struct disklabel *lp; 79 off_t sizepb; 80 struct stat statb; 81 struct fs proto; 82 83 havesb = 0; 84 fswritefd = -1; | 40#endif /* not lint */ 41 42#define DKTYPENAMES 43#include <sys/param.h> 44#include <sys/stat.h> 45#include <sys/disklabel.h> 46#include <sys/file.h> 47 --- 29 unchanged lines hidden (view full) --- 77 long skipclean, bmapsize; 78 struct disklabel *lp; 79 off_t sizepb; 80 struct stat statb; 81 struct fs proto; 82 83 havesb = 0; 84 fswritefd = -1; |
85 cursnapshot = 0; |
|
85 skipclean = fflag ? 0 : preen; 86 if (stat(dev, &statb) < 0) { 87 printf("Can't stat %s: %s\n", dev, strerror(errno)); 88 return (0); 89 } 90 if ((statb.st_mode & S_IFMT) != S_IFCHR && 91 (statb.st_mode & S_IFMT) != S_IFBLK) { | 86 skipclean = fflag ? 0 : preen; 87 if (stat(dev, &statb) < 0) { 88 printf("Can't stat %s: %s\n", dev, strerror(errno)); 89 return (0); 90 } 91 if ((statb.st_mode & S_IFMT) != S_IFCHR && 92 (statb.st_mode & S_IFMT) != S_IFBLK) { |
92 pfatal("%s is not a disk device", dev); 93 if (reply("CONTINUE") == 0) 94 return (0); | 93 if ((statb.st_flags & SF_SNAPSHOT) != 0) { 94 cursnapshot = statb.st_ino; 95 } else { 96 pfatal("%s is not a disk device", dev); 97 if (reply("CONTINUE") == 0) 98 return (0); 99 } |
95 } 96 if ((fsreadfd = open(dev, O_RDONLY)) < 0) { 97 printf("Can't open %s: %s\n", dev, strerror(errno)); 98 return (0); 99 } 100 if (preen == 0) 101 printf("** %s", dev); 102 if (nflag || (fswritefd = open(dev, O_WRONLY)) < 0) { --- 270 unchanged lines hidden (view full) --- 373 altsblock.fs_maxcontig = sblock.fs_maxcontig; 374 altsblock.fs_minfree = sblock.fs_minfree; 375 altsblock.fs_optim = sblock.fs_optim; 376 altsblock.fs_rotdelay = sblock.fs_rotdelay; 377 altsblock.fs_maxbpg = sblock.fs_maxbpg; 378 memmove(altsblock.fs_csp, sblock.fs_csp, sizeof sblock.fs_csp); 379 altsblock.fs_maxcluster = sblock.fs_maxcluster; 380 memmove(altsblock.fs_fsmnt, sblock.fs_fsmnt, sizeof sblock.fs_fsmnt); | 100 } 101 if ((fsreadfd = open(dev, O_RDONLY)) < 0) { 102 printf("Can't open %s: %s\n", dev, strerror(errno)); 103 return (0); 104 } 105 if (preen == 0) 106 printf("** %s", dev); 107 if (nflag || (fswritefd = open(dev, O_WRONLY)) < 0) { --- 270 unchanged lines hidden (view full) --- 378 altsblock.fs_maxcontig = sblock.fs_maxcontig; 379 altsblock.fs_minfree = sblock.fs_minfree; 380 altsblock.fs_optim = sblock.fs_optim; 381 altsblock.fs_rotdelay = sblock.fs_rotdelay; 382 altsblock.fs_maxbpg = sblock.fs_maxbpg; 383 memmove(altsblock.fs_csp, sblock.fs_csp, sizeof sblock.fs_csp); 384 altsblock.fs_maxcluster = sblock.fs_maxcluster; 385 memmove(altsblock.fs_fsmnt, sblock.fs_fsmnt, sizeof sblock.fs_fsmnt); |
386 memmove(altsblock.fs_snapinum, sblock.fs_snapinum, 387 sizeof sblock.fs_snapinum); |
|
381 memmove(altsblock.fs_sparecon, 382 sblock.fs_sparecon, sizeof sblock.fs_sparecon); 383 /* 384 * The following should not have to be copied. 385 */ 386 altsblock.fs_fsbtodb = sblock.fs_fsbtodb; 387 altsblock.fs_interleave = sblock.fs_interleave; 388 altsblock.fs_npsect = sblock.fs_npsect; --- 125 unchanged lines hidden --- | 388 memmove(altsblock.fs_sparecon, 389 sblock.fs_sparecon, sizeof sblock.fs_sparecon); 390 /* 391 * The following should not have to be copied. 392 */ 393 altsblock.fs_fsbtodb = sblock.fs_fsbtodb; 394 altsblock.fs_interleave = sblock.fs_interleave; 395 altsblock.fs_npsect = sblock.fs_npsect; --- 125 unchanged lines hidden --- |