Re: Deleting large files

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Enrico Weigelt
Date: Sunday, May 11, 2008 - 9:38 am

* Jan Engelhardt <jengelh@medozas.de> wrote:


Yep, the point is: on *nix there is no delete syscall, but just 
an unlink (decreasing the refcount). The kernel then decides when
to actually remove the file (normally when refcount==0).

So, when refcount==0 the kernel (more precisely: the fs) could
just hand over the inode to some kthread, which does the actual 
space-reclaiming. When properly done, the case of powerfail will
catched by fsck or journal replay, just the same as when several
processes were in the middle of deleting files.

Maybe this could be implemented by an overlaying filesystem,
which essentially moves to some special deleted dir instad of 
real unlink'ing - an separate process (which even could run in 
userland) will do the actual unlinking. So when an user process
calls unlink(), the inodes don't even have to be touched.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Deleting large files, Morten Welinder, (Wed May 7, 12:49 pm)
Re: Deleting large files, Jan Engelhardt, (Wed May 7, 1:10 pm)
Re: Deleting large files, Xavier Bestel, (Wed May 7, 1:17 pm)
Re: Deleting large files, Jan Engelhardt, (Wed May 7, 1:48 pm)
Re: Deleting large files, linux-os (Dick Johnson), (Wed May 7, 3:34 pm)
Re: Deleting large files, Morten Welinder, (Wed May 7, 4:14 pm)
Re: Deleting large files, Matti Aarnio, (Thu May 8, 1:19 am)
Re: Deleting large files, Christian Kujau, (Thu May 8, 10:29 am)
Re: Deleting large files, Alan Cox, (Thu May 8, 4:01 pm)
Re: Deleting large files, Jan Engelhardt, (Sun May 11, 3:30 am)
Re: Deleting large files, Christoph Hellwig, (Sun May 11, 4:16 am)
Re: Deleting large files, Enrico Weigelt, (Sun May 11, 9:38 am)
Re: Deleting large files, Aneesh Kumar K.V, (Sun May 11, 9:42 am)
Re: Deleting large files, Pavel Machek, (Sat May 17, 5:15 am)
Re: Deleting large files, Pavel Machek, (Tue May 20, 7:33 am)