From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Manning Subject: Re: Handling a directory search Date: Wed, 8 Feb 2006 15:18:18 +1300 Message-ID: <200602081518.18804.manningc2@actrix.gen.nz> References: <200602081110.00692.manningc2@actrix.gen.nz> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from skyline.actrix.co.nz ([203.96.16.175]:26069 "EHLO skyhigh.actrix.co.nz") by vger.kernel.org with ESMTP id S1030451AbWBHCP5 (ORCPT ); Tue, 7 Feb 2006 21:15:57 -0500 Received: from 202-154-141-121.ras.actrix.co.nz (202-154-141-121.ras.actrix.co.nz [202.154.141.121]) by skyhigh.actrix.co.nz (Postfix) with ESMTP id 6E4494BDBE for ; Wed, 8 Feb 2006 15:15:54 +1300 (NZDT) To: linux-fsdevel@vger.kernel.org In-Reply-To: <200602081110.00692.manningc2@actrix.gen.nz> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wednesday 08 February 2006 11:10, Charles Manning wrote: > Hi folks. > > I'm tweaking the readdir handling for YAFFS and need to be able to manage a > "directory search context" structure where I can stash the context. > > ie. > > /* user prog and corresponding YAFFS operation */ > > opendir(..); /* YAFFS needs to create a search context */ > > readdir(...); /* YAFFS needs to use the search context */ > > closedir(...); /* YAFFS needs to release the search context */ > > I am unsure as to how to hook the opendir and closedir to create/release > the directory search context. > > Any pointers? > > First prize: Any examples? > I think I have found the answer, I'd like anyone to verify that I've got this straight. The dir operations .open will be called during opendir, allowing me to hang a context off filp->private_data. The dir operations .release will be called during the closedir allowing me to release the context. Is that safe? Are there any hungry wolves out there going to bite me if I work to the above? Thanx -- Charles