summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-04-19 02:19:20 +0000
committerphk <phk@FreeBSD.org>1995-04-19 02:19:20 +0000
commitc25099ace8a9cd978e57aeaa77425387cd82e6dd (patch)
treea8659f16402a27f842aad6b6363cbae2593e07bd /sbin/newfs
parent4330105d460ac727c3a5451d4057f438f7ed3b17 (diff)
downloadFreeBSD-src-c25099ace8a9cd978e57aeaa77425387cd82e6dd.zip
FreeBSD-src-c25099ace8a9cd978e57aeaa77425387cd82e6dd.tar.gz
Yank out the rewriting of disklabels. This code can and will get confused
in a couple of cases, and it doesn't do much anyway. It used to save only the newfs params (block/frag/cgroup.. and nothing more. Something that don't belong in a disklabel in the first place.
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/newfs.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 72b75e6..3714e95 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -525,8 +525,6 @@ main(argc, argv)
if (realsectorsize != DEV_BSIZE)
pp->p_size *= DEV_BSIZE / realsectorsize;
#endif
- if (!Nflag && bcmp(pp, &oldpartition, sizeof(oldpartition)))
- rewritelabel(special, fso, lp);
if (!Nflag)
close(fso);
close(fsi);
@@ -584,56 +582,6 @@ getdisklabel(s, fd)
return (&lab);
}
-rewritelabel(s, fd, lp)
- char *s;
- int fd;
- register struct disklabel *lp;
-{
-#ifdef COMPAT
- if (unlabeled)
- return;
-#endif
- lp->d_checksum = 0;
- lp->d_checksum = dkcksum(lp);
- if (ioctl(fd, DIOCWDINFO, (char *)lp) < 0) {
- warn("ioctl (WDINFO)");
- fatal("%s: can't rewrite disk label", s);
- }
-#if vax
- if (lp->d_type == DTYPE_SMD && lp->d_flags & D_BADSECT) {
- register i;
- int cfd;
- daddr_t alt;
- char specname[64];
- char blk[1024];
- char *cp;
-
- /*
- * Make name for 'c' partition.
- */
- strcpy(specname, s);
- cp = specname + strlen(specname) - 1;
- if (!isdigit(*cp))
- *cp = 'c';
- cfd = open(specname, O_WRONLY);
- if (cfd < 0)
- fatal("%s: %s", specname, strerror(errno));
- bzero(blk, sizeof(blk));
- *(struct disklabel *)(blk + LABELOFFSET) = *lp;
- alt = lp->d_ncylinders * lp->d_secpercyl - lp->d_nsectors;
- for (i = 1; i < 11 && i < lp->d_nsectors; i += 2) {
- if (lseek(cfd, (off_t)(alt + i) * lp->d_secsize,
- L_SET) == -1)
- fatal("lseek to badsector area: %s",
- strerror(errno));
- if (write(cfd, blk, lp->d_secsize) < lp->d_secsize)
- warn("alternate label %d write", i/2);
- }
- close(cfd);
- }
-#endif
-}
-
/*VARARGS*/
void
#if __STDC__
OpenPOWER on IntegriCloud