From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [RFC 3/7] cramfs: allow unlinking of files Date: Sun, 1 Jun 2008 23:28:57 +0200 Message-ID: <200806012328.57577.arnd@arndb.de> References: <20080531152013.031903990@arndb.de> <20080531153510.820446949@arndb.de> <20080601165439.GD13094@logfs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@lst.de To: =?utf-8?q?J=C3=B6rn_Engel?= Return-path: Received: from moutng.kundenserver.de ([212.227.126.171]:51049 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752220AbYFAV3F convert rfc822-to-8bit (ORCPT ); Sun, 1 Jun 2008 17:29:05 -0400 In-Reply-To: <20080601165439.GD13094@logfs.org> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sunday 01 June 2008, J=C3=B6rn Engel wrote: > On Sat, 31 May 2008 17:20:16 +0200, arnd@arndb.de wrote: > > =C2=A0 > > +int cramfs_unlink(struct inode *dir, struct dentry *dentry) > > +{ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct inode *inode =3D dentry->d_in= ode; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct dentry *new; > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0inode->i_ctime =3D dir->i_ctime =3D = dir->i_mtime =3D CURRENT_TIME; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drop_nlink(inode); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0new =3D d_alloc(dentry->d_parent, &d= entry->d_name); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0d_add(new, NULL); > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dget(dentry); >=20 > How is the negative dentry dropped on umount? =C2=A0Looks like we wan= t a > per-sb list to put them on. =C2=A0Then we can walk it and dput each o= ne 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-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html