From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Anthony Chee" Subject: Re: delete file entry and free space Date: Sun, 19 May 2002 20:25:59 +0800 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <000501c1ff30$5679f1f0$0100a8c0@winxp> References: <000601c1febf$4b045bb0$0100a8c0@winxp> <20020519014141.C16740@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Return-path: To: "Matthew Wilcox" List-Id: linux-fsdevel.vger.kernel.org > > Unlink probably isn't enough. On unix-like systems, space is only > reclaimed once there are no references to the inode. If a task has > that file open, it's still got a reference. You could unlink the file > and then truncate it to zero size, but any task which still has it open > could write to it, causing the file to be non-zero-sized. > > If you don't care about that, then see sys_ftruncate for how to proceed. > > -- > Revolutions do not require corporate support. > And does "rm" also involve ftruncate process? >>From manual of unlink system call, it said the space will be resused no more process reference to it. How can I know any process reference to the file, and does it reflect in dentry structure? Is it dentry->d_count? Actually, I am quite confuse on d_delete(dentry) and dput(dentry). Thanks