Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Aug 2006 12:45:16 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        freebsd-current@FreeBSD.org
Cc:        freebsd-fs@FreeBSD.org, zfs-discuss@opensolaris.org
Subject:   Porting ZFS file system to FreeBSD.
Message-ID:  <20060822104516.GB16033@garage.freebsd.pl>

next in thread | raw e-mail | index | archive | help

--A6N2fC+uXW/VQSAv
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi.

I started porting the ZFS file system to the FreeBSD operating system.

There is a lot to do, but I'm making good progress, I think.

I'm doing my work in those directories:

	contrib/opensolaris/ - userland files taken directly from
		OpenSolaris (libzfs, zpool, zfs and others)

	sys/contrib/opensolaris/ - kernel files taken directly from
		OpenSolaris (zfs, taskq, callb and others)

	compat/opensolaris/ - compatibility userland layer, so I can
		reduce diffs against vendor files

	sys/compat/opensolaris/ - compatibility kernel layer, so I can
		reduce diffs against vendor files (kmem based on
		malloc(9) and uma(9), mutexes based on our sx(9) locks,
		condvars based on sx(9) locks and more)

	cddl/ - FreeBSD specific makefiles for userland bits

	sys/modules/zfs/ - FreeBSD specific makefile for the kernel
		module

You can find all those on FreeBSD perforce server:

	http://perforce.freebsd.org/depotTreeBrowser.cgi?FSPC=3D//depot/user/pjd/z=
fs&HIDEDEL=3DNO

Ok, so where am I?

I ported the userland bits (libzfs, zfs and zpool). I had ztest and
libzpool compiling and working as well, but I left them behind for now
to focus on kernel bits.

I'm building in all (except 2) files into zfs.ko (kernel module).

I created new VDEV - vdev_geom, which fits to FreeBSD's GEOM
infrastructure, so basically you can use any GEOM provider to build your
ZFS pool. VDEV_GEOM is implemented as consumers-only GEOM class.

I reimplemented ZVOL to also export storage as GEOM provider. This time
it is providers-only GEOM class.

This way one can create for example RAID-Z on top of GELI encrypted
disks or encrypt ZFS volume. The order is free.
Basically you can put UFS on ZFS volumes already and it behaves really
stable even under heavy load.

Currently I'm working on file system bits (ZPL), which is the most hard
part of the entire ZFS port, because it talks to one of the most complex
part of the FreeBSD kernel - VFS.

I can already mount ZFS-created file systems (with 'zfs create'
command), create files/directories, change permissions/owner/etc., list
directories content, and perform few other minor operation.

Some "screenshots":

	lcf:root:~# uname -a
	FreeBSD lcf 7.0-CURRENT FreeBSD 7.0-CURRENT #74: Tue Aug 22 03:04:01 UTC 2=
006     root@lcf:/usr/obj/zoo/pjd/lcf/sys/LCF  i386

	lcf:root:~# zpool create tank raidz /dev/ad4a /dev/ad6a /dev/ad5a

	lcf:root:~# zpool list
	NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
	tank                   35,8G   11,7M   35,7G     0%  ONLINE     -

	lcf:root:~# zpool status
	  pool: tank
	 state: ONLINE
	 scrub: none requested
	config:

	        NAME        STATE     READ WRITE CKSUM
	        tank        ONLINE       0     0     0
	          raidz1    ONLINE       0     0     0
	            ad4a    ONLINE       0     0     0
	            ad6a    ONLINE       0     0     0
	            ad5a    ONLINE       0     0     0

	errors: No known data errors

	lcf:root:# zfs create -V 10g tank/vol
	lcf:root:# newfs /dev/zvol/tank/vol
	lcf:root:# mount /dev/zvol/tank/vol /mnt/test

	lcf:root:# zfs create tank/fs

	lcf:root:~# mount -t zfs,ufs
	tank on /tank (zfs, local)
	tank/fs on /tank/fs (zfs, local)
	/dev/zvol/tank/vol on /mnt/test (ufs, local)

	lcf:root:~# df -ht zfs,ufs
	Filesystem            Size    Used   Avail Capacity  Mounted on
	tank                   13G     34K     13G     0%    /tank
	tank/fs                13G     33K     13G     0%    /tank/fs
	/dev/zvol/tank/vol    9.7G    4.0K    8.9G     0%    /mnt/test

	lcf:root:~# mkdir /tank/fs/foo
	lcf:root:~# touch /tank/fs/foo/bar
	lcf:root:~# chown root:operator /tank/fs/foo /tank/fs/foo/bar
	lcf:root:~# chmod 500 /tank/fs/foo
	lcf:root:~# ls -ld /tank/fs/foo /tank/fs/foo/bar
	dr-x------  2 root  operator  3 22 sie 05:41 /tank/fs/foo
	-rw-r--r--  1 root  operator  0 22 sie 05:42 /tank/fs/foo/bar

The most important missing pieces:
- Most of the ZPL layer.
- Autoconfiguration. I need implement vdev discovery based on GEOM's taste
  mechanism.
- .zfs/ control directory (entirely commented out for now).
And many more, but hey, this is after 10 days of work.

PS. Please contact me privately if your company would like to donate to the
    ZFS effort. Even without sponsorship the work will be finished, but
    your contributions will allow me to spend more time working on ZFS.

--=20
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--A6N2fC+uXW/VQSAv
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQFE6uA8ForvXbEpPzQRAr1vAJ0T/FHgwwNxWYXh3a3298DHiOTeiwCgh/NZ
ixnrVrJZoTppOnLxNeAoGfM=
=doT1
-----END PGP SIGNATURE-----

--A6N2fC+uXW/VQSAv--



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