From: Steve French <smfrench@gmail.com>
To: Jeremy Allison <jra@samba.org>
Cc: Theodore Tso <tytso@mit.edu>,
Matthew Wilcox <willy@infradead.org>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
ebiggers@kernel.org,
samba-technical <samba-technical@lists.samba.org>
Subject: Re: Streams support in Linux
Date: Tue, 28 Aug 2018 14:43:12 -0500 [thread overview]
Message-ID: <CAH2r5msG9JomTYq=FfGGr9gsEOY849gixivdKAKEzfR4dFD4hg@mail.gmail.com> (raw)
In-Reply-To: <20180828184057.GB97108@jra3>
On Tue, Aug 28, 2018 at 1:41 PM Jeremy Allison <jra@samba.org> wrote:
>
> On Tue, Aug 28, 2018 at 01:32:39PM -0500, Steve French wrote:
> > On Tue, Aug 28, 2018 at 1:12 PM Jeremy Allison <jra@samba.org> wrote:
> > >
> > > On Mon, Aug 27, 2018 at 08:07:35PM -0500, Steve French wrote:
> > > >
> > > > Given that streams need to be read to backup Macs and Windows
> > > > (and for a few features of these servers mentioned earlier)
> > > > and would be exposed in ntfs (and SMB3 remotely) locally on Linux,
> > > > seems useful to me to have some consistent way to open and read
> > > > them on Linux even if we don't want to generalize it to other local fs.
> > > > The protocol supports it fine (just a file with a reserved character
> > > > ':' in it) but a little tricky to avoid name conflict with posix ':'
> > > > in filenames
> > >
> > > This sounds like a case for a couple of ioctls. One to enumerate
> > > the streams on an open fd, one to open a given stream name on an
> > > open fd.
> >
> > We already have a (cifs.ko) ioctl to enumerate streams, but I was
> > less comfortable with how to structure an ioctl to read/write a
> > stream (other than $DATA of course). Ideas on what a "read stream"
> > ioctl might look like?
>
> You shouldn't need a read stream ioctl. You only need 3 I think.
>
> struct open_stream {
> const char *stream_name;
> int open_flags,
> int stream_fd;
> };
>
> struct open_stream os = {
> "MyStreamName",
> O_CREAT,
> -1
> };
>
> 1). ioctl(file_or_dir_fd, FIO_OPEN_STREAM, &os);
>
> Now read/write the os->stream_fd for the created
> stream as desired. Use O_RDONLY|O_WRONLY|O_RDWR
> in the flags field as needed.
>
> 2). ioctl(file_or_dir_fd, FIO_ENUM_STREAMS_DIR, &new_fd);
>
> Now use readdir() to get the list.
>
> 3). ioctl(stream_fd, FIO_DELETE_STREAM, 0);
>
> Delete the stream opened on stream_fd.
>
> Doesn't that cover everything ?
This would be trickier to code than you might think.
In particular I think the reaadir to list streams is going to be
harder than the ioctl
I had coded for it. I also had code at one point to convert streams
to xattrs etc.
--
Thanks,
Steve
next prev parent reply other threads:[~2018-08-28 23:36 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-25 13:51 Streams support in Linux Matthew Wilcox
2018-08-25 14:47 ` Al Viro
2018-08-25 15:51 ` Matthew Wilcox
2018-08-25 18:00 ` Al Viro
2018-08-25 20:57 ` Matthew Wilcox
2018-08-25 22:36 ` Al Viro
2018-08-26 1:03 ` Steve French
2018-08-27 17:05 ` Jeremy Allison
2018-08-27 17:41 ` Jeremy Allison
2018-08-27 18:21 ` Matthew Wilcox
2018-08-27 18:45 ` Al Viro
2018-08-27 19:06 ` Jeremy Allison
2018-08-28 0:45 ` Theodore Y. Ts'o
2018-08-28 1:07 ` Steve French
2018-08-28 18:12 ` Jeremy Allison
2018-08-28 18:32 ` Steve French
2018-08-28 18:40 ` Jeremy Allison
2018-08-28 19:43 ` Steve French [this message]
2018-08-28 19:47 ` Jeremy Allison
2018-08-28 20:43 ` Steve French
2018-08-28 20:47 ` Jeremy Allison
2018-08-28 20:51 ` Steve French
2018-08-28 21:19 ` Stefan Metzmacher
2018-08-28 21:22 ` Jeremy Allison
2018-08-28 21:23 ` Steve French
2018-08-29 5:13 ` Ralph Böhme
2018-08-29 13:46 ` Tom Talpey
2018-08-29 13:54 ` Aurélien Aptel
2018-08-29 15:02 ` Tom Talpey
2018-08-29 16:00 ` Jeremy Allison
2018-08-29 15:59 ` Jeremy Allison
2018-08-29 18:52 ` Andreas Dilger
2018-08-26 20:30 ` Matthew Wilcox
2018-08-25 16:25 ` Theodore Y. Ts'o
2018-08-27 16:33 ` Jeremy Allison
2018-09-20 2:06 Shahbaz Youssefi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH2r5msG9JomTYq=FfGGr9gsEOY849gixivdKAKEzfR4dFD4hg@mail.gmail.com' \
--to=smfrench@gmail.com \
--cc=ebiggers@kernel.org \
--cc=jra@samba.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=samba-technical@lists.samba.org \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).