[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwTUDsefBd9c-wp8jrnp4tOh6jyJkjc_UZut-J6FHSF+w@mail.gmail.com>
Date: Sun, 29 Apr 2012 12:09:16 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Michael Tokarev <mjt@....msk.ru>
Cc: Alan Cox <alan@...rguk.ukuu.org.uk>,
Thomas Meyer <thomas@...3r.de>,
David Miller <davem@...emloft.net>,
linux-kernel@...r.kernel.org, autofs@...r.kernel.org,
raven@...maw.net, stable@...nel.org
Subject: Re: [PATCH v2] Introduce a version6 of autofs interface, to fix
design error.
On Sun, Apr 29, 2012 at 11:29 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> But I think I have another approach. We can make the *writer* be the
> only one that cares about the packetized nature, and if it's a packet
> write, it will set a PIPE_BUF_PACKET flag in the pipe buffer. The
> reader can react to that. I think that actually has the potential to
> make the code a bit prettier too..
Patch attached.
This keeps Alan's idea of using O_DIRECT, but only makes it matter for
the writer - because now the "packet" thing is a per-pipe-buffer state
(we already had per-pipe-buffer flags, so this is not anything new).
So when you *write* using a O_DIRECT pipe, it will create packetized
buffers, and the reader just sees that directly.
So this should "just work", and doesn't need any extra flags in the
pipe_inode_info. And the user space interface remains the same: you
can create these packet pipes with "pipe2(fd, O_DIRECT)" if you want
to, and my test-program gives exactly the same output.
Linus
Download attachment "patch.diff" of type "application/octet-stream" (4757 bytes)
Powered by blists - more mailing lists