Re: [RFC 3/7] cramfs: allow unlinking of files

From: Arnd Bergmann
Date: Sun Jun 01 2008 - 17:29:21 EST


On Sunday 01 June 2008, JÃrn Engel wrote:
> On Sat, 31 May 2008 17:20:16 +0200, arnd@xxxxxxxx wrote:
> > Â
> > +int cramfs_unlink(struct inode *dir, struct dentry *dentry)
> > +{
> > +ÂÂÂÂÂstruct inode *inode = dentry->d_inode;
> > +ÂÂÂÂÂstruct dentry *new;
> > +
> > +ÂÂÂÂÂinode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
> > +ÂÂÂÂÂdrop_nlink(inode);
> > +ÂÂÂÂÂnew = d_alloc(dentry->d_parent, &dentry->d_name);
> > +ÂÂÂÂÂd_add(new, NULL);
> > +
> > +ÂÂÂÂÂdget(dentry);
>
> How is the negative dentry dropped on umount? ÂLooks like we want a
> per-sb list to put them on. ÂThen we can walk it and dput each one at
> umount time.

Good point. I think ramfs does exactly that, using kill_litter_super.
I haven't tested unmount so far, and should probably do something like
that in cramfs_put_super.

Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/