Re: [PATCH 1/3] vfs: add inode iteration method super_iter_inodes
From: Huang Shijie
Date: Mon Nov 09 2026 - 21:34:05 EST
在 Mon, Nov 09, 2026 at 10:58:43AM +0100,Jan Kara 写道:
> > +int super_iter_inodes(struct super_block *sb, ino_iter_fn iter_fn,
> > + void *private_data, int flags)
> > +{
> > + if (flags & INO_ITER_F_UNSAFE)
> > + return generic_iter_inodes_unsafe(sb, iter_fn, private_data);
>
> Since unsafe iteration is a separate function anyway and we advertise it as
> an "internal VFS" function (which I agree with), I'd just have
No problem.
I will change it in next version.
> super_iter_inodes() for the normal iteration and super_iter_inodes_unsafe()
> for the unsafe iteration which won't be exported to modules (so we really
> get the message across this should be VFS internal function).
>
> > +
> > + return generic_iter_inodes(sb, iter_fn, private_data, flags);
> > +}
> > +EXPORT_SYMBOL_GPL(super_iter_inodes);
> > +
>
> ...
> > +/* Inode iteration callback return values */
> > +#define INO_ITER_RET_DONE 0
>
> Maybe INO_ITER_RET_NEXT? DONE looks too much like the loop should finish.
okay.
Thanks
Huang Shijie