Re: [PATCH v2 1/2] pipe: introduce struct file_operations pipeanon_fops

From: Linus Torvalds
Date: Wed Feb 05 2025 - 11:07:00 EST


On Wed, 5 Feb 2025 at 07:34, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> So that fifos and anonymous pipes could have different f_op methods.
> Preparation to simplify the next patch.

Looks good, except:

> +++ b/fs/internal.h
> extern const struct file_operations pipefifo_fops;
> +extern const struct file_operations pipeanon_fops;

I think this should just be 'static' to inside fs/pipe.c, no?

The only reason pipefifo_fops is in that header is because it's used
for named pipes outside the pipe code, in init_special_inode().

So I don't think pipeanon_fops should be exposed anywhere outside fs/pipe.c.

Linus