Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to add a mass delete method to the Linux kernel, but I don't know how to go about it.
It would be grateful if you could send a relevant publication or other useful information about this.
I understand that many layers have to use to reach my goal.
If someone has any idea about this, I will be happy.
It's best to not include unnecessary things in the kernel. Smart people are putting large amounts of stuff (even drivers and filesystems) outside the kernel these days.
I know, but I must use it because it is my project in the university. So I need to modify the VFS layer and the filesystem. Firstly I think the FAT filesystem is a good chance.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.