vfs_aio_pthread: don't crash without a pthreadpool
[samba.git] / source3 / modules / vfs_not_implemented.c
1 /*
2  * VFS module with "not implemented " helper functions for other modules.
3  *
4  * Copyright (C) Tim Potter, 1999-2000
5  * Copyright (C) Alexander Bokovoy, 2002
6  * Copyright (C) Stefan (metze) Metzmacher, 2003,2018
7  * Copyright (C) Jeremy Allison 2009
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22
23 #include "includes.h"
24 #include "lib/util/tevent_unix.h"
25 #include "lib/util/tevent_ntstatus.h"
26
27 _PUBLIC_
28 int vfs_not_implemented_connect(
29                         vfs_handle_struct *handle,
30                         const char *service,
31                         const char *user)
32 {
33         errno = ENOSYS;
34         return -1;
35 }
36
37 _PUBLIC_
38 void vfs_not_implemented_disconnect(vfs_handle_struct *handle)
39 {
40         ;
41 }
42
43 _PUBLIC_
44 uint64_t vfs_not_implemented_disk_free(vfs_handle_struct *handle,
45                                 const struct smb_filename *smb_fname,
46                                 uint64_t *bsize,
47                                 uint64_t *dfree,
48                                 uint64_t *dsize)
49 {
50         *bsize = 0;
51         *dfree = 0;
52         *dsize = 0;
53         return 0;
54 }
55
56 _PUBLIC_
57 int vfs_not_implemented_get_quota(vfs_handle_struct *handle,
58                                 const struct smb_filename *smb_fname,
59                                 enum SMB_QUOTA_TYPE qtype,
60                                 unid_t id,
61                                 SMB_DISK_QUOTA *dq)
62 {
63         errno = ENOSYS;
64         return -1;
65 }
66
67 _PUBLIC_
68 int vfs_not_implemented_set_quota(vfs_handle_struct *handle,
69                                   enum SMB_QUOTA_TYPE qtype,
70                                   unid_t id, SMB_DISK_QUOTA *dq)
71 {
72         errno = ENOSYS;
73         return -1;
74 }
75
76 _PUBLIC_
77 int vfs_not_implemented_get_shadow_copy_data(vfs_handle_struct *handle,
78                                 files_struct *fsp,
79                                 struct shadow_copy_data *shadow_copy_data,
80                                 bool labels)
81 {
82         errno = ENOSYS;
83         return -1;
84 }
85
86 _PUBLIC_
87 int vfs_not_implemented_statvfs(struct vfs_handle_struct *handle,
88                                 const struct smb_filename *smb_fname,
89                                 struct vfs_statvfs_struct *statbuf)
90 {
91         errno = ENOSYS;
92         return -1;
93 }
94
95 _PUBLIC_
96 uint32_t vfs_not_implemented_fs_capabilities(struct vfs_handle_struct *handle,
97                                 enum timestamp_set_resolution *p_ts_res)
98 {
99         return 0;
100 }
101
102 _PUBLIC_
103 NTSTATUS vfs_not_implemented_get_dfs_referrals(struct vfs_handle_struct *handle,
104                                                struct dfs_GetDFSReferral *r)
105 {
106         return NT_STATUS_NOT_IMPLEMENTED;
107 }
108
109 _PUBLIC_
110 NTSTATUS vfs_not_implemented_create_dfs_pathat(struct vfs_handle_struct *handle,
111                                 struct files_struct *dirfsp,
112                                 const struct smb_filename *smb_fname,
113                                 const struct referral *reflist,
114                                 size_t referral_count)
115 {
116         return NT_STATUS_NOT_IMPLEMENTED;
117 }
118
119 _PUBLIC_
120 NTSTATUS vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct *handle,
121                                 TALLOC_CTX *mem_ctx,
122                                 struct files_struct *dirfsp,
123                                 struct smb_filename *smb_fname,
124                                 struct referral **ppreflist,
125                                 size_t *preferral_count)
126 {
127         return NT_STATUS_NOT_IMPLEMENTED;
128 }
129
130 _PUBLIC_
131 NTSTATUS vfs_not_implemented_snap_check_path(struct vfs_handle_struct *handle,
132                                 TALLOC_CTX *mem_ctx,
133                                 const char *service_path,
134                                 char **base_volume)
135 {
136         return NT_STATUS_NOT_SUPPORTED;
137 }
138
139 _PUBLIC_
140 NTSTATUS vfs_not_implemented_snap_create(struct vfs_handle_struct *handle,
141                                          TALLOC_CTX *mem_ctx,
142                                          const char *base_volume,
143                                          time_t *tstamp,
144                                          bool rw,
145                                          char **base_path,
146                                          char **snap_path)
147 {
148         return NT_STATUS_NOT_SUPPORTED;
149 }
150
151 _PUBLIC_
152 NTSTATUS vfs_not_implemented_snap_delete(struct vfs_handle_struct *handle,
153                                          TALLOC_CTX *mem_ctx,
154                                          char *base_path,
155                                          char *snap_path)
156 {
157         return NT_STATUS_NOT_SUPPORTED;
158 }
159
160 _PUBLIC_
161 DIR *vfs_not_implemented_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
162                                    const char *mask, uint32_t attr)
163 {
164         errno = ENOSYS;
165         return NULL;
166 }
167
168 _PUBLIC_
169 struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
170                                            struct files_struct *dirfsp,
171                                            DIR *dirp,
172                                            SMB_STRUCT_STAT *sbuf)
173 {
174         errno = ENOSYS;
175         return NULL;
176 }
177
178 _PUBLIC_
179 void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
180 {
181         ;
182 }
183
184 _PUBLIC_
185 int vfs_not_implemented_mkdirat(vfs_handle_struct *handle,
186                 struct files_struct *dirfsp,
187                 const struct smb_filename *smb_fname,
188                 mode_t mode)
189 {
190         errno = ENOSYS;
191         return -1;
192 }
193
194 _PUBLIC_
195 int vfs_not_implemented_closedir(vfs_handle_struct *handle, DIR *dir)
196 {
197         errno = ENOSYS;
198         return -1;
199 }
200
201 _PUBLIC_
202 int vfs_not_implemented_openat(vfs_handle_struct *handle,
203                                const struct files_struct *dirfsp,
204                                const struct smb_filename *smb_fname,
205                                struct files_struct *fsp,
206                                const struct vfs_open_how *how)
207 {
208         errno = ENOSYS;
209         return -1;
210 }
211
212 _PUBLIC_
213 NTSTATUS vfs_not_implemented_create_file(struct vfs_handle_struct *handle,
214                                 struct smb_request *req,
215                                 struct files_struct *dirsp,
216                                 struct smb_filename *smb_fname,
217                                 uint32_t access_mask,
218                                 uint32_t share_access,
219                                 uint32_t create_disposition,
220                                 uint32_t create_options,
221                                 uint32_t file_attributes,
222                                 uint32_t oplock_request,
223                                 const struct smb2_lease *lease,
224                                 uint64_t allocation_size,
225                                 uint32_t private_flags,
226                                 struct security_descriptor *sd,
227                                 struct ea_list *ea_list,
228                                 files_struct **result, int *pinfo,
229                                 const struct smb2_create_blobs *in_context_blobs,
230                                 struct smb2_create_blobs *out_context_blobs)
231 {
232         return NT_STATUS_NOT_IMPLEMENTED;
233 }
234
235 _PUBLIC_
236 int vfs_not_implemented_close_fn(vfs_handle_struct *handle, files_struct *fsp)
237 {
238         errno = ENOSYS;
239         return -1;
240 }
241
242 _PUBLIC_
243 ssize_t vfs_not_implemented_pread(vfs_handle_struct *handle, files_struct *fsp,
244                                   void *data, size_t n, off_t offset)
245 {
246         errno = ENOSYS;
247         return -1;
248 }
249
250 _PUBLIC_
251 struct tevent_req *vfs_not_implemented_pread_send(struct vfs_handle_struct *handle,
252                                                   TALLOC_CTX *mem_ctx,
253                                                   struct tevent_context *ev,
254                                                   struct files_struct *fsp,
255                                                   void *data, size_t n, off_t offset)
256 {
257         return NULL;
258 }
259
260 _PUBLIC_
261 ssize_t vfs_not_implemented_pread_recv(struct tevent_req *req,
262                                        struct vfs_aio_state *vfs_aio_state)
263 {
264         vfs_aio_state->error = ENOSYS;
265         return -1;
266 }
267
268 _PUBLIC_
269 ssize_t vfs_not_implemented_pwrite(vfs_handle_struct *handle, files_struct *fsp,
270                                    const void *data, size_t n, off_t offset)
271 {
272         errno = ENOSYS;
273         return -1;
274 }
275
276 _PUBLIC_
277 struct tevent_req *vfs_not_implemented_pwrite_send(struct vfs_handle_struct *handle,
278                                                    TALLOC_CTX *mem_ctx,
279                                                    struct tevent_context *ev,
280                                                    struct files_struct *fsp,
281                                                    const void *data,
282                                                    size_t n, off_t offset)
283 {
284         return NULL;
285 }
286
287 _PUBLIC_
288 ssize_t vfs_not_implemented_pwrite_recv(struct tevent_req *req,
289                                 struct vfs_aio_state *vfs_aio_state)
290 {
291         vfs_aio_state->error = ENOSYS;
292         return -1;
293 }
294
295 _PUBLIC_
296 off_t vfs_not_implemented_lseek(vfs_handle_struct *handle, files_struct *fsp,
297                         off_t offset, int whence)
298 {
299         errno = ENOSYS;
300         return (off_t) - 1;
301 }
302
303 _PUBLIC_
304 ssize_t vfs_not_implemented_sendfile(vfs_handle_struct *handle, int tofd,
305                                      files_struct *fromfsp, const DATA_BLOB *hdr,
306                                      off_t offset, size_t n)
307 {
308         errno = ENOSYS;
309         return -1;
310 }
311
312 _PUBLIC_
313 ssize_t vfs_not_implemented_recvfile(vfs_handle_struct *handle, int fromfd,
314                                      files_struct *tofsp, off_t offset, size_t n)
315 {
316         errno = ENOSYS;
317         return -1;
318 }
319
320 _PUBLIC_
321 int vfs_not_implemented_renameat(vfs_handle_struct *handle,
322                                files_struct *srcfsp,
323                                const struct smb_filename *smb_fname_src,
324                                files_struct *dstfsp,
325                                const struct smb_filename *smb_fname_dst)
326 {
327         errno = ENOSYS;
328         return -1;
329 }
330
331 _PUBLIC_
332 struct tevent_req *vfs_not_implemented_fsync_send(struct vfs_handle_struct *handle,
333                                                   TALLOC_CTX *mem_ctx,
334                                                   struct tevent_context *ev,
335                                                   struct files_struct *fsp)
336 {
337         return NULL;
338 }
339
340 _PUBLIC_
341 int vfs_not_implemented_fsync_recv(struct tevent_req *req,
342                                    struct vfs_aio_state *vfs_aio_state)
343 {
344         vfs_aio_state->error = ENOSYS;
345         return -1;
346 }
347
348 _PUBLIC_
349 int vfs_not_implemented_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
350 {
351         errno = ENOSYS;
352         return -1;
353 }
354
355 _PUBLIC_
356 int vfs_not_implemented_fstat(vfs_handle_struct *handle, files_struct *fsp,
357                         SMB_STRUCT_STAT *sbuf)
358 {
359         errno = ENOSYS;
360         return -1;
361 }
362
363 _PUBLIC_
364 int vfs_not_implemented_lstat(vfs_handle_struct *handle,
365                               struct smb_filename *smb_fname)
366 {
367         errno = ENOSYS;
368         return -1;
369 }
370
371 _PUBLIC_
372 int vfs_not_implemented_fstatat(
373         struct vfs_handle_struct *handle,
374         const struct files_struct *dirfsp,
375         const struct smb_filename *smb_fname,
376         SMB_STRUCT_STAT *sbuf,
377         int flags)
378 {
379         errno = ENOSYS;
380         return -1;
381 }
382
383 _PUBLIC_
384 uint64_t vfs_not_implemented_get_alloc_size(struct vfs_handle_struct *handle,
385                                             struct files_struct *fsp,
386                                             const SMB_STRUCT_STAT *sbuf)
387 {
388         errno = ENOSYS;
389         return -1;
390 }
391
392 _PUBLIC_
393 int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
394                         struct files_struct *dirfsp,
395                         const struct smb_filename *smb_fname,
396                         int flags)
397 {
398         errno = ENOSYS;
399         return -1;
400 }
401
402 _PUBLIC_
403 int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp,
404                                mode_t mode)
405 {
406         errno = ENOSYS;
407         return -1;
408 }
409
410 _PUBLIC_
411 int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp,
412                                uid_t uid, gid_t gid)
413 {
414         errno = ENOSYS;
415         return -1;
416 }
417
418 _PUBLIC_
419 int vfs_not_implemented_lchown(vfs_handle_struct *handle,
420                                const struct smb_filename *smb_fname,
421                                uid_t uid,
422                                gid_t gid)
423 {
424         errno = ENOSYS;
425         return -1;
426 }
427
428 _PUBLIC_
429 int vfs_not_implemented_chdir(vfs_handle_struct *handle,
430                               const struct smb_filename *smb_fname)
431 {
432         errno = ENOSYS;
433         return -1;
434 }
435
436 _PUBLIC_
437 struct smb_filename *vfs_not_implemented_getwd(vfs_handle_struct *handle,
438                                                TALLOC_CTX *ctx)
439 {
440         errno = ENOSYS;
441         return NULL;
442 }
443
444 _PUBLIC_
445 int vfs_not_implemented_fntimes(vfs_handle_struct *handle,
446                                 files_struct *fsp,
447                                 struct smb_file_time *ft)
448 {
449         errno = ENOSYS;
450         return -1;
451 }
452
453 _PUBLIC_
454 int vfs_not_implemented_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
455                                   off_t offset)
456 {
457         errno = ENOSYS;
458         return -1;
459 }
460
461 _PUBLIC_
462 int vfs_not_implemented_fallocate(vfs_handle_struct *handle, files_struct *fsp,
463                                   uint32_t mode, off_t offset, off_t len)
464 {
465         errno = ENOSYS;
466         return -1;
467 }
468
469 _PUBLIC_
470 bool vfs_not_implemented_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
471                               off_t offset, off_t count, int type)
472 {
473         errno = ENOSYS;
474         return false;
475 }
476
477 _PUBLIC_
478 int vfs_not_implemented_filesystem_sharemode(struct vfs_handle_struct *handle,
479                                              struct files_struct *fsp,
480                                              uint32_t share_access,
481                                              uint32_t access_mask)
482 {
483         errno = ENOSYS;
484         return -1;
485 }
486
487 _PUBLIC_
488 int vfs_not_implemented_fcntl(struct vfs_handle_struct *handle,
489                               struct files_struct *fsp, int cmd,
490                               va_list cmd_arg)
491 {
492         errno = ENOSYS;
493         return -1;
494 }
495
496 _PUBLIC_
497 int vfs_not_implemented_linux_setlease(struct vfs_handle_struct *handle,
498                                        struct files_struct *fsp, int leasetype)
499 {
500         errno = ENOSYS;
501         return -1;
502 }
503
504 _PUBLIC_
505 bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
506                                  off_t *poffset, off_t *pcount, int *ptype,
507                                  pid_t *ppid)
508 {
509         errno = ENOSYS;
510         return false;
511 }
512
513 _PUBLIC_
514 int vfs_not_implemented_symlinkat(vfs_handle_struct *handle,
515                                 const struct smb_filename *link_contents,
516                                 struct files_struct *dirfsp,
517                                 const struct smb_filename *new_smb_fname)
518 {
519         errno = ENOSYS;
520         return -1;
521 }
522
523 _PUBLIC_
524 int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct *handle,
525                         const struct files_struct *dirfsp,
526                         const struct smb_filename *smb_fname,
527                         char *buf,
528                         size_t bufsiz)
529 {
530         errno = ENOSYS;
531         return -1;
532 }
533
534 _PUBLIC_
535 int vfs_not_implemented_linkat(vfs_handle_struct *handle,
536                         files_struct *srcfsp,
537                         const struct smb_filename *old_smb_fname,
538                         files_struct *dstfsp,
539                         const struct smb_filename *new_smb_fname,
540                         int flags)
541 {
542         errno = ENOSYS;
543         return -1;
544 }
545
546 _PUBLIC_
547 int vfs_not_implemented_mknodat(vfs_handle_struct *handle,
548                         files_struct *dirfsp,
549                         const struct smb_filename *smb_fname,
550                         mode_t mode,
551                         SMB_DEV_T dev)
552 {
553         errno = ENOSYS;
554         return -1;
555 }
556
557 _PUBLIC_
558 struct smb_filename *vfs_not_implemented_realpath(vfs_handle_struct *handle,
559                                                   TALLOC_CTX *ctx,
560                                                   const struct smb_filename *smb_fname)
561 {
562         errno = ENOSYS;
563         return NULL;
564 }
565
566 _PUBLIC_
567 int vfs_not_implemented_fchflags(vfs_handle_struct *handle,
568                                 struct files_struct *fsp,
569                                 uint flags)
570 {
571         errno = ENOSYS;
572         return -1;
573 }
574
575 _PUBLIC_
576 struct file_id vfs_not_implemented_file_id_create(vfs_handle_struct *handle,
577                                                   const SMB_STRUCT_STAT *sbuf)
578 {
579         struct file_id id;
580         ZERO_STRUCT(id);
581         errno = ENOSYS;
582         return id;
583 }
584
585 _PUBLIC_
586 uint64_t vfs_not_implemented_fs_file_id(vfs_handle_struct *handle,
587                                         const SMB_STRUCT_STAT *sbuf)
588 {
589         errno = ENOSYS;
590         return 0;
591 }
592
593 struct vfs_not_implemented_offload_read_state {
594         bool dummy;
595 };
596
597 _PUBLIC_
598 struct tevent_req *vfs_not_implemented_offload_read_send(
599                         TALLOC_CTX *mem_ctx,
600                         struct tevent_context *ev,
601                         struct vfs_handle_struct *handle,
602                         struct files_struct *fsp,
603                         uint32_t fsctl,
604                         uint32_t ttl,
605                         off_t offset,
606                         size_t to_copy)
607 {
608         struct tevent_req *req = NULL;
609         struct vfs_not_implemented_offload_read_state *state = NULL;
610
611         req = tevent_req_create(mem_ctx, &state,
612                                 struct vfs_not_implemented_offload_read_state);
613         if (req == NULL) {
614                 return NULL;
615         }
616
617         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
618         return tevent_req_post(req, ev);
619 }
620
621 _PUBLIC_
622 NTSTATUS vfs_not_implemented_offload_read_recv(struct tevent_req *req,
623                                        struct vfs_handle_struct *handle,
624                                        TALLOC_CTX *mem_ctx,
625                                        uint32_t *flags,
626                                        uint64_t *xferlen,
627                                        DATA_BLOB *_token_blob)
628 {
629         NTSTATUS status;
630
631         if (tevent_req_is_nterror(req, &status)) {
632                 tevent_req_received(req);
633                 return status;
634         }
635
636         tevent_req_received(req);
637         return NT_STATUS_OK;
638 }
639
640 struct vfs_not_implemented_offload_write_state {
641         uint64_t unused;
642 };
643
644 _PUBLIC_
645 struct tevent_req *vfs_not_implemented_offload_write_send(
646                         struct vfs_handle_struct *handle,
647                         TALLOC_CTX *mem_ctx,
648                         struct tevent_context *ev,
649                         uint32_t fsctl,
650                         DATA_BLOB *token,
651                         off_t transfer_offset,
652                         struct files_struct *dest_fsp,
653                         off_t dest_off,
654                         off_t num)
655 {
656         struct tevent_req *req;
657         struct vfs_not_implemented_offload_write_state *state;
658
659         req = tevent_req_create(mem_ctx, &state,
660                                 struct vfs_not_implemented_offload_write_state);
661         if (req == NULL) {
662                 return NULL;
663         }
664
665         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
666         return tevent_req_post(req, ev);
667 }
668
669 _PUBLIC_
670 NTSTATUS vfs_not_implemented_offload_write_recv(struct vfs_handle_struct *handle,
671                                                 struct tevent_req *req,
672                                                 off_t *copied)
673 {
674         NTSTATUS status;
675
676         if (tevent_req_is_nterror(req, &status)) {
677                 tevent_req_received(req);
678                 return status;
679         }
680
681         tevent_req_received(req);
682         return NT_STATUS_OK;
683 }
684
685 _PUBLIC_
686 NTSTATUS vfs_not_implemented_fget_compression(struct vfs_handle_struct *handle,
687                                              TALLOC_CTX *mem_ctx,
688                                              struct files_struct *fsp,
689                                              uint16_t *_compression_fmt)
690 {
691         return NT_STATUS_INVALID_DEVICE_REQUEST;
692 }
693
694 _PUBLIC_
695 NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle,
696                                              TALLOC_CTX *mem_ctx,
697                                              struct files_struct *fsp,
698                                              uint16_t compression_fmt)
699 {
700         return NT_STATUS_INVALID_DEVICE_REQUEST;
701 }
702
703 _PUBLIC_
704 NTSTATUS vfs_not_implemented_fstreaminfo(struct vfs_handle_struct *handle,
705                                         struct files_struct *fsp,
706                                         TALLOC_CTX *mem_ctx,
707                                         unsigned int *num_streams,
708                                         struct stream_struct **streams)
709 {
710         return NT_STATUS_NOT_IMPLEMENTED;
711 }
712
713 _PUBLIC_
714 NTSTATUS vfs_not_implemented_get_real_filename_at(
715         struct vfs_handle_struct *handle,
716         struct files_struct *dirfsp,
717         const char *name,
718         TALLOC_CTX *mem_ctx,
719         char **found_name)
720 {
721         return NT_STATUS_NOT_IMPLEMENTED;
722 }
723
724 _PUBLIC_
725 const char *vfs_not_implemented_connectpath(
726         struct vfs_handle_struct *handle,
727         const struct files_struct *dirfsp,
728         const struct smb_filename *smb_fname)
729 {
730         errno = ENOSYS;
731         return NULL;
732 }
733
734 _PUBLIC_
735 NTSTATUS vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct *handle,
736                                               struct byte_range_lock *br_lck,
737                                               struct lock_struct *plock)
738 {
739         return NT_STATUS_NOT_IMPLEMENTED;
740 }
741
742 _PUBLIC_
743 bool vfs_not_implemented_brl_unlock_windows(struct vfs_handle_struct *handle,
744                                             struct byte_range_lock *br_lck,
745                                             const struct lock_struct *plock)
746 {
747         errno = ENOSYS;
748         return false;
749 }
750
751 _PUBLIC_
752 bool vfs_not_implemented_strict_lock_check(struct vfs_handle_struct *handle,
753                                            struct files_struct *fsp,
754                                            struct lock_struct *plock)
755 {
756         errno = ENOSYS;
757         return false;
758 }
759
760 _PUBLIC_
761 NTSTATUS vfs_not_implemented_translate_name(struct vfs_handle_struct *handle,
762                                             const char *mapped_name,
763                                             enum vfs_translate_direction direction,
764                                             TALLOC_CTX *mem_ctx, char **pmapped_name)
765 {
766         return NT_STATUS_NOT_IMPLEMENTED;
767 }
768
769 _PUBLIC_
770 NTSTATUS vfs_not_implemented_parent_pathname(struct vfs_handle_struct *handle,
771                                                     TALLOC_CTX *mem_ctx,
772                                                     const struct smb_filename *smb_fname_in,
773                                                     struct smb_filename **parent_dir_out,
774                                                     struct smb_filename **atname_out)
775 {
776         return NT_STATUS_NOT_IMPLEMENTED;
777 }
778
779 _PUBLIC_
780 NTSTATUS vfs_not_implemented_fsctl(struct vfs_handle_struct *handle,
781                                    struct files_struct *fsp,
782                                    TALLOC_CTX *ctx,
783                                    uint32_t function,
784                                    uint16_t req_flags,  /* Needed for UNICODE ... */
785                                    const uint8_t *_in_data,
786                                    uint32_t in_len,
787                                    uint8_t **_out_data,
788                                    uint32_t max_out_len, uint32_t *out_len)
789 {
790         return NT_STATUS_NOT_IMPLEMENTED;
791 }
792
793 _PUBLIC_
794 NTSTATUS vfs_not_implemented_freaddir_attr(struct vfs_handle_struct *handle,
795                                         struct files_struct *fsp,
796                                         TALLOC_CTX *mem_ctx,
797                                         struct readdir_attr_data **pattr_data)
798 {
799         return NT_STATUS_NOT_IMPLEMENTED;
800 }
801
802 struct vfs_not_implemented_get_dos_attributes_state {
803         struct vfs_aio_state aio_state;
804         uint32_t dosmode;
805 };
806
807 _PUBLIC_
808 struct tevent_req *vfs_not_implemented_get_dos_attributes_send(
809                         TALLOC_CTX *mem_ctx,
810                         struct tevent_context *ev,
811                         struct vfs_handle_struct *handle,
812                         files_struct *dir_fsp,
813                         struct smb_filename *smb_fname)
814 {
815         struct tevent_req *req = NULL;
816         struct vfs_not_implemented_get_dos_attributes_state *state = NULL;
817
818         req = tevent_req_create(mem_ctx, &state,
819                         struct vfs_not_implemented_get_dos_attributes_state);
820         if (req == NULL) {
821                 return NULL;
822         }
823
824         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
825         return tevent_req_post(req, ev);
826 }
827
828 _PUBLIC_
829 NTSTATUS vfs_not_implemented_get_dos_attributes_recv(
830                         struct tevent_req *req,
831                         struct vfs_aio_state *aio_state,
832                         uint32_t *dosmode)
833 {
834         struct vfs_not_implemented_get_dos_attributes_state *state =
835                 tevent_req_data(req,
836                 struct vfs_not_implemented_get_dos_attributes_state);
837         NTSTATUS status;
838
839         if (tevent_req_is_nterror(req, &status)) {
840                 tevent_req_received(req);
841                 return status;
842         }
843
844         *aio_state = state->aio_state;
845         *dosmode = state->dosmode;
846         tevent_req_received(req);
847         return NT_STATUS_OK;
848 }
849
850 _PUBLIC_
851 NTSTATUS vfs_not_implemented_fget_dos_attributes(struct vfs_handle_struct *handle,
852                                                  struct files_struct *fsp,
853                                                  uint32_t *dosmode)
854 {
855         return NT_STATUS_NOT_IMPLEMENTED;
856 }
857
858 _PUBLIC_
859 NTSTATUS vfs_not_implemented_fset_dos_attributes(struct vfs_handle_struct *handle,
860                                                  struct files_struct *fsp,
861                                                  uint32_t dosmode)
862 {
863         return NT_STATUS_NOT_IMPLEMENTED;
864 }
865
866 _PUBLIC_
867 NTSTATUS vfs_not_implemented_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
868                                          uint32_t security_info,
869                                          TALLOC_CTX *mem_ctx,
870                                          struct security_descriptor **ppdesc)
871 {
872         return NT_STATUS_NOT_IMPLEMENTED;
873 }
874
875 _PUBLIC_
876 NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
877                                          uint32_t security_info_sent,
878                                          const struct security_descriptor *psd)
879 {
880         return NT_STATUS_NOT_IMPLEMENTED;
881 }
882
883 _PUBLIC_
884 SMB_ACL_T vfs_not_implemented_sys_acl_get_fd(vfs_handle_struct *handle,
885                                              files_struct *fsp,
886                                              SMB_ACL_TYPE_T type,
887                                              TALLOC_CTX *mem_ctx)
888 {
889         errno = ENOSYS;
890         return (SMB_ACL_T) NULL;
891 }
892
893 _PUBLIC_
894 int vfs_not_implemented_sys_acl_blob_get_fd(vfs_handle_struct *handle,
895                                 files_struct *fsp, TALLOC_CTX *mem_ctx,
896                                 char **blob_description, DATA_BLOB *blob)
897 {
898         errno = ENOSYS;
899         return -1;
900 }
901
902 _PUBLIC_
903 int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle,
904                                        struct files_struct *fsp,
905                                        SMB_ACL_TYPE_T type,
906                                        SMB_ACL_T theacl)
907 {
908         errno = ENOSYS;
909         return -1;
910 }
911
912 _PUBLIC_
913 int vfs_not_implemented_sys_acl_delete_def_fd(vfs_handle_struct *handle,
914                                         struct files_struct *fsp)
915 {
916         errno = ENOSYS;
917         return -1;
918 }
919
920 struct vfs_not_implemented_getxattrat_state {
921         struct vfs_aio_state aio_state;
922         ssize_t xattr_size;
923         uint8_t *xattr_value;
924 };
925
926 _PUBLIC_
927 struct tevent_req *vfs_not_implemented_getxattrat_send(
928                         TALLOC_CTX *mem_ctx,
929                         struct tevent_context *ev,
930                         struct vfs_handle_struct *handle,
931                         files_struct *dir_fsp,
932                         const struct smb_filename *smb_fname,
933                         const char *xattr_name,
934                         size_t alloc_hint)
935 {
936         struct tevent_req *req = NULL;
937         struct vfs_not_implemented_getxattrat_state *state = NULL;
938
939         req = tevent_req_create(mem_ctx, &state,
940                                 struct vfs_not_implemented_getxattrat_state);
941         if (req == NULL) {
942                 return NULL;
943         }
944
945         tevent_req_error(req, ENOSYS);
946         return tevent_req_post(req, ev);
947 }
948
949 _PUBLIC_
950 ssize_t vfs_not_implemented_getxattrat_recv(struct tevent_req *req,
951                                     struct vfs_aio_state *aio_state,
952                                     TALLOC_CTX *mem_ctx,
953                                     uint8_t **xattr_value)
954 {
955         struct vfs_not_implemented_getxattrat_state *state = tevent_req_data(
956                 req, struct vfs_not_implemented_getxattrat_state);
957         ssize_t xattr_size;
958
959         if (tevent_req_is_unix_error(req, &aio_state->error)) {
960                 tevent_req_received(req);
961                 return -1;
962         }
963
964         *aio_state = state->aio_state;
965         xattr_size = state->xattr_size;
966         if (xattr_value != NULL) {
967                 *xattr_value = talloc_move(mem_ctx, &state->xattr_value);
968         }
969
970         tevent_req_received(req);
971         return xattr_size;
972 }
973
974 _PUBLIC_
975 ssize_t vfs_not_implemented_fgetxattr(vfs_handle_struct *handle,
976                               struct files_struct *fsp, const char *name,
977                               void *value, size_t size)
978 {
979         errno = ENOSYS;
980         return -1;
981 }
982
983 _PUBLIC_
984 ssize_t vfs_not_implemented_flistxattr(vfs_handle_struct *handle,
985                                        struct files_struct *fsp, char *list,
986                                        size_t size)
987 {
988         errno = ENOSYS;
989         return -1;
990 }
991
992 _PUBLIC_
993 int vfs_not_implemented_fremovexattr(vfs_handle_struct *handle,
994                                      struct files_struct *fsp, const char *name)
995 {
996         errno = ENOSYS;
997         return -1;
998 }
999
1000 _PUBLIC_
1001 int vfs_not_implemented_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
1002                                   const char *name, const void *value, size_t size,
1003                                   int flags)
1004 {
1005         errno = ENOSYS;
1006         return -1;
1007 }
1008
1009 _PUBLIC_
1010 bool vfs_not_implemented_aio_force(struct vfs_handle_struct *handle,
1011                                    struct files_struct *fsp)
1012 {
1013         errno = ENOSYS;
1014         return false;
1015 }
1016
1017 _PUBLIC_
1018 NTSTATUS vfs_not_implemented_audit_file(struct vfs_handle_struct *handle,
1019                                         struct smb_filename *file,
1020                                         struct security_acl *sacl,
1021                                         uint32_t access_requested,
1022                                         uint32_t access_denied)
1023 {
1024         return NT_STATUS_NOT_IMPLEMENTED;
1025 }
1026
1027 _PUBLIC_
1028 NTSTATUS vfs_not_implemented_durable_cookie(struct vfs_handle_struct *handle,
1029                                             struct files_struct *fsp,
1030                                             TALLOC_CTX *mem_ctx,
1031                                             DATA_BLOB *cookie)
1032 {
1033         return NT_STATUS_NOT_IMPLEMENTED;
1034 }
1035
1036 _PUBLIC_
1037 NTSTATUS vfs_not_implemented_durable_disconnect(struct vfs_handle_struct *handle,
1038                                                 struct files_struct *fsp,
1039                                                 const DATA_BLOB old_cookie,
1040                                                 TALLOC_CTX *mem_ctx,
1041                                                 DATA_BLOB *new_cookie)
1042 {
1043         return NT_STATUS_NOT_IMPLEMENTED;
1044 }
1045
1046 _PUBLIC_
1047 NTSTATUS vfs_not_implemented_durable_reconnect(struct vfs_handle_struct *handle,
1048                                                struct smb_request *smb1req,
1049                                                struct smbXsrv_open *op,
1050                                                const DATA_BLOB old_cookie,
1051                                                TALLOC_CTX *mem_ctx,
1052                                                struct files_struct **fsp,
1053                                                DATA_BLOB *new_cookie)
1054 {
1055         return NT_STATUS_NOT_IMPLEMENTED;
1056 }
1057
1058 /* VFS operations structure */
1059
1060 static struct vfs_fn_pointers vfs_not_implemented_fns = {
1061         /* Disk operations */
1062
1063         .connect_fn = vfs_not_implemented_connect,
1064         .disconnect_fn = vfs_not_implemented_disconnect,
1065         .disk_free_fn = vfs_not_implemented_disk_free,
1066         .get_quota_fn = vfs_not_implemented_get_quota,
1067         .set_quota_fn = vfs_not_implemented_set_quota,
1068         .get_shadow_copy_data_fn = vfs_not_implemented_get_shadow_copy_data,
1069         .statvfs_fn = vfs_not_implemented_statvfs,
1070         .fs_capabilities_fn = vfs_not_implemented_fs_capabilities,
1071         .get_dfs_referrals_fn = vfs_not_implemented_get_dfs_referrals,
1072         .create_dfs_pathat_fn = vfs_not_implemented_create_dfs_pathat,
1073         .read_dfs_pathat_fn = vfs_not_implemented_read_dfs_pathat,
1074         .snap_check_path_fn = vfs_not_implemented_snap_check_path,
1075         .snap_create_fn = vfs_not_implemented_snap_create,
1076         .snap_delete_fn = vfs_not_implemented_snap_delete,
1077
1078         /* Directory operations */
1079
1080         .fdopendir_fn = vfs_not_implemented_fdopendir,
1081         .readdir_fn = vfs_not_implemented_readdir,
1082         .rewind_dir_fn = vfs_not_implemented_rewind_dir,
1083         .mkdirat_fn = vfs_not_implemented_mkdirat,
1084         .closedir_fn = vfs_not_implemented_closedir,
1085
1086         /* File operations */
1087
1088         .openat_fn = vfs_not_implemented_openat,
1089         .create_file_fn = vfs_not_implemented_create_file,
1090         .close_fn = vfs_not_implemented_close_fn,
1091         .pread_fn = vfs_not_implemented_pread,
1092         .pread_send_fn = vfs_not_implemented_pread_send,
1093         .pread_recv_fn = vfs_not_implemented_pread_recv,
1094         .pwrite_fn = vfs_not_implemented_pwrite,
1095         .pwrite_send_fn = vfs_not_implemented_pwrite_send,
1096         .pwrite_recv_fn = vfs_not_implemented_pwrite_recv,
1097         .lseek_fn = vfs_not_implemented_lseek,
1098         .sendfile_fn = vfs_not_implemented_sendfile,
1099         .recvfile_fn = vfs_not_implemented_recvfile,
1100         .renameat_fn = vfs_not_implemented_renameat,
1101         .fsync_send_fn = vfs_not_implemented_fsync_send,
1102         .fsync_recv_fn = vfs_not_implemented_fsync_recv,
1103         .stat_fn = vfs_not_implemented_stat,
1104         .fstat_fn = vfs_not_implemented_fstat,
1105         .lstat_fn = vfs_not_implemented_lstat,
1106         .fstatat_fn = vfs_not_implemented_fstatat,
1107         .get_alloc_size_fn = vfs_not_implemented_get_alloc_size,
1108         .unlinkat_fn = vfs_not_implemented_unlinkat,
1109         .fchmod_fn = vfs_not_implemented_fchmod,
1110         .fchown_fn = vfs_not_implemented_fchown,
1111         .lchown_fn = vfs_not_implemented_lchown,
1112         .chdir_fn = vfs_not_implemented_chdir,
1113         .getwd_fn = vfs_not_implemented_getwd,
1114         .fntimes_fn = vfs_not_implemented_fntimes,
1115         .ftruncate_fn = vfs_not_implemented_ftruncate,
1116         .fallocate_fn = vfs_not_implemented_fallocate,
1117         .lock_fn = vfs_not_implemented_lock,
1118         .filesystem_sharemode_fn = vfs_not_implemented_filesystem_sharemode,
1119         .fcntl_fn = vfs_not_implemented_fcntl,
1120         .linux_setlease_fn = vfs_not_implemented_linux_setlease,
1121         .getlock_fn = vfs_not_implemented_getlock,
1122         .symlinkat_fn = vfs_not_implemented_symlinkat,
1123         .readlinkat_fn = vfs_not_implemented_vfs_readlinkat,
1124         .linkat_fn = vfs_not_implemented_linkat,
1125         .mknodat_fn = vfs_not_implemented_mknodat,
1126         .realpath_fn = vfs_not_implemented_realpath,
1127         .fchflags_fn = vfs_not_implemented_fchflags,
1128         .file_id_create_fn = vfs_not_implemented_file_id_create,
1129         .fs_file_id_fn = vfs_not_implemented_fs_file_id,
1130         .offload_read_send_fn = vfs_not_implemented_offload_read_send,
1131         .offload_read_recv_fn = vfs_not_implemented_offload_read_recv,
1132         .offload_write_send_fn = vfs_not_implemented_offload_write_send,
1133         .offload_write_recv_fn = vfs_not_implemented_offload_write_recv,
1134         .fget_compression_fn = vfs_not_implemented_fget_compression,
1135         .set_compression_fn = vfs_not_implemented_set_compression,
1136
1137         .fstreaminfo_fn = vfs_not_implemented_fstreaminfo,
1138         .get_real_filename_at_fn = vfs_not_implemented_get_real_filename_at,
1139         .connectpath_fn = vfs_not_implemented_connectpath,
1140         .brl_lock_windows_fn = vfs_not_implemented_brl_lock_windows,
1141         .brl_unlock_windows_fn = vfs_not_implemented_brl_unlock_windows,
1142         .strict_lock_check_fn = vfs_not_implemented_strict_lock_check,
1143         .translate_name_fn = vfs_not_implemented_translate_name,
1144         .parent_pathname_fn = vfs_not_implemented_parent_pathname,
1145         .fsctl_fn = vfs_not_implemented_fsctl,
1146         .freaddir_attr_fn = vfs_not_implemented_freaddir_attr,
1147         .audit_file_fn = vfs_not_implemented_audit_file,
1148
1149         /* DOS attributes. */
1150         .get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
1151         .get_dos_attributes_recv_fn = vfs_not_implemented_get_dos_attributes_recv,
1152         .fget_dos_attributes_fn = vfs_not_implemented_fget_dos_attributes,
1153         .fset_dos_attributes_fn = vfs_not_implemented_fset_dos_attributes,
1154
1155         /* NT ACL operations. */
1156
1157         .fget_nt_acl_fn = vfs_not_implemented_fget_nt_acl,
1158         .fset_nt_acl_fn = vfs_not_implemented_fset_nt_acl,
1159
1160         /* POSIX ACL operations. */
1161
1162         .sys_acl_get_fd_fn = vfs_not_implemented_sys_acl_get_fd,
1163         .sys_acl_blob_get_fd_fn = vfs_not_implemented_sys_acl_blob_get_fd,
1164         .sys_acl_set_fd_fn = vfs_not_implemented_sys_acl_set_fd,
1165         .sys_acl_delete_def_fd_fn = vfs_not_implemented_sys_acl_delete_def_fd,
1166
1167         /* EA operations. */
1168         .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
1169         .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
1170         .fgetxattr_fn = vfs_not_implemented_fgetxattr,
1171         .flistxattr_fn = vfs_not_implemented_flistxattr,
1172         .fremovexattr_fn = vfs_not_implemented_fremovexattr,
1173         .fsetxattr_fn = vfs_not_implemented_fsetxattr,
1174
1175         /* aio operations */
1176         .aio_force_fn = vfs_not_implemented_aio_force,
1177
1178         /* durable handle operations */
1179         .durable_cookie_fn = vfs_not_implemented_durable_cookie,
1180         .durable_disconnect_fn = vfs_not_implemented_durable_disconnect,
1181         .durable_reconnect_fn = vfs_not_implemented_durable_reconnect,
1182 };
1183
1184 static_decl_vfs;
1185 NTSTATUS vfs_not_implemented_init(TALLOC_CTX *ctx)
1186 {
1187         /*
1188          * smb_vfs_assert_all_fns() makes sure every
1189          * call is implemented.
1190          */
1191         smb_vfs_assert_all_fns(&vfs_not_implemented_fns, "vfs_not_implemented");
1192         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "vfs_not_implemented",
1193                                 &vfs_not_implemented_fns);
1194 }