s3: add perfcount idl and generated files.
[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 "includes.h"
26
27 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE 
28    SAMBA DEVELOPERS GUIDE!!!!!!
29  */
30
31 /* If you take this file as template for your module
32  * please make sure that you remove all skel_XXX() functions you don't
33  * want to implement!! The passthrough operations are not
34  * neccessary in a real module.
35  *
36  * --metze
37  */
38
39 static int skel_connect(vfs_handle_struct *handle,  const char *service, const char *user)    
40 {
41         return SMB_VFS_NEXT_CONNECT(handle, service, user);
42 }
43
44 static void skel_disconnect(vfs_handle_struct *handle)
45 {
46         SMB_VFS_NEXT_DISCONNECT(handle);
47 }
48
49 static uint64_t skel_disk_free(vfs_handle_struct *handle,  const char *path,
50         bool small_query, uint64_t *bsize,
51         uint64_t *dfree, uint64_t *dsize)
52 {
53         return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, 
54                                          dfree, dsize);
55 }
56
57 static int skel_get_quota(vfs_handle_struct *handle,  enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
58 {
59         return SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq);
60 }
61
62 static int skel_set_quota(vfs_handle_struct *handle,  enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
63 {
64         return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq);
65 }
66
67 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
68 {
69         return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels);
70 }
71
72 static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf)
73 {
74         return SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
75 }
76
77 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res)
78 {
79         return SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res);
80 }
81
82 static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle,  const char *fname, const char *mask, uint32 attr)
83 {
84         return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
85 }
86
87 static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
88                                        SMB_STRUCT_DIR *dirp,
89                                        SMB_STRUCT_STAT *sbuf)
90 {
91         return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
92 }
93
94 static void skel_seekdir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp, long offset)
95 {
96         SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
97 }
98
99 static long skel_telldir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp)
100 {
101         return SMB_VFS_NEXT_TELLDIR(handle, dirp);
102 }
103
104 static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
105 {
106         SMB_VFS_NEXT_REWINDDIR(handle, dirp);
107 }
108
109 static int skel_mkdir(vfs_handle_struct *handle,  const char *path, mode_t mode)
110 {
111         return SMB_VFS_NEXT_MKDIR(handle, path, mode);
112 }
113
114 static int skel_rmdir(vfs_handle_struct *handle,  const char *path)
115 {
116         return SMB_VFS_NEXT_RMDIR(handle, path);
117 }
118
119 static int skel_closedir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dir)
120 {
121         return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
122 }
123
124 static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
125 {
126         SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
127 }
128
129 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
130                      files_struct *fsp, int flags, mode_t mode)
131 {
132         return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
133 }
134
135 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
136                                 struct smb_request *req,
137                                 uint16_t root_dir_fid,
138                                 struct smb_filename *smb_fname,
139                                 uint32_t access_mask,
140                                 uint32_t share_access,
141                                 uint32_t create_disposition,
142                                 uint32_t create_options,
143                                 uint32_t file_attributes,
144                                 uint32_t oplock_request,
145                                 uint64_t allocation_size,
146                                 struct security_descriptor *sd,
147                                 struct ea_list *ea_list,
148                                 files_struct **result,
149                                 int *pinfo)
150 {
151         return SMB_VFS_NEXT_CREATE_FILE(handle,
152                                 req,
153                                 root_dir_fid,
154                                 smb_fname,
155                                 access_mask,
156                                 share_access,
157                                 create_disposition,
158                                 create_options,
159                                 file_attributes,
160                                 oplock_request,
161                                 allocation_size,
162                                 sd,
163                                 ea_list,
164                                 result,
165                                 pinfo);
166 }
167
168 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
169 {
170         return SMB_VFS_NEXT_CLOSE(handle, fsp);
171 }
172
173 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
174 {
175         return SMB_VFS_NEXT_READ(handle, fsp, data, n);
176 }
177
178 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
179 {
180         return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
181 }
182
183 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
184 {
185         return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
186 }
187
188 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
189 {
190         return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
191 }
192
193 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
194 {
195         return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
196 }
197
198 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)
199 {
200         return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
201 }
202
203 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
204 {
205         return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
206 }
207
208 static int skel_rename(vfs_handle_struct *handle,
209                        const struct smb_filename *smb_fname_src,
210                        const struct smb_filename *smb_fname_dst)
211 {
212         return SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
213 }
214
215 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
216 {
217         return SMB_VFS_NEXT_FSYNC(handle, fsp);
218 }
219
220 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
221 {
222         return SMB_VFS_NEXT_STAT(handle, smb_fname);
223 }
224
225 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
226 {
227         return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
228 }
229
230 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
231 {
232         return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
233 }
234
235 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
236 {
237         return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
238 }
239
240 static int skel_unlink(vfs_handle_struct *handle,
241                        const struct smb_filename *smb_fname)
242 {
243         return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
244 }
245
246 static int skel_chmod(vfs_handle_struct *handle,  const char *path, mode_t mode)
247 {
248         return SMB_VFS_NEXT_CHMOD(handle, path, mode);
249 }
250
251 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
252 {
253         return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
254 }
255
256 static int skel_chown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
257 {
258         return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
259 }
260
261 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
262 {
263         return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
264 }
265
266 static int skel_lchown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
267 {
268         return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
269 }
270
271 static int skel_chdir(vfs_handle_struct *handle,  const char *path)
272 {
273         return SMB_VFS_NEXT_CHDIR(handle, path);
274 }
275
276 static char *skel_getwd(vfs_handle_struct *handle,  char *buf)
277 {
278         return SMB_VFS_NEXT_GETWD(handle, buf);
279 }
280
281 static int skel_ntimes(vfs_handle_struct *handle,
282                        const struct smb_filename *smb_fname,
283                        struct smb_file_time *ft)
284 {
285         return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
286 }
287
288 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
289 {
290         return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
291 }
292
293 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
294 {
295         return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
296 }
297
298 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode)
299 {
300         return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode);
301 }
302
303 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype)
304 {
305         return SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
306 }
307
308 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
309 {
310         return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
311 }
312
313 static int skel_symlink(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
314 {
315         return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
316 }
317
318 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz)
319 {
320         return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
321 }
322
323 static int skel_link(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
324 {
325         return SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
326 }
327
328 static int skel_mknod(vfs_handle_struct *handle,  const char *path, mode_t mode, SMB_DEV_T dev)
329 {
330         return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev);
331 }
332
333 static char *skel_realpath(vfs_handle_struct *handle,  const char *path, char *resolved_path)
334 {
335         return SMB_VFS_NEXT_REALPATH(handle, path, resolved_path);
336 }
337
338 static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
339             struct sys_notify_context *ctx, struct notify_entry *e,
340             void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev),
341             void *private_data, void *handle_p)
342 {
343         return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback,
344                 private_data, handle_p);
345 }
346
347 static int skel_chflags(vfs_handle_struct *handle,  const char *path, uint flags)
348 {
349         return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
350 }
351
352 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
353                                           const SMB_STRUCT_STAT *sbuf)
354 {
355         return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
356 }
357
358 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
359                                 struct files_struct *fsp,
360                                 const char *fname,
361                                 TALLOC_CTX *mem_ctx,
362                                 unsigned int *num_streams,
363                                 struct stream_struct **streams)
364 {
365         return SMB_VFS_NEXT_STREAMINFO(handle,
366                                         fsp,
367                                         fname,
368                                         mem_ctx,
369                                         num_streams,
370                                         streams);
371 }
372
373 static int skel_get_real_filename(struct vfs_handle_struct *handle,
374                                 const char *path,
375                                 const char *name,
376                                 TALLOC_CTX *mem_ctx,
377                                 char **found_name)
378 {
379         return SMB_VFS_NEXT_GET_REAL_FILENAME(handle,
380                                         path,
381                                         name,
382                                         mem_ctx,
383                                         found_name);
384 }
385
386 static const char *skel_connectpath(struct vfs_handle_struct *handle,
387                                 const char *filename)
388 {
389         return SMB_VFS_NEXT_CONNECTPATH(handle, filename);
390 }
391
392 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
393                                 struct byte_range_lock *br_lck,
394                                 struct lock_struct *plock,
395                                 bool blocking_lock,
396                                 struct blocking_lock_record *blr)
397 {
398         return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle,
399                                         br_lck,
400                                         plock,
401                                         blocking_lock,
402                                         blr);
403 }
404
405 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
406                                 struct messaging_context *msg_ctx,
407                                 struct byte_range_lock *br_lck,
408                                 const struct lock_struct *plock)
409 {
410         return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle,
411                                         msg_ctx,
412                                         br_lck,
413                                         plock);
414 }
415
416 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
417                                 struct byte_range_lock *br_lck,
418                                 struct lock_struct *plock,
419                                 struct blocking_lock_record *blr)
420 {
421         return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle,
422                                 br_lck,
423                                 plock,
424                                 blr);
425 }
426
427 static bool skel_strict_lock(struct vfs_handle_struct *handle,
428                                 struct files_struct *fsp,
429                                 struct lock_struct *plock)
430 {
431         return SMB_VFS_NEXT_STRICT_LOCK(handle,
432                                         fsp,
433                                         plock);
434 }
435
436 static void skel_strict_unlock(struct vfs_handle_struct *handle,
437                                 struct files_struct *fsp,
438                                 struct lock_struct *plock)
439 {
440         SMB_VFS_NEXT_STRICT_UNLOCK(handle,
441                                         fsp,
442                                         plock);
443 }
444
445 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
446                                 char **mapped_name,
447                                 enum vfs_translate_direction direction)
448 {
449         return SMB_VFS_NEXT_TRANSLATE_NAME(handle,
450                                         mapped_name,
451                                         direction);
452 }
453
454 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
455         uint32 security_info, SEC_DESC **ppdesc)
456 {
457         return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
458 }
459
460 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
461         const char *name, uint32 security_info, SEC_DESC **ppdesc)
462 {
463         return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
464 }
465
466 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
467         uint32 security_info_sent, const SEC_DESC *psd)
468 {
469         return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
470 }
471
472 static int skel_chmod_acl(vfs_handle_struct *handle,  const char *name, mode_t mode)
473 {
474         return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
475 }
476
477 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
478 {
479         return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
480 }
481
482 static int skel_sys_acl_get_entry(vfs_handle_struct *handle,  SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
483 {
484         return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p);
485 }
486
487 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)
488 {
489         return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p);
490 }
491
492 static int skel_sys_acl_get_permset(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
493 {
494         return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p);
495 }
496
497 static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry_d)
498 {
499         return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d);
500 }
501
502 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,  const char *path_p, SMB_ACL_TYPE_T type)
503 {
504         return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type);
505 }
506
507 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
508 {
509         return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
510 }
511
512 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset)
513 {
514         return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset);
515 }
516
517 static int skel_sys_acl_add_perm(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
518 {
519         return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm);
520 }
521
522 static char *skel_sys_acl_to_text(vfs_handle_struct *handle,  SMB_ACL_T theacl, ssize_t *plen)
523 {
524         return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen);
525 }
526
527 static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle,  int count)
528 {
529         return SMB_VFS_NEXT_SYS_ACL_INIT(handle, count);
530 }
531
532 static int skel_sys_acl_create_entry(vfs_handle_struct *handle,  SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
533 {
534         return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry);
535 }
536
537 static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
538 {
539         return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype);
540 }
541
542 static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, void *qual)
543 {
544         return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual);
545 }
546
547 static int skel_sys_acl_set_permset(vfs_handle_struct *handle,  SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
548 {
549         return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset);
550 }
551
552 static int skel_sys_acl_valid(vfs_handle_struct *handle,  SMB_ACL_T theacl )
553 {
554         return SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl);
555 }
556
557 static int skel_sys_acl_set_file(vfs_handle_struct *handle,  const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
558 {
559         return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
560 }
561
562 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
563 {
564         return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
565 }
566
567 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,  const char *path)
568 {
569         return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
570 }
571
572 static int skel_sys_acl_get_perm(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
573 {
574         return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm);
575 }
576
577 static int skel_sys_acl_free_text(vfs_handle_struct *handle,  char *text)
578 {
579         return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text);
580 }
581
582 static int skel_sys_acl_free_acl(vfs_handle_struct *handle,  SMB_ACL_T posix_acl)
583 {
584         return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl);
585 }
586
587 static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle,  void *qualifier, SMB_ACL_TAG_T tagtype)
588 {
589         return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype);
590 }
591
592 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
593 {
594         return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
595 }
596
597 static ssize_t skel_lgetxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t
598 size)
599 {
600         return SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size);
601 }
602
603 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
604 {
605         return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
606 }
607
608 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
609 {
610         return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
611 }
612
613 static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
614 {
615         return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size);
616 }
617
618 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
619 {
620         return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
621 }
622
623 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
624 {
625         return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
626 }
627
628 static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
629 {
630         return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
631 }
632
633 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
634 {
635         return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
636 }
637
638 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
639 {
640         return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags);
641 }
642
643 static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
644 {
645         return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags);
646 }
647
648 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
649 {
650         return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
651 }
652
653 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
654 {
655         return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
656 }
657
658 static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
659 {
660         return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
661 }
662
663 static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
664 {
665         return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
666 }
667
668 static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
669 {
670         return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
671 }
672
673 static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
674 {
675         return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
676 }
677
678 static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
679 {
680         return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
681 }
682
683 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)
684 {
685         return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
686 }
687
688 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
689 {
690         return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
691 }
692
693 static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
694 {
695         return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf);
696 }
697
698 static int skel_set_offline(struct vfs_handle_struct *handle, const char *path)
699 {
700         return SMB_VFS_NEXT_SET_OFFLINE(handle, path);
701 }
702
703 /* VFS operations structure */
704
705 struct vfs_fn_pointers skel_transparent_fns = {
706         /* Disk operations */
707
708         .connect_fn = skel_connect,
709         .disconnect = skel_disconnect,
710         .disk_free = skel_disk_free,
711         .get_quota = skel_get_quota,
712         .set_quota = skel_set_quota,
713         .get_shadow_copy_data = skel_get_shadow_copy_data,
714         .statvfs = skel_statvfs,
715         .fs_capabilities = skel_fs_capabilities,
716
717         /* Directory operations */
718
719         .opendir = skel_opendir,
720         .readdir = skel_readdir,
721         .seekdir = skel_seekdir,
722         .telldir = skel_telldir,
723         .rewind_dir = skel_rewind_dir,
724         .mkdir = skel_mkdir,
725         .rmdir = skel_rmdir,
726         .closedir = skel_closedir,
727         .init_search_op = skel_init_search_op,
728
729         /* File operations */
730
731         .open = skel_open,
732         .create_file = skel_create_file,
733         .close_fn = skel_close_fn,
734         .vfs_read = skel_vfs_read,
735         .pread = skel_pread,
736         .write = skel_write,
737         .pwrite = skel_pwrite,
738         .lseek = skel_lseek,
739         .sendfile = skel_sendfile,
740         .recvfile = skel_recvfile,
741         .rename = skel_rename,
742         .fsync = skel_fsync,
743         .stat = skel_stat,
744         .fstat = skel_fstat,
745         .lstat = skel_lstat,
746         .get_alloc_size = skel_get_alloc_size,
747         .unlink = skel_unlink,
748         .chmod = skel_chmod,
749         .fchmod = skel_fchmod,
750         .chown = skel_chown,
751         .fchown = skel_fchown,
752         .lchown = skel_lchown,
753         .chdir = skel_chdir,
754         .getwd = skel_getwd,
755         .ntimes = skel_ntimes,
756         .ftruncate = skel_ftruncate,
757         .lock = skel_lock,
758         .kernel_flock = skel_kernel_flock,
759         .linux_setlease = skel_linux_setlease,
760         .getlock = skel_getlock,
761         .symlink = skel_symlink,
762         .vfs_readlink = skel_vfs_readlink,
763         .link = skel_link,
764         .mknod = skel_mknod,
765         .realpath = skel_realpath,
766         .notify_watch = skel_notify_watch,
767         .chflags = skel_chflags,
768         .file_id_create = skel_file_id_create,
769
770         .streaminfo = skel_streaminfo,
771         .get_real_filename = skel_get_real_filename,
772         .connectpath = skel_connectpath,
773         .brl_lock_windows = skel_brl_lock_windows,
774         .brl_unlock_windows = skel_brl_unlock_windows,
775         .brl_cancel_windows = skel_brl_cancel_windows,
776         .strict_lock = skel_strict_lock,
777         .strict_unlock = skel_strict_unlock,
778         .translate_name = skel_translate_name,
779
780         /* NT ACL operations. */
781
782         .fget_nt_acl = skel_fget_nt_acl,
783         .get_nt_acl = skel_get_nt_acl,
784         .fset_nt_acl = skel_fset_nt_acl,
785
786         /* POSIX ACL operations. */
787
788         .chmod_acl = skel_chmod_acl,
789         .fchmod_acl = skel_fchmod_acl,
790
791         .sys_acl_get_entry = skel_sys_acl_get_entry,
792         .sys_acl_get_tag_type = skel_sys_acl_get_tag_type,
793         .sys_acl_get_permset = skel_sys_acl_get_permset,
794         .sys_acl_get_qualifier = skel_sys_acl_get_qualifier,
795         .sys_acl_get_file = skel_sys_acl_get_file,
796         .sys_acl_get_fd = skel_sys_acl_get_fd,
797         .sys_acl_clear_perms = skel_sys_acl_clear_perms,
798         .sys_acl_add_perm = skel_sys_acl_add_perm,
799         .sys_acl_to_text = skel_sys_acl_to_text,
800         .sys_acl_init = skel_sys_acl_init,
801         .sys_acl_create_entry = skel_sys_acl_create_entry,
802         .sys_acl_set_tag_type = skel_sys_acl_set_tag_type,
803         .sys_acl_set_qualifier = skel_sys_acl_set_qualifier,
804         .sys_acl_set_permset = skel_sys_acl_set_permset,
805         .sys_acl_valid = skel_sys_acl_valid,
806         .sys_acl_set_file = skel_sys_acl_set_file,
807         .sys_acl_set_fd = skel_sys_acl_set_fd,
808         .sys_acl_delete_def_file = skel_sys_acl_delete_def_file,
809         .sys_acl_get_perm = skel_sys_acl_get_perm,
810         .sys_acl_free_text = skel_sys_acl_free_text,
811         .sys_acl_free_acl = skel_sys_acl_free_acl,
812         .sys_acl_free_qualifier = skel_sys_acl_free_qualifier,
813
814         /* EA operations. */
815         .getxattr = skel_getxattr,
816         .lgetxattr = skel_lgetxattr,
817         .fgetxattr = skel_fgetxattr,
818         .listxattr = skel_listxattr,
819         .llistxattr = skel_llistxattr,
820         .flistxattr = skel_flistxattr,
821         .removexattr = skel_removexattr,
822         .lremovexattr = skel_lremovexattr,
823         .fremovexattr = skel_fremovexattr,
824         .setxattr = skel_setxattr,
825         .lsetxattr = skel_lsetxattr,
826         .fsetxattr = skel_fsetxattr,
827
828         /* aio operations */
829         .aio_read = skel_aio_read,
830         .aio_write = skel_aio_write,
831         .aio_return_fn = skel_aio_return_fn,
832         .aio_cancel = skel_aio_cancel,
833         .aio_error_fn = skel_aio_error_fn,
834         .aio_fsync = skel_aio_fsync,
835         .aio_suspend = skel_aio_suspend,
836         .aio_force = skel_aio_force,
837
838         /* offline operations */
839         .is_offline = skel_is_offline,
840         .set_offline = skel_set_offline
841 };
842
843 NTSTATUS vfs_skel_transparent_init(void)
844 {
845         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", &skel_transparent_fns);
846 }