ZFS patches for FreeBSD.

Doug Ambrisko ambrisko at ambrisko.com
Thu Nov 16 20:06:24 UTC 2006


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.


More information about the freebsd-fs mailing list