From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hr2.samba.org ([144.76.82.148]:46986 "EHLO hr2.samba.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726807AbeH1Xk6 (ORCPT ); Tue, 28 Aug 2018 19:40:58 -0400 Date: Tue, 28 Aug 2018 12:47:42 -0700 From: Jeremy Allison To: Steve French Cc: Theodore Tso , Matthew Wilcox , Al Viro , linux-fsdevel , ebiggers@kernel.org, samba-technical Subject: Re: Streams support in Linux Message-ID: <20180828194742.GD97108@jra3> Reply-To: Jeremy Allison References: <20180825223615.GS6515@ZenIV.linux.org.uk> <20180827170531.GC217636@jra3> <20180827182143.GB24544@bombadil.infradead.org> <20180828004523.GB2304@thunk.org> <20180828181245.GE41380@jra3> <20180828184057.GB97108@jra3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Aug 28, 2018 at 02:43:12PM -0500, Steve French wrote: > > > On Tue, Aug 28, 2018 at 1:12 PM Jeremy Allison wrote: > > > > 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. Why is that ? You control any fd's you return, so you can vector any readdir call into an enum_streams request ? I wouldn't return streams as xattrs, as they are separately exposed and already have meaning in SMB1/2/3.