LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 03-24-2013, 03:15 AM   #1
detrist
LQ Newbie
 
Registered: Mar 2013
Posts: 4

Rep: Reputation: Disabled
Smile Include mass delete method into a kernel


Hi there,

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.

Thanks in advance.
 
Old 03-24-2013, 04:57 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 749
Blog Entries: 2

Rep: Reputation: 194Reputation: 194
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.
 
Old 03-24-2013, 05:08 AM   #3
detrist
LQ Newbie
 
Registered: Mar 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
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.
 
Old 03-24-2013, 06:47 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,118

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
- we've all had to conform to ivory-tower stupidity.
Right of passage.
 
Old 03-24-2013, 06:51 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,028

Rep: Reputation: 519Reputation: 519Reputation: 519Reputation: 519Reputation: 519Reputation: 519
I thought the command "mkfs" was good for that...

Really, this is NOT a good project.


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.

Last edited by jpollard; 03-24-2013 at 07:02 AM.
 
Old 03-24-2013, 08:23 AM   #6
detrist
LQ Newbie
 
Registered: Mar 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
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?

Thanks in advance.
 
Old 03-24-2013, 08:45 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,028

Rep: Reputation: 519Reputation: 519Reputation: 519Reputation: 519Reputation: 519Reputation: 519
You can start with an overview...

http://www.tldp.org/LDP/khg/HyperNew...s/vfstour.html

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.
 
Old 03-24-2013, 09:31 AM   #8
detrist
LQ Newbie
 
Registered: Mar 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
No problem, thank you the answers and the advices.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync not working with include and delete. gregmcc Linux - Newbie 5 07-14-2012 01:15 AM
[SOLVED] Easiest way to mass delete files without crasing server? guessity Linux - Newbie 3 01-18-2010 03:01 AM
LXer: Mass-Rename Files Using an Easy CLI Method LXer Syndicated Linux News 0 07-07-2008 06:20 PM
VIM: How to delete all lines that include special words. cryincold Linux - Software 3 02-09-2008 11:17 PM
force delete/remove and mass file permissions-setting moxieman99 Linux - Newbie 2 02-15-2004 11:43 AM


All times are GMT -5. The time now is 12:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration