linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Handling a directory search
@ 2006-02-07 22:10 Charles Manning
  2006-02-08  2:18 ` Charles Manning
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Manning @ 2006-02-07 22:10 UTC (permalink / raw)
  To: linux-fsdevel

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?

Thanx

-- Charles








    

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Handling a directory search
  2006-02-07 22:10 Handling a directory search Charles Manning
@ 2006-02-08  2:18 ` Charles Manning
  2006-02-09 13:06   ` Tomas Hruby
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Manning @ 2006-02-08  2:18 UTC (permalink / raw)
  To: linux-fsdevel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Handling a directory search
  2006-02-08  2:18 ` Charles Manning
@ 2006-02-09 13:06   ` Tomas Hruby
  0 siblings, 0 replies; 3+ messages in thread
From: Tomas Hruby @ 2006-02-09 13:06 UTC (permalink / raw)
  To: Charles Manning, linux-fsdevel

Hi,

> The dir operations .open will be called during opendir, allowing me to hang a
> context off filp->private_data.

If I am not wrong, e.g. EXT3 does it in readdir. It checks whether
filp->private_data == NULL and so decides if it is called for the
first time (because it is deallocated only in the .release)

We do the same in our fs.

Tomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-09 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-07 22:10 Handling a directory search Charles Manning
2006-02-08  2:18 ` Charles Manning
2006-02-09 13:06   ` Tomas Hruby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).