Re: [PATCH 27/32] xfs: Add parent pointer ioctls

Darrick J. Wong
2024-04-17T05:55:24Z

On Wed, Apr 17, 2024 at 07:29:18AM +0200, Christoph Hellwig wrote:
> On Tue, Apr 16, 2024 at 10:22:45PM -0700, Darrick J. Wong wrote:
> > On Tue, Apr 16, 2024 at 12:14:24PM -0700, Christoph Hellwig wrote:
> > > On Tue, Apr 16, 2024 at 12:07:33PM -0700, Darrick J. Wong wrote:
> > > > Ohhhh, does that happens outside of XFS then? No wonder I couldn't find
> > > > what you were talking about. Ok I'll go look some more.
> > >
> > > Yes. get_name() in fs/exportfs/expfs.c.
> >
> > Hmm. Implementing a custom ->get_name for pptrs would work well for
> > child files with low hardlink counts. Certainly there are probably a
> > lot more large directories than files that are hardlinked many many
> > times. At what point does it become cheaper to scan the directory?
>
> Note that despite my previous confusion get_name is also called for
> directories to find the actual name they have in their parent.
>
> An easy conservative choice would be to always look at the parent
> pointers for nlink==1.
>
> All of that is for later, I don't want to delay the parent pointers
> series even further.

It won't; I'll need to test the default ->get_name implementation so
that I can compare it to the new one, which means I'll have to figure
out /how/ to test that.

--D