Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
UNFORTUNATELY, the directory tree of files must be deleted from the leaf inwards - and the kernel doesn't have a large enough stack to allow that to be done very well, if at all. You might be able to get the dcache to emulate it... but that will cause a huge churn of buffers during the deletion.
Second, to implement it requires you to add an entry to the VFS... and then then decide what you are going to do when the directory tree you are "mass deleting" crosses a mount point...
And then there are the issues of changing security labels... The only way to decide whether to perform the action is to first walk the tree to see if you have permission... and then walk the tree again to carry out the deletion... Or to allow for partial deletions... in which case you have to abort on the first error... and not know what has or has not been deleted.
Hmm... It is a good advice.
Fortunately there is directory wich not include other directory. And yes. I use the VFS to help me wich will provide a new method for the mass deletion. The permission... have not recomended yet because the FAT is not manages the permission. But of course it is important for other filesystems and if it is a journaling file system.... so there are a lot of work to reach the finish.
But if you know, where is the vfs implementation in the kernel because i don't find it?
VFS code is a bit spread out because it is only tied together via the vfs structure created at mount time (vfs_mount...). Much of the code is in the fs directory, but also note the include file linux/fs.h...
But I haven't written a kernel level filesystem, and especially have not done extensions to the VFS itself.