On Wed, Aug 02, 2000 at 12:34:41PM +0200, Miklos Szeredi wrote:
> Hi!
> 
> This patch modifies coda_release(), so that when all files belonging
> to the same inode are closed, the container inode is released. This is
> done with a reference counter in coda_inode_info, which is increased
> in coda_open() and decreased in coda_release().
> 
> This change is important for userspace filesystems using the coda
> kernel module, which -- unlinke Venus -- want to delete the container
> file after use. With the current setup coda holds onto the container
> inode, so the occupied disk space (which can be quite large) isn't
> freed until coda flushes its cache.
> 
> Patch is against 2.4.0-test5.
> 
> Miklos

If you care about the disk usage, why don't you simply truncate the
container to 0 bytes before unlinking it from userspace?

I'm wondering how much this would affect performance when the userspace
manager does not intend to throw the file away as soon as possible.

The container counter you introduce is only accessed when the big kernel
lock is held, so it probably doesn't need to use atomic_inc/dec for
updates. Also, could dentry->d_count be used instead of adding a new
counter in coda_inode_info, or is that asking for races between open and
release?

Jan

Reply via email to