</listitem>
</varlistentry>
+ <varlistentry>
+ <term>streams_xattr:max xattrs per stream = NUM</term>
+ <listitem>
+ <para>On file systems where the size of a single xattr
+ is more limited than the overall size of xattrs per
+ inode, setting this parameter to a number between 2 and
+ 16 will allow smbd to store larger streams than what
+ fits into a single xattr. For example Linux has a limit
+ of 64kB per xattr, but XFS can store more than that per
+ inode.</para>
+ <para>The size of a single xattr is limited by the
+ smb.conf parameter <command>smbd max xattr
+ size</command></para>
+ <para>This is limited to 16 xattrs per alternate data
+ stream.</para>
+ <para>The default value is <command>1</command>,
+ compatible to the default behaviour before this feature
+ was introduced.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect1>
struct streams_xattr_config {
const char *prefix;
size_t prefix_len;
+ size_t max_extents;
bool store_stream_type;
};
struct streams_xattr_config *config;
const char *default_prefix = SAMBA_XATTR_DOSSTREAM_PREFIX;
const char *prefix;
- int rc;
+ int rc, max_xattrs;
rc = SMB_VFS_NEXT_CONNECT(handle, service, user);
if (rc != 0) {
"store_stream_type",
true);
+ max_xattrs = lp_parm_int(SNUM(handle->conn),
+ "streams_xattr",
+ "max xattrs per stream",
+ 1);
+ if ((max_xattrs < 1) || (max_xattrs > 16)) {
+ DBG_WARNING("\"max xattrs per stream\"=%d invalid: "
+ "Between 1 and 16 possible\n",
+ max_xattrs);
+ errno = EINVAL;
+ return -1;
+ }
+ config->max_extents = max_xattrs - 1;
+
SMB_VFS_HANDLE_SET_DATA(handle, config,
NULL, struct stream_xattr_config,
return -1);