Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs/chfs PR/50911: David Binderman: Optimize memset
details: https://anonhg.NetBSD.org/src/rev/60342e1f3887
branches: trunk
changeset: 814114:60342e1f3887
user: christos <christos%NetBSD.org@localhost>
date: Mon Mar 07 15:58:05 2016 +0000
description:
PR/50911: David Binderman: Optimize memset
diffstat:
usr.sbin/makefs/chfs/chfs_mkfs.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (20 lines):
diff -r 76b18ba237d4 -r 60342e1f3887 usr.sbin/makefs/chfs/chfs_mkfs.c
--- a/usr.sbin/makefs/chfs/chfs_mkfs.c Mon Mar 07 15:56:17 2016 +0000
+++ b/usr.sbin/makefs/chfs/chfs_mkfs.c Mon Mar 07 15:58:05 2016 +0000
@@ -124,7 +124,6 @@
if ((uint32_t)opts->pagesize < MINSIZE)
errx(EXIT_FAILURE, "pagesize cannot be less than %zu", MINSIZE);
buf = emalloc(opts->pagesize);
- memset(buf, 0xFF, opts->pagesize);
ebhdr.ec_hdr.magic = htole32(CHFS_MAGIC_BITMASK);
ebhdr.ec_hdr.erase_cnt = htole32(1);
@@ -132,6 +131,8 @@
(uint8_t *)&ebhdr.ec_hdr + 8, 4));
memcpy(buf, &ebhdr.ec_hdr, CHFS_EB_EC_HDR_SIZE);
+ memset(buf + CHFS_EB_EC_HDR_SIZE, 0xFF,
+ opts->pagesize - CHFS_EB_EC_HDR_SIZE);
buf_write(fsopts, buf, opts->pagesize);
Home |
Main Index |
Thread Index |
Old Index