if you have time, you could use the ext3/4 code from the kernel and adapt it into a userspace library