Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2006 12:05:08 -0800 (PST)
From:      Doug Ambrisko <ambrisko@ambrisko.com>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        freebsd-fs@FreeBSD.org, freebsd-current@FreeBSD.org
Subject:   Re: ZFS patches for FreeBSD.
Message-ID:  <200611162005.kAGK58cB084521@ambrisko.com>
In-Reply-To: <20061116191858.GF63195@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
Pawel Jakub Dawidek writes:
| On Thu, Nov 16, 2006 at 07:21:59AM -0800, Doug Ambrisko wrote:
| > I skipped the mkdir and used patch -p0.  Everything looked to compile
| > okay but when I kldload zfs is fails since the kernel doesn't
| > have memset:
| > 	%kldload zfs
| > 	link_elf: symbol memset undefined
| > 	kldload: can't load zfs: No such file or directory
| > 	%
| > Is there another change required?
| 
| I applied the patch before publishing on clean source and I don't see
| such problem... Interesting thing is that there is no memset() use in
| ZFS kernel source:
| 
| 	# grep -r memset sys/ | grep -v zap_memset
| 	#
| 
| Does anyone else seeing this problem?

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.

Doug A.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611162005.kAGK58cB084521>