Date: Thu, 16 Nov 2006 16:23:07 -0500 From: Jung-uk Kim <jkim@FreeBSD.org> To: freebsd-current@FreeBSD.org Cc: freebsd-fs@FreeBSD.org, Pawel Jakub Dawidek <pjd@FreeBSD.org> Subject: Re: ZFS patches for FreeBSD. Message-ID: <200611161623.10758.jkim@FreeBSD.org> In-Reply-To: <200611162005.kAGK58cB084521@ambrisko.com> References: <200611162005.kAGK58cB084521@ambrisko.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 16 November 2006 03:05 pm, Doug Ambrisko wrote: > This is on i386: > one% grep memset zfs_20061117.patch > + (void) memset(p, 0, n); > + (void) memset(wp, 0, sizeof (*wp)); > + (void) memset(wp, 0, sizeof (*wp)); > +zap_memset(void *a, int c, size_t n) > + zap_memset(&l->l_phys->l_hdr, 0, sizeof (struct > zap_leaf_header)); + zap_memset(l->l_phys->l_hash, CHAIN_END, > 2*ZAP_LEAF_HASH_NUMENTRIES(l)); + > zap_memset(l->l_phys->l_hash, CHAIN_END, > 2*ZAP_LEAF_HASH_NUMENTRIES(l)); one% > > In contrib/opensolaris/lib/libuutil/common/uu_alloc.c > +void * > +uu_zalloc(size_t n) > +{ > + void *p = malloc(n); > + > + if (p == NULL) { > + uu_set_error(UU_ERROR_SYSTEM); > + return (NULL); > + } > + > + (void) memset(p, 0, n); > + > + return (p); > +} > + > > %nm dmu_objset.o | grep memset > U memset > % > > If I run it compile -E I see > static __inline void * > memset(void *b, int c, size_t len) > { > char *bb; > > if (c == 0) > bzero(b, len); > else > for (bb = (char *)b; len--; ) > *bb++ = c; > return (b); > } > > and nothing calling it unless it is what Max. is talking about. > I don't see other stuff breaking. It seems the memset() is not used in the kernel part. However, there are at least three places, which does 'struct foo bar = { 0 }': %grep '{ 0 }' zfs_20061117_sys.patch + struct oscarg oa = { 0 }; + struct snaparg sn = { 0 }; + zfs_create_data_t cbdata = { 0 }; (Note: zfs_20061117_sys.patch is extracted from the original patch.) The first two are from dmu_objset_create() and dmu_objset_snapshot() in sys/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c and that is what you saw. The third one is from zfs_ioc_create() in sys/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c. FYI... Jung-uk Kim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611161623.10758.jkim>