From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Anthony Chee" Subject: delete file entry and free space Date: Sun, 19 May 2002 06:56:48 +0800 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <000601c1febf$4b045bb0$0100a8c0@winxp> Mime-Version: 1.0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: 7bit Return-path: Received: from winxp ([158.132.229.227]) by hkpa04.polyu.edu.hk (Netscape Messaging Server 4.15) with ESMTP id GWBX1S00.2KH for ; Sun, 19 May 2002 06:56:16 +0800 To: List-Id: linux-fsdevel.vger.kernel.org I am doing kernel module work on file system. The module holds two variable dir and dentry, and pass to myunlink function, which is below. int myunlink(struct inode *dir, struct dentry *dentry) { int error = 0; down(&dir->i_sem); down(&dir->i_zombie); if (dir->i_op && dir->i_op->unlink) { if (d_mountpoint(dentry)) error = -EBUSY; else { lock_kernel(); error = dir->i_op->unlink(dir, dentry); unlock_kernel(); if (!error) { d_delete(dentry); } } } up(&dir->i_zombie); if (!error) inode_dir_notify(dir, DN_DELETE); dput(dentry); up(&dir->i_sem); return error; } The myunlink function is a merge from sys_unlink() and vfs_unlink(), and remove some permission and quota syntax, as I need to force to delete the entry. After passing the variables to the function, the entry is disappeared while using "ls", but I found that it still occupy disk space by using command "df". How can I also free the disk space. My target is on releasing the disk space, and I don't care any permission or others. Or any other method on releasing the disk space by using dir and dentry? Thanks.