[RFC] experimental NTFS streams implementation
jpeach at samba.org
Mon Oct 15 22:13:20 GMT 2007
I have merged my experimental implementation of NTFS alternate data
stream support for Samba 3 to the "3-0-25c/ntfs-streams" branch of
This code is an implementation of NTFS data streams with minimal
perturbation of the core file serving code. It allows VFS modules to
completely implement streams support in an opaque manner. The cost of
this opacity is some ugliness and complexity in the VFS module.
There's a bunch of changes that are not directly necessary for stream
support, but are included to that I could publish the VFS module in
its entirety. Some of these can be merged independently, but my
immediate goal is to get code published so people can look at it.
Please take some time to review the approach and suggest improvements
or alternatives. If there is a consensus that this is a valid/
desirable approach, I'll work on tidying and refactoring the code to
make it suitable for inclusion in the v3-2-test branch.
The list of patches included in the branch is:
Samba maintains a fsp structure for each open file. There is a
fsp extension mechanism that allows VFS modules to attach private
data. this patch corrects the fsp destructor so that the extension
data is fred correctly.
This patch supplements the fsp extension API with an operation
to retrieve the malloc zone pointer for that fsp.
This patch adds Darwin support for the Samba statfs VFS call.
It also adds a filesystem capabilities bitmask to the information
returned by the call.
This patch alters the Samba connection code to cache the
filesystem capabilities when a new client connects. It then
uses this information in the filename lookup path to determine
whether it should search for case variations of the requested
name, which is only necessary if the filesystem is case sensitive.
This patch adda a configuration option to allow the administrator
to turn NTFS alternate data streams support on or off.
This patch enhances the filename lookup path to be aware of
NTFS stream names. It refactors the handling of the special
quota streams to be more extensible. It also passes paths
referring to NTFS streams to the VFS if the underlying filesystem
claims that capability.
This patch adds a "streaminfo" call to the Samba VFS layer.
Streaminfo is used to query the names and sizes of all the
alternate data streams that may be present on a file.
This patch adds a Samba VFS call to support altering the file
This patch adds a Samba VFS call to support getting the real
on-disk case variant of a file name. This is needed to support
case sensitive filesystems, where a lookup using a case variation
may succeed, but we need to report the real case to the client
for presentation reasons.
This patch implements the SMB protocol support for the streaminfo
call. It also alters the SMB filesystem capabilities call to
correctly report whether NTFS streams are supported.
This patch adds a bit to the fsp structure to tell the network
send path whether this file data can safely be sent using the
sendfile(2) system call. Sometimes in our VFS module we are
presenting extended attributes as files, and we can't use
sendfile for these.
This patch adds support for the Leopard variation of the BSD-style
sendfile(2) system call.
This patch adds support for using the BSD st_birthtimespec
information to publish the file ctration time.
This patch adds support for the protocol calls that sre used
to set the file creation time.
This patch adds support for retrieving the case-preserved
filename from the VFS layer and passing it back to the client
in the SMB protocol response.
This patch corrects the support for renaming a file to a case
variation of the same name, when the underlying filesystem is
This is a VFS module that implements NTFS streams support on
HFS-like filesystems, using the resource fork, the Finder info
attribute and Darwin extended attributes to store the stream
James Peach | jpeach at samba.org
More information about the samba-technical