From: Jan Hudec Subject: Re: Help on automatic population of directories Date: Tue, 9 Mar 2004 09:22:24 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040309082224.GE1091@vagabond> References: <4048B0ED.1010702@watson.ibm.com> <20040306205131.GC17554@vagabond> <404CD84B.1090101@watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tNQTSEo8WG/FKZ8E" Cc: linux-fsdevel Return-path: Received: from cimice4.lam.cz ([212.71.168.94]:2530 "EHLO vagabond.light.src") by vger.kernel.org with ESMTP id S261698AbUCIIWe (ORCPT ); Tue, 9 Mar 2004 03:22:34 -0500 To: Shailabh Nagar Content-Disposition: inline In-Reply-To: <404CD84B.1090101@watson.ibm.com> List-Id: linux-fsdevel.vger.kernel.org --tNQTSEo8WG/FKZ8E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 08, 2004 at 15:32:11 -0500, Shailabh Nagar wrote: > Jan Hudec wrote: >=20 > >On Fri, Mar 05, 2004 at 11:55:09 -0500, Shailabh wrote: > >=20 > > > >>Hi, > >> > >>I'm writing a ram-based filesystem. I want the filesystem to=20 > >>automatically create a few files inside every directory that a user=20 > >>creates. > >> =20 > >> > > > >Why do you want to do it? > > > >One reason to ask that is: The user did not create the files. Should he > >really need to delete them manualy? > >=20 > > > No, I'll need autodelete functionality as well. Well, actualy looking in the source, it seems it's up to the filesystem to detect whether the directory is empty. So after you check, that there are no files but the magic ones (link count should help), you simply delete by calling vfs_unlink on the magic files and then proceed with removal (which, for ram-based fs, just means to put the dentry, IIRC). ---------------------------------------------------------------------------= ---- Jan 'Bulb' Hudec --tNQTSEo8WG/FKZ8E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFATX7ARel1vVwhjGURAkPWAJ4zhh4HEBCQ2dF/8C9DnsCpfi4evwCfV9g9 PlAu6J8KtzQK4zkIQRBbsX0= =x3YR -----END PGP SIGNATURE----- --tNQTSEo8WG/FKZ8E--