s3-vfs: Remove unused llistxattr call from VFS modules, system.c and configure
[kai/samba.git] / examples / VFS / skel_transparent.c
1 /* 
2  * Skeleton VFS module.  Implements passthrough operation of all VFS
3  * calls to disk functions.
4  *
5  * Copyright (C) Tim Potter, 1999-2000
6  * Copyright (C) Alexander Bokovoy, 2002
7  * Copyright (C) Stefan (metze) Metzmacher, 2003
8  * Copyright (C) Jeremy Allison 2009
9  *
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.
14  *  
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.
19  *  
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/>.
22  */
23
24
25 #include "../source3/include/includes.h"
26 #include "smbd/proto.h"
27
28 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE 
29    SAMBA DEVELOPERS GUIDE!!!!!!
30  */
31
32 /* If you take this file as template for your module
33  * please make sure that you remove all skel_XXX() functions you don't
34  * want to implement!! The passthrough operations are not
35  * neccessary in a real module.
36  *
37  * --metze
38  */
39
40 static int skel_connect(vfs_handle_struct *handle,  const char *service, const char *user)    
41 {
42         return SMB_VFS_NEXT_CONNECT(handle, service, user);
43 }
44
45 static void skel_disconnect(vfs_handle_struct *handle)
46 {
47         SMB_VFS_NEXT_DISCONNECT(handle);
48 }
49
50 static uint64_t skel_disk_free(vfs_handle_struct *handle,  const char *path,
51         bool small_query, uint64_t *bsize,
52         uint64_t *dfree, uint64_t *dsize)
53 {
54         return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, 
55                                          dfree, dsize);
56 }
57
58 static int skel_get_quota(vfs_handle_struct *handle,  enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
59 {
60         return SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq);
61 }
62
63 static int skel_set_quota(vfs_handle_struct *handle,  enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
64 {
65         return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq);
66 }
67
68 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels)
69 {
70         return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels);
71 }
72
73 static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf)
74 {
75         return SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
76 }
77
78 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res)
79 {
80         return SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res);
81 }
82
83 static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
84                                        struct dfs_GetDFSReferral *r)
85 {
86         return SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r);
87 }
88
89 static DIR *skel_opendir(vfs_handle_struct *handle,  const char *fname, const char *mask, uint32 attr)
90 {
91         return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
92 }
93
94 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
95 {
96         return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
97 }
98
99 static struct dirent *skel_readdir(vfs_handle_struct *handle,
100                                        DIR *dirp,
101                                        SMB_STRUCT_STAT *sbuf)
102 {
103         return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
104 }
105
106 static void skel_seekdir(vfs_handle_struct *handle,  DIR *dirp, long offset)
107 {
108         SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
109 }
110
111 static long skel_telldir(vfs_handle_struct *handle,  DIR *dirp)
112 {
113         return SMB_VFS_NEXT_TELLDIR(handle, dirp);
114 }
115
116 static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
117 {
118         SMB_VFS_NEXT_REWINDDIR(handle, dirp);
119 }
120
121 static int skel_mkdir(vfs_handle_struct *handle,  const char *path, mode_t mode)
122 {
123         return SMB_VFS_NEXT_MKDIR(handle, path, mode);
124 }
125
126 static int skel_rmdir(vfs_handle_struct *handle,  const char *path)
127 {
128         return SMB_VFS_NEXT_RMDIR(handle, path);
129 }
130
131 static int skel_closedir(vfs_handle_struct *handle,  DIR *dir)
132 {
133         return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
134 }
135
136 static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
137 {
138         SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
139 }
140
141 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
142                      files_struct *fsp, int flags, mode_t mode)
143 {
144         return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
145 }
146
147 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
148                                 struct smb_request *req,
149                                 uint16_t root_dir_fid,
150                                 struct smb_filename *smb_fname,
151                                 uint32_t access_mask,
152                                 uint32_t share_access,
153                                 uint32_t create_disposition,
154                                 uint32_t create_options,
155                                 uint32_t file_attributes,
156                                 uint32_t oplock_request,
157                                 uint64_t allocation_size,
158                                 uint32_t private_flags,
159                                 struct security_descriptor *sd,
160                                 struct ea_list *ea_list,
161                                 files_struct **result,
162                                 int *pinfo)
163 {
164         return SMB_VFS_NEXT_CREATE_FILE(handle,
165                                 req,
166                                 root_dir_fid,
167                                 smb_fname,
168                                 access_mask,
169                                 share_access,
170                                 create_disposition,
171                                 create_options,
172                                 file_attributes,
173                                 oplock_request,
174                                 allocation_size,
175                                 private_flags,
176                                 sd,
177                                 ea_list,
178                                 result,
179                                 pinfo);
180 }
181
182 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
183 {
184         return SMB_VFS_NEXT_CLOSE(handle, fsp);
185 }
186
187 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
188 {
189         return SMB_VFS_NEXT_READ(handle, fsp, data, n);
190 }
191
192 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
193 {
194         return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
195 }
196
197 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
198 {
199         return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
200 }
201
202 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
203 {
204         return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
205 }
206
207 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
208 {
209         return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
210 }
211
212 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n)
213 {
214         return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
215 }
216
217 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
218 {
219         return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
220 }
221
222 static int skel_rename(vfs_handle_struct *handle,
223                        const struct smb_filename *smb_fname_src,
224                        const struct smb_filename *smb_fname_dst)
225 {
226         return SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
227 }
228
229 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
230 {
231         return SMB_VFS_NEXT_FSYNC(handle, fsp);
232 }
233
234 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
235 {
236         return SMB_VFS_NEXT_STAT(handle, smb_fname);
237 }
238
239 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
240 {
241         return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
242 }
243
244 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
245 {
246         return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
247 }
248
249 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
250 {
251         return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
252 }
253
254 static int skel_unlink(vfs_handle_struct *handle,
255                        const struct smb_filename *smb_fname)
256 {
257         return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
258 }
259
260 static int skel_chmod(vfs_handle_struct *handle,  const char *path, mode_t mode)
261 {
262         return SMB_VFS_NEXT_CHMOD(handle, path, mode);
263 }
264
265 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
266 {
267         return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
268 }
269
270 static int skel_chown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
271 {
272         return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
273 }
274
275 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
276 {
277         return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
278 }
279
280 static int skel_lchown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
281 {
282         return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
283 }
284
285 static int skel_chdir(vfs_handle_struct *handle,  const char *path)
286 {
287         return SMB_VFS_NEXT_CHDIR(handle, path);
288 }
289
290 static char *skel_getwd(vfs_handle_struct *handle)
291 {
292         return SMB_VFS_NEXT_GETWD(handle);
293 }
294
295 static int skel_ntimes(vfs_handle_struct *handle,
296                        const struct smb_filename *smb_fname,
297                        struct smb_file_time *ft)
298 {
299         return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
300 }
301
302 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
303 {
304         return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
305 }
306
307 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
308                         enum vfs_fallocate_mode mode,
309                         SMB_OFF_T offset,
310                         SMB_OFF_T len)
311 {
312         return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
313 }
314
315 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
316 {
317         return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
318 }
319
320 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode, uint32 access_mask)
321 {
322         return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
323 }
324
325 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype)
326 {
327         return SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
328 }
329
330 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
331 {
332         return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
333 }
334
335 static int skel_symlink(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
336 {
337         return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
338 }
339
340 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz)
341 {
342         return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
343 }
344
345 static int skel_link(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
346 {
347         return SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
348 }
349
350 static int skel_mknod(vfs_handle_struct *handle,  const char *path, mode_t mode, SMB_DEV_T dev)
351 {
352         return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev);
353 }
354
355 static char *skel_realpath(vfs_handle_struct *handle,  const char *path)
356 {
357         return SMB_VFS_NEXT_REALPATH(handle, path);
358 }
359
360 static NTSTATUS skel_notify_watch(
361         struct vfs_handle_struct *handle,
362         struct sys_notify_context *ctx,
363         const char *path,
364         uint32_t *filter,
365         uint32_t *subdir_filter,
366         void (*callback)(struct sys_notify_context *ctx, void *private_data,
367                          struct notify_event *ev),
368         void *private_data, void *handle_p)
369 {
370         return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path,
371                                          filter, subdir_filter, callback,
372                 private_data, handle_p);
373 }
374
375 static int skel_chflags(vfs_handle_struct *handle,  const char *path, uint flags)
376 {
377         return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
378 }
379
380 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
381                                           const SMB_STRUCT_STAT *sbuf)
382 {
383         return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
384 }
385
386 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
387                                 struct files_struct *fsp,
388                                 const char *fname,
389                                 TALLOC_CTX *mem_ctx,
390                                 unsigned int *num_streams,
391                                 struct stream_struct **streams)
392 {
393         return SMB_VFS_NEXT_STREAMINFO(handle,
394                                         fsp,
395                                         fname,
396                                         mem_ctx,
397                                         num_streams,
398                                         streams);
399 }
400
401 static int skel_get_real_filename(struct vfs_handle_struct *handle,
402                                 const char *path,
403                                 const char *name,
404                                 TALLOC_CTX *mem_ctx,
405                                 char **found_name)
406 {
407         return SMB_VFS_NEXT_GET_REAL_FILENAME(handle,
408                                         path,
409                                         name,
410                                         mem_ctx,
411                                         found_name);
412 }
413
414 static const char *skel_connectpath(struct vfs_handle_struct *handle,
415                                 const char *filename)
416 {
417         return SMB_VFS_NEXT_CONNECTPATH(handle, filename);
418 }
419
420 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
421                                 struct byte_range_lock *br_lck,
422                                 struct lock_struct *plock,
423                                 bool blocking_lock,
424                                 struct blocking_lock_record *blr)
425 {
426         return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle,
427                                         br_lck,
428                                         plock,
429                                         blocking_lock,
430                                         blr);
431 }
432
433 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
434                                 struct messaging_context *msg_ctx,
435                                 struct byte_range_lock *br_lck,
436                                 const struct lock_struct *plock)
437 {
438         return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle,
439                                         msg_ctx,
440                                         br_lck,
441                                         plock);
442 }
443
444 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
445                                 struct byte_range_lock *br_lck,
446                                 struct lock_struct *plock,
447                                 struct blocking_lock_record *blr)
448 {
449         return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle,
450                                 br_lck,
451                                 plock,
452                                 blr);
453 }
454
455 static bool skel_strict_lock(struct vfs_handle_struct *handle,
456                                 struct files_struct *fsp,
457                                 struct lock_struct *plock)
458 {
459         return SMB_VFS_NEXT_STRICT_LOCK(handle,
460                                         fsp,
461                                         plock);
462 }
463
464 static void skel_strict_unlock(struct vfs_handle_struct *handle,
465                                 struct files_struct *fsp,
466                                 struct lock_struct *plock)
467 {
468         SMB_VFS_NEXT_STRICT_UNLOCK(handle,
469                                         fsp,
470                                         plock);
471 }
472
473 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
474                                 const char *mapped_name,
475                                 enum vfs_translate_direction direction,
476                                 TALLOC_CTX *mem_ctx,
477                                 char **pmapped_name)
478 {
479         return SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction,
480                                            mem_ctx, pmapped_name);
481 }
482
483 static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle,
484                         struct files_struct *fsp,
485                         TALLOC_CTX *ctx,
486                         uint32_t function,
487                         uint16_t req_flags,  /* Needed for UNICODE ... */
488                         const uint8_t *_in_data,
489                         uint32_t in_len,
490                         uint8_t **_out_data,
491                         uint32_t max_out_len,
492                         uint32_t *out_len)
493 {
494         return SMB_VFS_NEXT_FSCTL(handle,
495                                 fsp,
496                                 ctx,
497                                 function,
498                                 req_flags,
499                                 _in_data,
500                                 in_len,
501                                 _out_data,
502                                 max_out_len,
503                                 out_len);
504 }
505
506 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
507         uint32 security_info, struct security_descriptor **ppdesc)
508 {
509         return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
510 }
511
512 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
513         const char *name, uint32 security_info, struct security_descriptor **ppdesc)
514 {
515         return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
516 }
517
518 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
519         uint32 security_info_sent, const struct security_descriptor *psd)
520 {
521         return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
522 }
523
524 static int skel_chmod_acl(vfs_handle_struct *handle,  const char *name, mode_t mode)
525 {
526         return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
527 }
528
529 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
530 {
531         return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
532 }
533
534 static int skel_sys_acl_get_entry(vfs_handle_struct *handle,  SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
535 {
536         return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p);
537 }
538
539 static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p)
540 {
541         return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p);
542 }
543
544 static int skel_sys_acl_get_permset(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
545 {
546         return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p);
547 }
548
549 static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry_d)
550 {
551         return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d);
552 }
553
554 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,  const char *path_p, SMB_ACL_TYPE_T type)
555 {
556         return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type);
557 }
558
559 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
560 {
561         return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
562 }
563
564 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset)
565 {
566         return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset);
567 }
568
569 static int skel_sys_acl_add_perm(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
570 {
571         return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm);
572 }
573
574 static char *skel_sys_acl_to_text(vfs_handle_struct *handle,  SMB_ACL_T theacl, ssize_t *plen)
575 {
576         return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen);
577 }
578
579 static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle,  int count)
580 {
581         return SMB_VFS_NEXT_SYS_ACL_INIT(handle, count);
582 }
583
584 static int skel_sys_acl_create_entry(vfs_handle_struct *handle,  SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
585 {
586         return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry);
587 }
588
589 static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
590 {
591         return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype);
592 }
593
594 static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, void *qual)
595 {
596         return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual);
597 }
598
599 static int skel_sys_acl_set_permset(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
600 {
601         return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset);
602 }
603
604 static int skel_sys_acl_valid(vfs_handle_struct *handle,  SMB_ACL_T theacl )
605 {
606         return SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl);
607 }
608
609 static int skel_sys_acl_set_file(vfs_handle_struct *handle,  const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
610 {
611         return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
612 }
613
614 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
615 {
616         return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
617 }
618
619 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,  const char *path)
620 {
621         return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
622 }
623
624 static int skel_sys_acl_get_perm(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
625 {
626         return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm);
627 }
628
629 static int skel_sys_acl_free_text(vfs_handle_struct *handle,  char *text)
630 {
631         return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text);
632 }
633
634 static int skel_sys_acl_free_acl(vfs_handle_struct *handle,  SMB_ACL_T posix_acl)
635 {
636         return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl);
637 }
638
639 static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle,  void *qualifier, SMB_ACL_TAG_T tagtype)
640 {
641         return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype);
642 }
643
644 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
645 {
646         return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
647 }
648
649 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
650 {
651         return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
652 }
653
654 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
655 {
656         return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
657 }
658
659 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
660 {
661         return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
662 }
663
664 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
665 {
666         return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
667 }
668
669 static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
670 {
671         return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
672 }
673
674 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
675 {
676         return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
677 }
678
679 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
680 {
681         return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags);
682 }
683
684 static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
685 {
686         return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags);
687 }
688
689 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
690 {
691         return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
692 }
693
694 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
695 {
696         return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
697 }
698
699 static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
700 {
701         return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
702 }
703
704 static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
705 {
706         return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
707 }
708
709 static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
710 {
711         return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
712 }
713
714 static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
715 {
716         return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
717 }
718
719 static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
720 {
721         return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
722 }
723
724 static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts)
725 {
726         return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
727 }
728
729 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
730 {
731         return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
732 }
733
734 static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf)
735 {
736         return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
737 }
738
739 static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname)
740 {
741         return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
742 }
743
744 /* VFS operations structure */
745
746 struct vfs_fn_pointers skel_transparent_fns = {
747         /* Disk operations */
748
749         .connect_fn = skel_connect,
750         .disconnect_fn = skel_disconnect,
751         .disk_free_fn = skel_disk_free,
752         .get_quota_fn = skel_get_quota,
753         .set_quota_fn = skel_set_quota,
754         .get_shadow_copy_data_fn = skel_get_shadow_copy_data,
755         .statvfs_fn = skel_statvfs,
756         .fs_capabilities_fn = skel_fs_capabilities,
757         .get_dfs_referrals_fn = skel_get_dfs_referrals,
758
759         /* Directory operations */
760
761         .opendir_fn = skel_opendir,
762         .fdopendir_fn = skel_fdopendir,
763         .readdir_fn = skel_readdir,
764         .seekdir_fn = skel_seekdir,
765         .telldir_fn = skel_telldir,
766         .rewind_dir_fn = skel_rewind_dir,
767         .mkdir_fn = skel_mkdir,
768         .rmdir_fn = skel_rmdir,
769         .closedir_fn = skel_closedir,
770         .init_search_op_fn = skel_init_search_op,
771
772         /* File operations */
773
774         .open_fn = skel_open,
775         .create_file_fn = skel_create_file,
776         .close_fn = skel_close_fn,
777         .read_fn = skel_vfs_read,
778         .pread_fn = skel_pread,
779         .write_fn = skel_write,
780         .pwrite_fn = skel_pwrite,
781         .lseek_fn = skel_lseek,
782         .sendfile_fn = skel_sendfile,
783         .recvfile_fn = skel_recvfile,
784         .rename_fn = skel_rename,
785         .fsync_fn = skel_fsync,
786         .stat_fn = skel_stat,
787         .fstat_fn = skel_fstat,
788         .lstat_fn = skel_lstat,
789         .get_alloc_size_fn = skel_get_alloc_size,
790         .unlink_fn = skel_unlink,
791         .chmod_fn = skel_chmod,
792         .fchmod_fn = skel_fchmod,
793         .chown_fn = skel_chown,
794         .fchown_fn = skel_fchown,
795         .lchown_fn = skel_lchown,
796         .chdir_fn = skel_chdir,
797         .getwd_fn = skel_getwd,
798         .ntimes_fn = skel_ntimes,
799         .ftruncate_fn = skel_ftruncate,
800         .fallocate_fn = skel_fallocate,
801         .lock_fn = skel_lock,
802         .kernel_flock_fn = skel_kernel_flock,
803         .linux_setlease_fn = skel_linux_setlease,
804         .getlock_fn = skel_getlock,
805         .symlink_fn = skel_symlink,
806         .readlink_fn = skel_vfs_readlink,
807         .link_fn = skel_link,
808         .mknod_fn = skel_mknod,
809         .realpath_fn = skel_realpath,
810         .notify_watch_fn = skel_notify_watch,
811         .chflags_fn = skel_chflags,
812         .file_id_create_fn = skel_file_id_create,
813
814         .streaminfo_fn = skel_streaminfo,
815         .get_real_filename_fn = skel_get_real_filename,
816         .connectpath_fn = skel_connectpath,
817         .brl_lock_windows_fn = skel_brl_lock_windows,
818         .brl_unlock_windows_fn = skel_brl_unlock_windows,
819         .brl_cancel_windows_fn = skel_brl_cancel_windows,
820         .strict_lock_fn = skel_strict_lock,
821         .strict_unlock_fn = skel_strict_unlock,
822         .translate_name_fn = skel_translate_name,
823         .fsctl_fn = skel_fsctl,
824
825         /* NT ACL operations. */
826
827         .fget_nt_acl_fn = skel_fget_nt_acl,
828         .get_nt_acl_fn = skel_get_nt_acl,
829         .fset_nt_acl_fn = skel_fset_nt_acl,
830
831         /* POSIX ACL operations. */
832
833         .chmod_acl_fn = skel_chmod_acl,
834         .fchmod_acl_fn = skel_fchmod_acl,
835
836         .sys_acl_get_entry_fn = skel_sys_acl_get_entry,
837         .sys_acl_get_tag_type_fn = skel_sys_acl_get_tag_type,
838         .sys_acl_get_permset_fn = skel_sys_acl_get_permset,
839         .sys_acl_get_qualifier_fn = skel_sys_acl_get_qualifier,
840         .sys_acl_get_file_fn = skel_sys_acl_get_file,
841         .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
842         .sys_acl_clear_perms_fn = skel_sys_acl_clear_perms,
843         .sys_acl_add_perm_fn = skel_sys_acl_add_perm,
844         .sys_acl_to_text_fn = skel_sys_acl_to_text,
845         .sys_acl_init_fn = skel_sys_acl_init,
846         .sys_acl_create_entry_fn = skel_sys_acl_create_entry,
847         .sys_acl_set_tag_type_fn = skel_sys_acl_set_tag_type,
848         .sys_acl_set_qualifier_fn = skel_sys_acl_set_qualifier,
849         .sys_acl_set_permset_fn = skel_sys_acl_set_permset,
850         .sys_acl_valid_fn = skel_sys_acl_valid,
851         .sys_acl_set_file_fn = skel_sys_acl_set_file,
852         .sys_acl_set_fd_fn = skel_sys_acl_set_fd,
853         .sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
854         .sys_acl_get_perm_fn = skel_sys_acl_get_perm,
855         .sys_acl_free_text_fn = skel_sys_acl_free_text,
856         .sys_acl_free_acl_fn = skel_sys_acl_free_acl,
857         .sys_acl_free_qualifier_fn = skel_sys_acl_free_qualifier,
858
859         /* EA operations. */
860         .getxattr_fn = skel_getxattr,
861         .fgetxattr_fn = skel_fgetxattr,
862         .listxattr_fn = skel_listxattr,
863         .flistxattr_fn = skel_flistxattr,
864         .removexattr_fn = skel_removexattr,
865         .lremovexattr_fn = skel_lremovexattr,
866         .fremovexattr_fn = skel_fremovexattr,
867         .setxattr_fn = skel_setxattr,
868         .lsetxattr_fn = skel_lsetxattr,
869         .fsetxattr_fn = skel_fsetxattr,
870
871         /* aio operations */
872         .aio_read_fn = skel_aio_read,
873         .aio_write_fn = skel_aio_write,
874         .aio_return_fn = skel_aio_return_fn,
875         .aio_cancel_fn = skel_aio_cancel,
876         .aio_error_fn = skel_aio_error_fn,
877         .aio_fsync_fn = skel_aio_fsync,
878         .aio_suspend_fn = skel_aio_suspend,
879         .aio_force_fn = skel_aio_force,
880
881         /* offline operations */
882         .is_offline_fn = skel_is_offline,
883         .set_offline_fn = skel_set_offline
884 };
885
886 NTSTATUS vfs_skel_transparent_init(void)
887 {
888         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", &skel_transparent_fns);
889 }