summaryrefslogtreecommitdiffstats
path: root/sbin/newfs/newfs.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2015-01-06 05:28:37 +0000
committerimp <imp@FreeBSD.org>2015-01-06 05:28:37 +0000
commit20163879d8b33bcbcbe0718b7369c9c8d2fd571b (patch)
tree7642f45fc42d6192ce6b58f0f4c3c598067a0410 /sbin/newfs/newfs.c
parenteeb56aacdf8296147b0913525e63370dd76dd574 (diff)
downloadFreeBSD-src-20163879d8b33bcbcbe0718b7369c9c8d2fd571b.zip
FreeBSD-src-20163879d8b33bcbcbe0718b7369c9c8d2fd571b.tar.gz
Remove old ioctl use and support, once and for all.
Diffstat (limited to 'sbin/newfs/newfs.c')
-rw-r--r--sbin/newfs/newfs.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 59b7e61..658bd42 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -117,11 +117,9 @@ static u_char bootarea[BBSIZE];
static int is_file; /* work on a file, not a device */
static char *dkname;
static char *disktype;
-static int unlabeled;
static void getfssize(intmax_t *, const char *p, intmax_t, intmax_t);
static struct disklabel *getdisklabel(char *s);
-static void rewritelabel(char *s, struct disklabel *lp);
static void usage(void);
static int expand_number_int(const char *buf, int *num);
@@ -402,12 +400,6 @@ main(int argc, char *argv[])
pp->p_size *= secperblk;
}
mkfs(pp, special);
- if (!unlabeled) {
- if (realsectorsize != DEV_BSIZE)
- pp->p_size /= realsectorsize / DEV_BSIZE;
- if (!Nflag && bcmp(pp, &oldpartition, sizeof(oldpartition)))
- rewritelabel(special, lp);
- }
ufs_disk_close(&disk);
if (!jflag)
exit(0);
@@ -451,9 +443,6 @@ getdisklabel(char *s)
return &lab;
}
- if (ioctl(disk.d_fd, DIOCGDINFO, (char *)&lab) != -1)
- return (&lab);
- unlabeled++;
if (disktype) {
lp = getdiskbyname(disktype);
if (lp != NULL)
@@ -462,25 +451,6 @@ getdisklabel(char *s)
return (NULL);
}
-void
-rewritelabel(char *s, struct disklabel *lp)
-{
- if (unlabeled)
- return;
- lp->d_checksum = 0;
- lp->d_checksum = dkcksum(lp);
- if (is_file) {
- bsd_disklabel_le_enc(bootarea + 0 /* labeloffset */ +
- 1 /* labelsoffset */ * sectorsize, lp);
- lseek(disk.d_fd, 0, SEEK_SET);
- if (write(disk.d_fd, bootarea, BBSIZE) != BBSIZE)
- errx(1, "cannot write label");
- return;
- }
- if (ioctl(disk.d_fd, DIOCWDINFO, (char *)lp) == -1)
- warn("ioctl (WDINFO): %s: can't rewrite disk label", s);
-}
-
static void
usage()
{
OpenPOWER on IntegriCloud