Use fxattr calls whenever possible (trying to work around the strange Linux kernel...
[Samba.git] / source / modules / vfs_streams_xattr.c
blob2ea53362953276ceea389562a208fdd6272f9240
1 /*
2 * Store streams in xattrs
4 * Copyright (C) Volker Lendecke, 2008
6 * Partly based on James Peach's Darwin module, which is
8 * Copyright (C) James Peach 2006-2007
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, see <http://www.gnu.org/licenses/>.
24 #include "includes.h"
26 #undef DBGC_CLASS
27 #define DBGC_CLASS DBGC_VFS
29 struct stream_io {
30 char *base;
31 char *xattr_name;
34 static SMB_INO_T stream_inode(const SMB_STRUCT_STAT *sbuf, const char *sname)
36 struct MD5Context ctx;
37 unsigned char hash[16];
38 SMB_INO_T result;
39 char *upper_sname;
41 DEBUG(10, ("stream_inode called for %lu/%lu [%s]\n",
42 (unsigned long)sbuf->st_dev,
43 (unsigned long)sbuf->st_ino, sname));
45 upper_sname = talloc_strdup_upper(talloc_tos(), sname);
46 SMB_ASSERT(upper_sname != NULL);
48 MD5Init(&ctx);
49 MD5Update(&ctx, (unsigned char *)&(sbuf->st_dev),
50 sizeof(sbuf->st_dev));
51 MD5Update(&ctx, (unsigned char *)&(sbuf->st_ino),
52 sizeof(sbuf->st_ino));
53 MD5Update(&ctx, (unsigned char *)upper_sname,
54 talloc_get_size(upper_sname)-1);
55 MD5Final(hash, &ctx);
57 TALLOC_FREE(upper_sname);
59 /* Hopefully all the variation is in the lower 4 (or 8) bytes! */
60 memcpy(&result, hash, sizeof(result));
62 DEBUG(10, ("stream_inode returns %lu\n", (unsigned long)result));
64 return result;
67 static ssize_t get_xattr_size(connection_struct *conn,
68 files_struct *fsp,
69 const char *fname,
70 const char *xattr_name)
72 NTSTATUS status;
73 struct ea_struct ea;
74 ssize_t result;
76 status = get_ea_value(talloc_tos(), conn, fsp, fname,
77 xattr_name, &ea);
79 if (!NT_STATUS_IS_OK(status)) {
80 return -1;
83 result = ea.value.length-1;
84 TALLOC_FREE(ea.value.data);
85 return result;
89 static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
90 SMB_STRUCT_STAT *sbuf)
92 struct stream_io *io = (struct stream_io *)
93 VFS_FETCH_FSP_EXTENSION(handle, fsp);
95 DEBUG(10, ("streams_xattr_fstat called for %d\n", fsp->fh->fd));
97 if (io == NULL) {
98 return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
101 if (SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf) == -1) {
102 return -1;
105 sbuf->st_size = get_xattr_size(handle->conn, fsp->base_fsp,
106 io->base, io->xattr_name);
107 if (sbuf->st_size == -1) {
108 return -1;
111 DEBUG(10, ("sbuf->st_size = %d\n", (int)sbuf->st_size));
113 sbuf->st_ino = stream_inode(sbuf, io->xattr_name);
114 sbuf->st_mode &= ~S_IFMT;
115 sbuf->st_mode |= S_IFREG;
116 sbuf->st_blocks = sbuf->st_size % STAT_ST_BLOCKSIZE + 1;
118 return 0;
121 static int streams_xattr_stat(vfs_handle_struct *handle, const char *fname,
122 SMB_STRUCT_STAT *sbuf)
124 NTSTATUS status;
125 char *base = NULL, *sname = NULL;
126 int result = -1;
127 char *xattr_name;
129 if (!is_ntfs_stream_name(fname)) {
130 return SMB_VFS_NEXT_STAT(handle, fname, sbuf);
133 status = split_ntfs_stream_name(talloc_tos(), fname, &base, &sname);
134 if (!NT_STATUS_IS_OK(status)) {
135 errno = EINVAL;
136 return -1;
139 if (SMB_VFS_STAT(handle->conn, base, sbuf) == -1) {
140 goto fail;
143 xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
144 SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
145 if (xattr_name == NULL) {
146 errno = ENOMEM;
147 goto fail;
150 sbuf->st_size = get_xattr_size(handle->conn, NULL, base, xattr_name);
151 if (sbuf->st_size == -1) {
152 errno = ENOENT;
153 goto fail;
156 sbuf->st_ino = stream_inode(sbuf, xattr_name);
157 sbuf->st_mode &= ~S_IFMT;
158 sbuf->st_mode |= S_IFREG;
159 sbuf->st_blocks = sbuf->st_size % STAT_ST_BLOCKSIZE + 1;
161 result = 0;
162 fail:
163 TALLOC_FREE(base);
164 TALLOC_FREE(sname);
165 return result;
168 static int streams_xattr_lstat(vfs_handle_struct *handle, const char *fname,
169 SMB_STRUCT_STAT *sbuf)
171 NTSTATUS status;
172 char *base, *sname;
173 int result = -1;
174 char *xattr_name;
176 if (!is_ntfs_stream_name(fname)) {
177 return SMB_VFS_NEXT_LSTAT(handle, fname, sbuf);
180 status = split_ntfs_stream_name(talloc_tos(), fname, &base, &sname);
181 if (!NT_STATUS_IS_OK(status)) {
182 errno = EINVAL;
183 goto fail;
186 if (SMB_VFS_LSTAT(handle->conn, base, sbuf) == -1) {
187 goto fail;
190 xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
191 SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
192 if (xattr_name == NULL) {
193 errno = ENOMEM;
194 goto fail;
197 sbuf->st_size = get_xattr_size(handle->conn, NULL, base, xattr_name);
198 if (sbuf->st_size == -1) {
199 errno = ENOENT;
200 goto fail;
203 sbuf->st_ino = stream_inode(sbuf, xattr_name);
204 sbuf->st_mode &= ~S_IFMT;
205 sbuf->st_mode |= S_IFREG;
206 sbuf->st_blocks = sbuf->st_size % STAT_ST_BLOCKSIZE + 1;
208 result = 0;
209 fail:
210 TALLOC_FREE(base);
211 TALLOC_FREE(sname);
212 return result;
215 static int streams_xattr_open(vfs_handle_struct *handle, const char *fname,
216 files_struct *fsp, int flags, mode_t mode)
218 TALLOC_CTX *frame;
219 NTSTATUS status;
220 struct stream_io *sio;
221 char *base, *sname;
222 struct ea_struct ea;
223 char *xattr_name;
224 int baseflags;
225 int hostfd = -1;
227 DEBUG(10, ("streams_xattr_open called for %s\n", fname));
229 if (!is_ntfs_stream_name(fname)) {
230 return SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode);
233 frame = talloc_stackframe();
235 status = split_ntfs_stream_name(talloc_tos(), fname,
236 &base, &sname);
237 if (!NT_STATUS_IS_OK(status)) {
238 errno = EINVAL;
239 goto fail;
242 xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
243 SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
244 if (xattr_name == NULL) {
245 errno = ENOMEM;
246 goto fail;
250 * We use baseflags to turn off nasty side-effects when opening the
251 * underlying file.
253 baseflags = flags;
254 baseflags &= ~O_TRUNC;
255 baseflags &= ~O_EXCL;
256 baseflags &= ~O_CREAT;
258 hostfd = SMB_VFS_OPEN(handle->conn, base, fsp, baseflags, mode);
260 /* It is legit to open a stream on a directory, but the base
261 * fd has to be read-only.
263 if ((hostfd == -1) && (errno == EISDIR)) {
264 baseflags &= ~O_ACCMODE;
265 baseflags |= O_RDONLY;
266 hostfd = SMB_VFS_OPEN(handle->conn, fname, fsp, baseflags,
267 mode);
270 if (hostfd == -1) {
271 goto fail;
274 status = get_ea_value(talloc_tos(), handle->conn, NULL, base,
275 xattr_name, &ea);
277 DEBUG(10, ("get_ea_value returned %s\n", nt_errstr(status)));
279 if (!NT_STATUS_IS_OK(status)
280 && !NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
282 * The base file is not there. This is an error even if we got
283 * O_CREAT, the higher levels should have created the base
284 * file for us.
286 DEBUG(10, ("streams_xattr_open: base file %s not around, "
287 "returning ENOENT\n", base));
288 errno = ENOENT;
289 goto fail;
292 if (!NT_STATUS_IS_OK(status)) {
294 * The attribute does not exist
297 if (flags & O_CREAT) {
299 * Darn, xattrs need at least 1 byte
301 char null = '\0';
303 DEBUG(10, ("creating attribute %s on file %s\n",
304 xattr_name, base));
306 if (fsp->base_fsp->fh->fd != -1) {
307 if (SMB_VFS_FSETXATTR(
308 fsp->base_fsp, xattr_name,
309 &null, sizeof(null),
310 flags & O_EXCL ? XATTR_CREATE : 0) == -1) {
311 goto fail;
313 } else {
314 if (SMB_VFS_SETXATTR(
315 handle->conn, base, xattr_name,
316 &null, sizeof(null),
317 flags & O_EXCL ? XATTR_CREATE : 0) == -1) {
318 goto fail;
324 if (flags & O_TRUNC) {
325 char null = '\0';
326 if (fsp->base_fsp->fh->fd != -1) {
327 if (SMB_VFS_FSETXATTR(
328 fsp->base_fsp, xattr_name,
329 &null, sizeof(null),
330 flags & O_EXCL ? XATTR_CREATE : 0) == -1) {
331 goto fail;
333 } else {
334 if (SMB_VFS_SETXATTR(
335 handle->conn, base, xattr_name,
336 &null, sizeof(null),
337 flags & O_EXCL ? XATTR_CREATE : 0) == -1) {
338 goto fail;
343 sio = (struct stream_io *)VFS_ADD_FSP_EXTENSION(handle, fsp,
344 struct stream_io);
345 if (sio == NULL) {
346 errno = ENOMEM;
347 goto fail;
350 sio->xattr_name = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
351 xattr_name);
352 sio->base = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
353 base);
355 if ((sio->xattr_name == NULL) || (sio->base == NULL)) {
356 errno = ENOMEM;
357 goto fail;
360 TALLOC_FREE(frame);
361 return hostfd;
363 fail:
364 if (hostfd >= 0) {
366 * BUGBUGBUG -- we would need to call fd_close_posix here, but
367 * we don't have a full fsp yet
369 SMB_VFS_CLOSE(fsp);
372 TALLOC_FREE(frame);
373 return -1;
376 static int streams_xattr_unlink(vfs_handle_struct *handle, const char *fname)
378 NTSTATUS status;
379 char *base = NULL;
380 char *sname = NULL;
381 int ret = -1;
382 char *xattr_name;
384 if (!is_ntfs_stream_name(fname)) {
385 return SMB_VFS_NEXT_UNLINK(handle, fname);
388 status = split_ntfs_stream_name(talloc_tos(), fname, &base, &sname);
389 if (!NT_STATUS_IS_OK(status)) {
390 errno = EINVAL;
391 goto fail;
394 xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
395 SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
396 if (xattr_name == NULL) {
397 errno = ENOMEM;
398 goto fail;
401 ret = SMB_VFS_REMOVEXATTR(handle->conn, base, xattr_name);
403 if ((ret == -1) && (errno == ENOATTR)) {
404 errno = ENOENT;
405 goto fail;
408 ret = 0;
410 fail:
411 TALLOC_FREE(base);
412 TALLOC_FREE(sname);
413 return ret;
416 static NTSTATUS walk_xattr_streams(connection_struct *conn, files_struct *fsp,
417 const char *fname,
418 bool (*fn)(struct ea_struct *ea,
419 void *private_data),
420 void *private_data)
422 NTSTATUS status;
423 char **names;
424 size_t i, num_names;
425 size_t prefix_len = strlen(SAMBA_XATTR_DOSSTREAM_PREFIX);
427 status = get_ea_names_from_file(talloc_tos(), conn, fsp, fname,
428 &names, &num_names);
429 if (!NT_STATUS_IS_OK(status)) {
430 return status;
433 for (i=0; i<num_names; i++) {
434 struct ea_struct ea;
436 if (strncmp(names[i], SAMBA_XATTR_DOSSTREAM_PREFIX,
437 prefix_len) != 0) {
438 continue;
441 status = get_ea_value(names, conn, fsp, fname, names[i], &ea);
442 if (!NT_STATUS_IS_OK(status)) {
443 DEBUG(10, ("Could not get ea %s for file %s: %s\n",
444 names[i], fname, nt_errstr(status)));
445 continue;
448 ea.name = talloc_asprintf(ea.value.data, ":%s",
449 names[i] + prefix_len);
450 if (ea.name == NULL) {
451 DEBUG(0, ("talloc failed\n"));
452 continue;
455 if (!fn(&ea, private_data)) {
456 TALLOC_FREE(ea.value.data);
457 return NT_STATUS_OK;
460 TALLOC_FREE(ea.value.data);
463 TALLOC_FREE(names);
464 return NT_STATUS_OK;
467 static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
468 struct stream_struct **streams,
469 const char *name, SMB_OFF_T size,
470 SMB_OFF_T alloc_size)
472 struct stream_struct *tmp;
474 tmp = TALLOC_REALLOC_ARRAY(mem_ctx, *streams, struct stream_struct,
475 (*num_streams)+1);
476 if (tmp == NULL) {
477 return false;
480 tmp[*num_streams].name = talloc_strdup(tmp, name);
481 if (tmp[*num_streams].name == NULL) {
482 return false;
485 tmp[*num_streams].size = size;
486 tmp[*num_streams].alloc_size = alloc_size;
488 *streams = tmp;
489 *num_streams += 1;
490 return true;
493 struct streaminfo_state {
494 TALLOC_CTX *mem_ctx;
495 vfs_handle_struct *handle;
496 unsigned int num_streams;
497 struct stream_struct *streams;
498 NTSTATUS status;
501 static bool collect_one_stream(struct ea_struct *ea, void *private_data)
503 struct streaminfo_state *state =
504 (struct streaminfo_state *)private_data;
506 if (!add_one_stream(state->mem_ctx,
507 &state->num_streams, &state->streams,
508 ea->name, ea->value.length-1,
509 smb_roundup(state->handle->conn,
510 ea->value.length-1))) {
511 state->status = NT_STATUS_NO_MEMORY;
512 return false;
515 return true;
518 static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
519 struct files_struct *fsp,
520 const char *fname,
521 TALLOC_CTX *mem_ctx,
522 unsigned int *pnum_streams,
523 struct stream_struct **pstreams)
525 SMB_STRUCT_STAT sbuf;
526 int ret;
527 NTSTATUS status;
528 struct streaminfo_state state;
530 if ((fsp != NULL) && (fsp->fh->fd != -1)) {
531 if (is_ntfs_stream_name(fsp->fsp_name)) {
532 return NT_STATUS_INVALID_PARAMETER;
534 ret = SMB_VFS_FSTAT(fsp, &sbuf);
536 else {
537 if (is_ntfs_stream_name(fname)) {
538 return NT_STATUS_INVALID_PARAMETER;
540 ret = SMB_VFS_STAT(handle->conn, fname, &sbuf);
543 if (ret == -1) {
544 return map_nt_error_from_unix(errno);
547 state.streams = NULL;
548 state.num_streams = 0;
550 if (!S_ISDIR(sbuf.st_mode)) {
551 if (!add_one_stream(mem_ctx,
552 &state.num_streams, &state.streams,
553 "::$DATA", sbuf.st_size,
554 get_allocation_size(handle->conn, fsp,
555 &sbuf))) {
556 return NT_STATUS_NO_MEMORY;
560 state.mem_ctx = mem_ctx;
561 state.handle = handle;
562 state.status = NT_STATUS_OK;
564 status = walk_xattr_streams(handle->conn, fsp, fname,
565 collect_one_stream, &state);
567 if (!NT_STATUS_IS_OK(status)) {
568 TALLOC_FREE(state.streams);
569 return status;
572 if (!NT_STATUS_IS_OK(state.status)) {
573 TALLOC_FREE(state.streams);
574 return state.status;
577 *pnum_streams = state.num_streams;
578 *pstreams = state.streams;
579 return NT_STATUS_OK;
582 static uint32_t streams_xattr_fs_capabilities(struct vfs_handle_struct *handle)
584 return SMB_VFS_NEXT_FS_CAPABILITIES(handle) | FILE_NAMED_STREAMS;
587 static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle,
588 files_struct *fsp, const void *data,
589 size_t n, SMB_OFF_T offset)
591 struct stream_io *sio =
592 (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
593 struct ea_struct ea;
594 NTSTATUS status;
595 int ret;
597 DEBUG(10, ("streams_xattr_pwrite called for %d bytes\n", (int)n));
599 if (sio == NULL) {
600 return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
603 status = get_ea_value(talloc_tos(), handle->conn, fsp->base_fsp,
604 sio->base, sio->xattr_name, &ea);
605 if (!NT_STATUS_IS_OK(status)) {
606 return -1;
609 if ((offset + n) > ea.value.length-1) {
610 uint8 *tmp;
612 tmp = TALLOC_REALLOC_ARRAY(talloc_tos(), ea.value.data, uint8,
613 offset + n + 1);
615 if (tmp == NULL) {
616 TALLOC_FREE(ea.value.data);
617 errno = ENOMEM;
618 return -1;
620 ea.value.data = tmp;
621 ea.value.length = offset + n + 1;
622 ea.value.data[offset+n] = 0;
625 memcpy(ea.value.data + offset, data, n);
627 if (fsp->base_fsp->fh->fd != -1) {
628 ret = SMB_VFS_FSETXATTR(fsp->base_fsp,
629 sio->xattr_name,
630 ea.value.data, ea.value.length, 0);
631 } else {
632 ret = SMB_VFS_SETXATTR(fsp->conn, fsp->base_fsp->fsp_name,
633 sio->xattr_name,
634 ea.value.data, ea.value.length, 0);
636 TALLOC_FREE(ea.value.data);
638 if (ret == -1) {
639 return -1;
642 return n;
645 static ssize_t streams_xattr_pread(vfs_handle_struct *handle,
646 files_struct *fsp, void *data,
647 size_t n, SMB_OFF_T offset)
649 struct stream_io *sio =
650 (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
651 struct ea_struct ea;
652 NTSTATUS status;
653 size_t length, overlap;
655 if (sio == NULL) {
656 return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
659 status = get_ea_value(talloc_tos(), handle->conn, fsp->base_fsp,
660 sio->base, sio->xattr_name, &ea);
661 if (!NT_STATUS_IS_OK(status)) {
662 return -1;
665 length = ea.value.length-1;
667 /* Attempt to read past EOF. */
668 if (length <= offset) {
669 errno = EINVAL;
670 return -1;
673 overlap = (offset + n) > length ? (length - offset) : n;
674 memcpy(data, ea.value.data + offset, overlap);
676 TALLOC_FREE(ea.value.data);
677 return overlap;
680 static int streams_xattr_ftruncate(struct vfs_handle_struct *handle,
681 struct files_struct *fsp,
682 SMB_OFF_T offset)
684 int ret;
685 uint8 *tmp;
686 struct ea_struct ea;
687 NTSTATUS status;
688 struct stream_io *sio =
689 (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
691 DEBUG(10, ("streams_xattr_ftruncate called for file %s offset %.0f\n",
692 fsp->fsp_name,
693 (double)offset ));
695 if (sio == NULL) {
696 return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
699 status = get_ea_value(talloc_tos(), handle->conn, fsp->base_fsp,
700 sio->base, sio->xattr_name, &ea);
701 if (!NT_STATUS_IS_OK(status)) {
702 return -1;
705 tmp = TALLOC_REALLOC_ARRAY(talloc_tos(), ea.value.data, uint8,
706 offset + 1);
708 if (tmp == NULL) {
709 TALLOC_FREE(ea.value.data);
710 errno = ENOMEM;
711 return -1;
714 /* Did we expand ? */
715 if (ea.value.length < offset + 1) {
716 memset(&tmp[ea.value.length], '\0',
717 offset + 1 - ea.value.length);
720 ea.value.data = tmp;
721 ea.value.length = offset + 1;
722 ea.value.data[offset] = 0;
724 if (fsp->base_fsp->fh->fd != -1) {
725 ret = SMB_VFS_FSETXATTR(fsp->base_fsp,
726 sio->xattr_name,
727 ea.value.data, ea.value.length, 0);
728 } else {
729 ret = SMB_VFS_SETXATTR(fsp->conn, fsp->base_fsp->fsp_name,
730 sio->xattr_name,
731 ea.value.data, ea.value.length, 0);
734 TALLOC_FREE(ea.value.data);
736 if (ret == -1) {
737 return -1;
740 return 0;
743 /* VFS operations structure */
745 static vfs_op_tuple streams_xattr_ops[] = {
746 {SMB_VFS_OP(streams_xattr_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES,
747 SMB_VFS_LAYER_TRANSPARENT},
748 {SMB_VFS_OP(streams_xattr_open), SMB_VFS_OP_OPEN,
749 SMB_VFS_LAYER_TRANSPARENT},
750 {SMB_VFS_OP(streams_xattr_stat), SMB_VFS_OP_STAT,
751 SMB_VFS_LAYER_TRANSPARENT},
752 {SMB_VFS_OP(streams_xattr_fstat), SMB_VFS_OP_FSTAT,
753 SMB_VFS_LAYER_TRANSPARENT},
754 {SMB_VFS_OP(streams_xattr_lstat), SMB_VFS_OP_LSTAT,
755 SMB_VFS_LAYER_TRANSPARENT},
756 {SMB_VFS_OP(streams_xattr_pread), SMB_VFS_OP_PREAD,
757 SMB_VFS_LAYER_TRANSPARENT},
758 {SMB_VFS_OP(streams_xattr_pwrite), SMB_VFS_OP_PWRITE,
759 SMB_VFS_LAYER_TRANSPARENT},
760 {SMB_VFS_OP(streams_xattr_lstat), SMB_VFS_OP_LSTAT,
761 SMB_VFS_LAYER_TRANSPARENT},
762 {SMB_VFS_OP(streams_xattr_unlink), SMB_VFS_OP_UNLINK,
763 SMB_VFS_LAYER_TRANSPARENT},
764 {SMB_VFS_OP(streams_xattr_ftruncate), SMB_VFS_OP_FTRUNCATE,
765 SMB_VFS_LAYER_TRANSPARENT},
766 {SMB_VFS_OP(streams_xattr_streaminfo), SMB_VFS_OP_STREAMINFO,
767 SMB_VFS_LAYER_OPAQUE},
768 {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP}
771 NTSTATUS vfs_streams_xattr_init(void);
772 NTSTATUS vfs_streams_xattr_init(void)
774 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "streams_xattr",
775 streams_xattr_ops);