Re: [PATCH v2] Introduce a version6 of autofs interface, to fix design error.

Linus Torvalds
2012-04-27T22:49:56Z

On Fri, Apr 27, 2012 at 3:42 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> Comments? The patch looks fairly simple. The "packetized pipe" might
>> even be useful for other users and maybe we might want to expose it as
>> an actual pipe fcntl, but right now the only thing that sets that flag
>> is autofs.
>
> The obvious way to set the flag would seem to me to also btake O_DIRECT
> on the pipe as meaning this ?

Hmm. That would work, then if you wanted to create a packet pipe, you'd just use

if (pipe2(fd, O_DIRECT | O_NONBLOCK)) {
perror("Kernel doesn't support packetized pipes");
return -1;
}

which means that if user space wants to use packetized pipes for other
things, it now has a nice way of testing whether the kernel supports
it (because older kernels would return -EINVAL - for once we actually
verify that only the flags we support are set).

And that maybe we wouldn't even need the extra flag in the "struct
pipe" at all - we could just check it in file->f_flags.

Let my try that.

Linus