On Mon, Jan 12, 2009 at 01:59:10PM -0500, Moore, Joe wrote: > Nicolas Williams wrote: > > It'd be awesome to have a native directory->dataset conversion feature > > in ZFS. And, relatedly, fast moves of files across datasets > > in the same > > volume. These two RFEs have been discussed to death in the list; see > > the archives. > > This would be a nice feature to have. The most compelling technical > problem I've seen in the idea of "reparenting" a directory to be a > top-level dataset is that when a zfs filesystem is used, open files on > that filesystem have a particular devid. In order to split off the > directory onto a new zfs filesystem, you'd have to atomically change > the devid inside all the processes that have open files under that > directory. Finding those open files is practically impossible.
Hmmm, no, that's not impossible as far as kernel-land references -- rollback already has to do this, for example. If a process has stat()ed a file and recorded the {st_dev, st_ino} somewhere, then it will be confused later. But this is no different than what would happen if you did "cp -r A B && rm -rf A && mv B A", so it's hardly a serious problem. Similarly w.r.t. NFS file handles. The real problem is that ZFS needs to manage what blocks are and are not shared between the two datasets. The snapshot/clone approach does that, but inefficiently. There's an obvious way to modify the snapshot/clone approach so that you get the right amount of block sharing, but just because it's obvious does not mean that it can be implemented in one day. Nico -- _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss