user hook for waiting for asynchronous BTRFS activities

David Nicol davidnicol at gmail.com
Tue Nov 16 22:28:47 UTC 2010


I have written and tested a patch, and gotten approval from Chris
Mason for an ioctl number, that introduces a facility for waiting for
certain asynchronous kernel-side activities: initially, subvolume
deletion, but it seems like a general interface is in order.

Ideally, this new feature and a forward-looking extension convention
for the flags field (the ioctl takes two data, a timeout in
milliseconds and flag bits) could get discussed here before getting
included in ubuntu kernels and then going upstream.

My ideas concerning the flags field are as follows:

all zeroes: wait for pending subvolume deletions and nothing else

|1:  do not wait for subvolume deletions
|2:  fail when there is an unexpected flag bit
|4 and higher: set to enable waiting for other conditions. Currently
the kcleaner_thread has two responsibilities, deleting subvolumes and
writing out deferred inode data, so |4 will enable waiting for all
deferred inode data to get written out, and |8 and up wait for other
things to become asynchronous so they can be assigned to them.

Does that seem sound?

Also, is it worth the effort to make ioctl tools work on both 32 and
64 bit systems, or is the standard practice that tools will work on
one or the other? There are a lot of kernel data defined as "unsigned
long."




More information about the kernel-team mailing list