From owner-freebsd-current@FreeBSD.ORG Tue Aug 22 10:45:38 2006 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E08F16A4DD; Tue, 22 Aug 2006 10:45:38 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6514043D45; Tue, 22 Aug 2006 10:45:36 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id CC7C45133B; Tue, 22 Aug 2006 12:45:34 +0200 (CEST) Received: from localhost (pjd.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 77EAC5131F; Tue, 22 Aug 2006 12:45:27 +0200 (CEST) Date: Tue, 22 Aug 2006 12:45:16 +0200 From: Pawel Jakub Dawidek To: freebsd-current@FreeBSD.org Message-ID: <20060822104516.GB16033@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="A6N2fC+uXW/VQSAv" Content-Disposition: inline X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r804 (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-fs@FreeBSD.org, zfs-discuss@opensolaris.org Subject: Porting ZFS file system to FreeBSD. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Aug 2006 10:45:38 -0000 --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--