Saturday, June 03, 2006

Current issues

These are the libzpool files that are already compiling without warnings: util.c, bplist.c, dmu.c, dmu_objset.c, dmu_traverse.c, spa.c, spa_misc.c, vdev.c, zap.c and zap_micro.c. Also, zdb.c and zdb_il.c are already compiling.
The ZFS developers have done a very good job, since all of those files required only a few simple fixes, and I expect a lot of the other ones will too (except of course kernel.c, and perhaps taskq.c - I didn't have a close look at it yet).
So far, the hard part was getting the headers right, especially zfs_context.h.

Most of the code changes so far were specific to gcc (fixing warnings) and POSIX threads (and maybe a few glibc ones, I don't know for sure). I intend to separate Linux-specific code into a linux.c file, or at least mark it with a /* LINUX */ tag, so that porting to FreeBSD will be easier.

Anyway, here's what I still have to do to make zdb work:
  • Port kernel.c (hard)
  • Port the remaining libzpool files (should be easy)
  • Figure out how to implement the atomic_add_64() and atomic_cas_64() functions..
  • Figure out how to make read-write locks work (using POSIX threads). It already has read-write locks (when __USE_UNIX98 is defined in the system header features.h), but I think it's impossible to know if the current thread owns a read (or write) lock, which is necessary to implement the RW_xxx_HELD() macros...
  • Port libumem. Actually, I'm planning on doing a simple stub implementation using malloc() and mutexes, and later integrate the libumem linux port.
  • Port whatever else is needed that I still haven't found out ;)
Comments are welcome :)

1 comment:

Anonymous said...


I intend to separate Linux-specific
code into a linux.c file, or at least
mark it with a /* LINUX */ tag, so that porting to FreeBSD will be easier.


Feel free to ask for testing code on FBSD!
(Or for porting some specific pieces there; I think that doesn't contradict SOC.)

Just drop a line to the fuse4bsd-devel list, see more at fuse4bsd.creo.hu.

Csaba