From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: delete file entry and free space Date: Sun, 19 May 2002 15:47:44 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20020519154744.A14534@parcelfarce.linux.theplanet.co.uk> References: <000601c1febf$4b045bb0$0100a8c0@winxp> <20020519014141.C16740@parcelfarce.linux.theplanet.co.uk> <000501c1ff30$5679f1f0$0100a8c0@winxp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Matthew Wilcox , linux-fsdevel@vger.kernel.org Return-path: To: Anthony Chee Content-Disposition: inline In-Reply-To: <000501c1ff30$5679f1f0$0100a8c0@winxp>; from anthony.chee@polyu.edu.hk on Sun, May 19, 2002 at 08:25:59PM +0800 List-Id: linux-fsdevel.vger.kernel.org On Sun, May 19, 2002 at 08:25:59PM +0800, Anthony Chee wrote: > And does "rm" also involve ftruncate process? No. > >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? it's dentry->d_inode->i_nlink. Read the code for iput(). Note that the calling chain is d_delete() -> dentry_iput() -> iput(). dentry->d_count is `how many people have a reference to this dentry', which is very different from how many people have a reference to this inode. > Actually, I am quite confuse on d_delete(dentry) and dput(dentry). Thanks dput is `i have finished using this dentry now', d_delete is `i have deleted the name this dentry refers to'. -- Revolutions do not require corporate support.