Howdy,
For several reasons it would be really convenient if there was a way to
mark a btrfs directory such that the directories created in the marked
directory would actually be automatically converted to subvolume
creation and destruction.
NFS4 particularly pivots on file system boundaries, which it seems to
include subvolumes-in-place as such boundaries.
doing this to /home is another opportunity if you have transient
accounts created by scripts/programs you cannot easily change.
Other uses include creating virtual machine sets via tarballs and such.
It would also be super useful in apps that create large cache
directories that you'll eventually drop in bulk. /usr/src is another
place where large directories come and go under installer control.
The core logic would be to upconvert any legal rmdir to a subvol delete
if it's applied to a subvol. Yes, this _would_ remove non-empty subvols,
that would be the point. Then any mkdir in that directory would create a
subvol instead of a directory.
Normal files in the directory would be unchanged.
And a normal directory moved into the directory would remain a normal
directory for obvious reasons.
And a subvol moved out of the directory (can you even do that?) would
remain a subvol for equally obvious reasons.
It's implicit that the non-superuser create/remove subvol operation
would be legal for such a directory.
Programs could be rewritten to do this explicitly, of course, but that's
a heck of a lot of impractical patching.
Anyway, just a thought I've had repeatedly that I finally thought to broach.