Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/newfs reduce bss usage
details: https://anonhg.NetBSD.org/src/rev/598960ce9412
branches: trunk
changeset: 337807:598960ce9412
user: christos <christos%NetBSD.org@localhost>
date: Tue Apr 28 15:15:53 2015 +0000
description:
reduce bss usage
diffstat:
sbin/newfs/mkfs.c | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diffs (75 lines):
diff -r 71c6ef539101 -r 598960ce9412 sbin/newfs/mkfs.c
--- a/sbin/newfs/mkfs.c Tue Apr 28 15:14:57 2015 +0000
+++ b/sbin/newfs/mkfs.c Tue Apr 28 15:15:53 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkfs.c,v 1.122 2014/04/26 14:15:08 martin Exp $ */
+/* $NetBSD: mkfs.c,v 1.123 2015/04/28 15:15:53 christos Exp $ */
/*
* Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: mkfs.c,v 1.122 2014/04/26 14:15:08 martin Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.123 2015/04/28 15:15:53 christos Exp $");
#endif
#endif /* not lint */
@@ -132,13 +132,13 @@
union {
struct fs fs;
char data[SBLOCKSIZE];
-} fsun;
-#define sblock fsun.fs
+} *fsun;
+#define sblock fsun->fs
-union {
+union Buffer {
struct quota2_header q2h;
char data[MAXBSIZE];
-} buf;
+};
struct csum *fscs_0; /* first block of cylinder summaries */
struct csum *fscs_next; /* place for next summary */
@@ -149,8 +149,8 @@
union {
struct cg cg;
char pad[MAXBSIZE];
-} cgun;
-#define acg cgun.cg
+} *cgun;
+#define acg cgun->cg
#define DIP(dp, field) \
((sblock.fs_magic == FS_UFS1_MAGIC) ? \
@@ -199,6 +199,11 @@
exit(12);
}
#endif
+ if ((fsun = mkfs_malloc(sizeof(*fsun))) == NULL)
+ exit(12);
+ if ((cgun = mkfs_malloc(sizeof(*cgun))) == NULL)
+ exit(12);
+
fsi = fi;
fso = fo;
if (Oflag == 0) {
@@ -1024,6 +1029,7 @@
fsinit(const struct timeval *tv, mode_t mfsmode, uid_t mfsuid, gid_t mfsgid)
{
union dinode node;
+ union Buffer buf;
int i;
int qblocks = 0;
int qinos = 0;
@@ -1257,6 +1263,7 @@
makedir(struct direct *protodir, int entries)
{
char *cp;
+ union Buffer buf;
int i, spcleft;
int dirblksiz = UFS_DIRBLKSIZ;
if (isappleufs)
Home |
Main Index |
Thread Index |
Old Index