On Mon, Feb 19, 2001 at 12:25:46PM +0000, Malcolm Beattie wrote:
> I'm probably going to reimplement the "migrating hierarchical
> filesystem" (fancy name, simple idea) that I did a proof of concept
> for with Linux 1.0/1.2 (or 0.99/1.0, I forget). Migrating a file
> off the system (ext2 for now) is done by userland copying the file
> elsewhere and then, on the kernel side, an ioctl which truncates
> the file's data blocks, sets a "migrated" attribute in the (on-disk)
> inode but leaves i_size at the original size. When a process tries
> to open a file with the "migrated" attribute, it blocks and a
> migration daemon waiting in an ioctl() (or whatever) is woken up
> and passed an open file descriptor on the underlying file. The
> migration daemon gets the file data back however it likes and writes
> the data to the underlying file. When finished, it does an ioctl()
> which resets the migrated attribute and wakes any processes blocked
> in open().
Leases allow you to do this with less support from the filesystem.
Take out a write lease on the file, migrate the data, ioctl to set
it to zero. when you receive a lease break signal, migrate the data
back (you have 30 seconds to do this), ioctl to clear the flag and
fcntl to release your lease.
The 30 seconds currently isn't tunable. I've been waiting for someone
to come up with a great use for leases that isn't samba. I think you
just found it :-)
--
Revolutions do not require corporate support.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]