diff options
author | sjg <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
commit | 65145fa4c81da358fcbc3b650156dab705dfa34e (patch) | |
tree | 55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /sbin/newfs | |
parent | 60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff) | |
parent | e6b664c390af88d4a87208bc042ce503da664c3b (diff) | |
download | FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz |
Merge sync of head
Diffstat (limited to 'sbin/newfs')
-rw-r--r-- | sbin/newfs/Makefile | 3 | ||||
-rw-r--r-- | sbin/newfs/newfs.8 | 4 | ||||
-rw-r--r-- | sbin/newfs/newfs.c | 30 |
3 files changed, 3 insertions, 34 deletions
diff --git a/sbin/newfs/Makefile b/sbin/newfs/Makefile index d45143b..83801fd 100644 --- a/sbin/newfs/Makefile +++ b/sbin/newfs/Makefile @@ -4,8 +4,7 @@ .PATH: ${.CURDIR}/../../sys/geom PROG= newfs -DPADD= ${LIBUFS} ${LIBUTIL} -LDADD= -lufs -lutil +LIBADD= ufs util SRCS= newfs.c mkfs.c geom_bsd_enc.c WARNS?= 3 diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index 6764adc..a4c0358 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -310,10 +310,10 @@ on file systems that contain many small files. .Xr fsck 8 , .Xr gjournal 8 , .Xr growfs 8 , +.Xr gvinum 8 , .Xr makefs 8 , .Xr mount 8 , -.Xr tunefs 8 , -.Xr gvinum 8 +.Xr tunefs 8 .Rs .%A M. McKusick .%A W. Joy 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() { |