linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* readdir within kernel
@ 2002-12-19  5:06 Herbert Poetzl
  2002-12-19 13:09 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Herbert Poetzl @ 2002-12-19  5:06 UTC (permalink / raw)
  To: linux-fsdevel


hi all!

I would like to know if this is the right way to
read a directory contents for a given directory
dentry within a kernel module ...

suggestions and/or hints are very welcome ...


extern	filldir_t xxx_filler;


void	xxx_dump_dir(struct dentry *de)
{
    	struct file pf;
	struct inode *in = de->d_inode;
	int ret;	
		
	ret = init_private_file(&pf, de, FMODE_READ);
	if (!pf.f_op->readdir)
		goto out_close;
		
    	ret = vfs_readdir(&pf, xxx_filler, (void *)0);

out_close:
	if (pf.f_op->release)
		pf.f_op->release(in, &pf);
    	return;
}

many thanks,
Herbert


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

end of thread, other threads:[~2002-12-19 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-19  5:06 readdir within kernel Herbert Poetzl
2002-12-19 13:09 ` Matthew Wilcox

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).