Revert "s4:ldb-samba Use temp talloc contexts and talloc_steal avoid leaks."
[Samba/cd1.git] / examples / VFS / skel_transparent.c
blobc52b057f47aa6fba2510623065637f0f02ef672e
1 /*
2 * Skeleton VFS module. Implements passthrough operation of all VFS
3 * calls to disk functions.
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
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, see <http://www.gnu.org/licenses/>.
25 #include "includes.h"
27 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE
28 SAMBA DEVELOPERS GUIDE!!!!!!
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.
36 * --metze
39 static int skel_connect(vfs_handle_struct *handle, const char *service, const char *user)
41 return SMB_VFS_NEXT_CONNECT(handle, service, user);
44 static void skel_disconnect(vfs_handle_struct *handle)
46 SMB_VFS_NEXT_DISCONNECT(handle);
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)
53 return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
54 dfree, dsize);
57 static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
59 return SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq);
62 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
64 return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq);
67 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
69 return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels);
72 static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf)
74 return SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
77 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res)
79 return SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res);
82 static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
84 return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
87 static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
88 SMB_STRUCT_DIR *dirp,
89 SMB_STRUCT_STAT *sbuf)
91 return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
94 static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)
96 SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
99 static long skel_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
101 return SMB_VFS_NEXT_TELLDIR(handle, dirp);
104 static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
106 SMB_VFS_NEXT_REWINDDIR(handle, dirp);
109 static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode)
111 return SMB_VFS_NEXT_MKDIR(handle, path, mode);
114 static int skel_rmdir(vfs_handle_struct *handle, const char *path)
116 return SMB_VFS_NEXT_RMDIR(handle, path);
119 static int skel_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dir)
121 return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
124 static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
126 SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
129 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
130 files_struct *fsp, int flags, mode_t mode)
132 return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
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)
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,
163 ea_list,
164 result,
165 pinfo);
168 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
170 return SMB_VFS_NEXT_CLOSE(handle, fsp);
173 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
175 return SMB_VFS_NEXT_READ(handle, fsp, data, n);
178 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
180 return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
183 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
185 return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
188 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
190 return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
193 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
195 return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
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)
200 return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
203 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
205 return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
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)
212 return SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
215 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
217 return SMB_VFS_NEXT_FSYNC(handle, fsp);
220 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
222 return SMB_VFS_NEXT_STAT(handle, smb_fname);
225 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
227 return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
230 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
232 return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
235 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
237 return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
240 static int skel_unlink(vfs_handle_struct *handle,
241 const struct smb_filename *smb_fname)
243 return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
246 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
248 return SMB_VFS_NEXT_CHMOD(handle, path, mode);
251 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
253 return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
256 static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
258 return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
261 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
263 return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
266 static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
268 return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
271 static int skel_chdir(vfs_handle_struct *handle, const char *path)
273 return SMB_VFS_NEXT_CHDIR(handle, path);
276 static char *skel_getwd(vfs_handle_struct *handle, char *buf)
278 return SMB_VFS_NEXT_GETWD(handle, buf);
281 static int skel_ntimes(vfs_handle_struct *handle,
282 const struct smb_filename *smb_fname,
283 struct smb_file_time *ft)
285 return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
288 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
290 return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
293 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
295 return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
298 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode)
300 return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode);
303 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype)
305 return SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
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)
310 return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
313 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath)
315 return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
318 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz)
320 return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
323 static int skel_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath)
325 return SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
328 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev)
330 return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev);
333 static char *skel_realpath(vfs_handle_struct *handle, const char *path, char *resolved_path)
335 return SMB_VFS_NEXT_REALPATH(handle, path, resolved_path);
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)
343 return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback,
344 private_data, handle_p);
347 static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags)
349 return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
352 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
353 const SMB_STRUCT_STAT *sbuf)
355 return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
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)
365 return SMB_VFS_NEXT_STREAMINFO(handle,
366 fsp,
367 fname,
368 mem_ctx,
369 num_streams,
370 streams);
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)
379 return SMB_VFS_NEXT_GET_REAL_FILENAME(handle,
380 path,
381 name,
382 mem_ctx,
383 found_name);
386 static const char *skel_connectpath(struct vfs_handle_struct *handle,
387 const char *filename)
389 return SMB_VFS_NEXT_CONNECTPATH(handle, filename);
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)
398 return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle,
399 br_lck,
400 plock,
401 blocking_lock,
402 blr);
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)
410 return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle,
411 msg_ctx,
412 br_lck,
413 plock);
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)
421 return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle,
422 br_lck,
423 plock,
424 blr);
427 static bool skel_strict_lock(struct vfs_handle_struct *handle,
428 struct files_struct *fsp,
429 struct lock_struct *plock)
431 return SMB_VFS_NEXT_STRICT_LOCK(handle,
432 fsp,
433 plock);
436 static void skel_strict_unlock(struct vfs_handle_struct *handle,
437 struct files_struct *fsp,
438 struct lock_struct *plock)
440 SMB_VFS_NEXT_STRICT_UNLOCK(handle,
441 fsp,
442 plock);
445 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
446 char **mapped_name,
447 enum vfs_translate_direction direction)
449 return SMB_VFS_NEXT_TRANSLATE_NAME(handle,
450 mapped_name,
451 direction);
454 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
455 uint32 security_info, SEC_DESC **ppdesc)
457 return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
460 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
461 const char *name, uint32 security_info, SEC_DESC **ppdesc)
463 return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
466 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
467 uint32 security_info_sent, const SEC_DESC *psd)
469 return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
472 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode)
474 return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
477 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
479 return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
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)
484 return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p);
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)
489 return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p);
492 static int skel_sys_acl_get_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
494 return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p);
497 static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d)
499 return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d);
502 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type)
504 return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type);
507 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
509 return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
512 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset)
514 return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset);
517 static int skel_sys_acl_add_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
519 return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm);
522 static char *skel_sys_acl_to_text(vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen)
524 return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen);
527 static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, int count)
529 return SMB_VFS_NEXT_SYS_ACL_INIT(handle, count);
532 static int skel_sys_acl_create_entry(vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
534 return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry);
537 static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
539 return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype);
542 static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual)
544 return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual);
547 static int skel_sys_acl_set_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
549 return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset);
552 static int skel_sys_acl_valid(vfs_handle_struct *handle, SMB_ACL_T theacl )
554 return SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl);
557 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
559 return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
562 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
564 return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
567 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path)
569 return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
572 static int skel_sys_acl_get_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
574 return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm);
577 static int skel_sys_acl_free_text(vfs_handle_struct *handle, char *text)
579 return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text);
582 static int skel_sys_acl_free_acl(vfs_handle_struct *handle, SMB_ACL_T posix_acl)
584 return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl);
587 static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype)
589 return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype);
592 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
594 return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
597 static ssize_t skel_lgetxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t
598 size)
600 return SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size);
603 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
605 return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
608 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
610 return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
613 static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
615 return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size);
618 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
620 return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
623 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
625 return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
628 static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
630 return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
633 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
635 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
638 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
640 return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags);
643 static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
645 return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags);
648 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
650 return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
653 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
655 return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
658 static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
660 return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
663 static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
665 return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
668 static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
670 return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
673 static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
675 return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
678 static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
680 return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
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)
685 return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
688 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
690 return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
693 static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
695 return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf);
698 static int skel_set_offline(struct vfs_handle_struct *handle, const char *path)
700 return SMB_VFS_NEXT_SET_OFFLINE(handle, path);
703 /* VFS operations structure */
705 struct vfs_fn_pointers skel_transparent_fns = {
706 /* Disk operations */
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,
717 /* Directory operations */
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,
729 /* File operations */
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,
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,
780 /* NT ACL operations. */
782 .fget_nt_acl = skel_fget_nt_acl,
783 .get_nt_acl = skel_get_nt_acl,
784 .fset_nt_acl = skel_fset_nt_acl,
786 /* POSIX ACL operations. */
788 .chmod_acl = skel_chmod_acl,
789 .fchmod_acl = skel_fchmod_acl,
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,
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,
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,
838 /* offline operations */
839 .is_offline = skel_is_offline,
840 .set_offline = skel_set_offline
843 NTSTATUS vfs_skel_transparent_init(void)
845 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", &skel_transparent_fns);