Re: [RFC PATCH 2/3] libfs: add simple directory iteration function with callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2025-03-18 at 22:33 +0100, Ard Biesheuvel wrote:
> On Tue, 18 Mar 2025 at 20:45, James Bottomley
> <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > 
> > The current iterate_dir() infrastructure is somewhat cumbersome to
> > use from within the kernel.  Introduce a lighter weight
> > simple_iterate_dir() function that directly iterates the directory
> > and executes a callback for each positive dentry.
> > 
> > Signed-off-by: James Bottomley
> > <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
> > ---
> >  fs/libfs.c         | 33 +++++++++++++++++++++++++++++++++
> >  include/linux/fs.h |  2 ++
> >  2 files changed, 35 insertions(+)
> > 
> > diff --git a/fs/libfs.c b/fs/libfs.c
> > index 816bfe6c0430..37da5fe25242 100644
> > --- a/fs/libfs.c
> > +++ b/fs/libfs.c
> > @@ -214,6 +214,39 @@ static void internal_readdir(struct dentry
> > *dentry, struct dentry *cursor,
> >         dput(next);
> >  }
> > 
> > +/**
> > + * generic_iterate_call - iterate all entries executing @callback
> 
> This name doesn't match the name below.

Right, I started out thinking the generic_ prefix was the preferred
one, but then simple_ looked better and I forgot to update the docbook.

Regards,

James






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux