From: "Anthony Chee" <anthony.chee@polyu.edu.hk>
To: <linux-fsdevel@vger.kernel.org>
Subject: delete file entry and free space
Date: Sun, 19 May 2002 06:56:48 +0800 [thread overview]
Message-ID: <000601c1febf$4b045bb0$0100a8c0@winxp> (raw)
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.
next reply other threads:[~2002-05-18 22:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-18 22:56 Anthony Chee [this message]
2002-05-19 0:41 ` delete file entry and free space Matthew Wilcox
2002-05-19 12:25 ` Anthony Chee
2002-05-19 14:47 ` Matthew Wilcox
-- strict thread matches above, loose matches on Subject: below --
2002-05-20 23:28 Bryan Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000601c1febf$4b045bb0$0100a8c0@winxp' \
--to=anthony.chee@polyu.edu.hk \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox