talloc: Fix talloc-compat pc files/headers.
[Samba/gebeck_regimport.git] / examples / VFS / skel_transparent.c
blobc9fbc793ecf6a15d6b650735a6a34f2c3add67c4
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"
26 #include "smbd/proto.h"
28 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE
29 SAMBA DEVELOPERS GUIDE!!!!!!
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.
37 * --metze
40 static int skel_connect(vfs_handle_struct *handle, const char *service, const char *user)
42 return SMB_VFS_NEXT_CONNECT(handle, service, user);
45 static void skel_disconnect(vfs_handle_struct *handle)
47 SMB_VFS_NEXT_DISCONNECT(handle);
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)
54 return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
55 dfree, dsize);
58 static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
60 return SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq);
63 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq)
65 return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq);
68 static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels)
70 return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels);
73 static int skel_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf)
75 return SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
78 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res)
80 return SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res);
83 static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
85 return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
88 static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
90 return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
93 static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
94 SMB_STRUCT_DIR *dirp,
95 SMB_STRUCT_STAT *sbuf)
97 return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
100 static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)
102 SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
105 static long skel_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
107 return SMB_VFS_NEXT_TELLDIR(handle, dirp);
110 static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
112 SMB_VFS_NEXT_REWINDDIR(handle, dirp);
115 static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode)
117 return SMB_VFS_NEXT_MKDIR(handle, path, mode);
120 static int skel_rmdir(vfs_handle_struct *handle, const char *path)
122 return SMB_VFS_NEXT_RMDIR(handle, path);
125 static int skel_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dir)
127 return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
130 static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
132 SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
135 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
136 files_struct *fsp, int flags, mode_t mode)
138 return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
141 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
142 struct smb_request *req,
143 uint16_t root_dir_fid,
144 struct smb_filename *smb_fname,
145 uint32_t access_mask,
146 uint32_t share_access,
147 uint32_t create_disposition,
148 uint32_t create_options,
149 uint32_t file_attributes,
150 uint32_t oplock_request,
151 uint64_t allocation_size,
152 uint32_t private_flags,
153 struct security_descriptor *sd,
154 struct ea_list *ea_list,
155 files_struct **result,
156 int *pinfo)
158 return SMB_VFS_NEXT_CREATE_FILE(handle,
159 req,
160 root_dir_fid,
161 smb_fname,
162 access_mask,
163 share_access,
164 create_disposition,
165 create_options,
166 file_attributes,
167 oplock_request,
168 allocation_size,
169 private_flags,
171 ea_list,
172 result,
173 pinfo);
176 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
178 return SMB_VFS_NEXT_CLOSE(handle, fsp);
181 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
183 return SMB_VFS_NEXT_READ(handle, fsp, data, n);
186 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
188 return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
191 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
193 return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
196 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
198 return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
201 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
203 return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
206 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)
208 return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
211 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
213 return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
216 static int skel_rename(vfs_handle_struct *handle,
217 const struct smb_filename *smb_fname_src,
218 const struct smb_filename *smb_fname_dst)
220 return SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
223 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
225 return SMB_VFS_NEXT_FSYNC(handle, fsp);
228 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
230 return SMB_VFS_NEXT_STAT(handle, smb_fname);
233 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
235 return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
238 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
240 return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
243 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
245 return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
248 static int skel_unlink(vfs_handle_struct *handle,
249 const struct smb_filename *smb_fname)
251 return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
254 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
256 return SMB_VFS_NEXT_CHMOD(handle, path, mode);
259 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
261 return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
264 static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
266 return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
269 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
271 return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
274 static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
276 return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
279 static int skel_chdir(vfs_handle_struct *handle, const char *path)
281 return SMB_VFS_NEXT_CHDIR(handle, path);
284 static char *skel_getwd(vfs_handle_struct *handle)
286 return SMB_VFS_NEXT_GETWD(handle);
289 static int skel_ntimes(vfs_handle_struct *handle,
290 const struct smb_filename *smb_fname,
291 struct smb_file_time *ft)
293 return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
296 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
298 return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
301 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
302 enum vfs_fallocate_mode mode,
303 SMB_OFF_T offset,
304 SMB_OFF_T len)
306 return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
309 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
311 return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
314 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode, uint32 access_mask)
316 return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
319 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype)
321 return SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
324 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
326 return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
329 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath)
331 return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
334 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz)
336 return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
339 static int skel_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath)
341 return SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
344 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev)
346 return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev);
349 static char *skel_realpath(vfs_handle_struct *handle, const char *path)
351 return SMB_VFS_NEXT_REALPATH(handle, path);
354 static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
355 struct sys_notify_context *ctx, struct notify_entry *e,
356 void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev),
357 void *private_data, void *handle_p)
359 return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback,
360 private_data, handle_p);
363 static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags)
365 return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
368 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
369 const SMB_STRUCT_STAT *sbuf)
371 return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
374 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
375 struct files_struct *fsp,
376 const char *fname,
377 TALLOC_CTX *mem_ctx,
378 unsigned int *num_streams,
379 struct stream_struct **streams)
381 return SMB_VFS_NEXT_STREAMINFO(handle,
382 fsp,
383 fname,
384 mem_ctx,
385 num_streams,
386 streams);
389 static int skel_get_real_filename(struct vfs_handle_struct *handle,
390 const char *path,
391 const char *name,
392 TALLOC_CTX *mem_ctx,
393 char **found_name)
395 return SMB_VFS_NEXT_GET_REAL_FILENAME(handle,
396 path,
397 name,
398 mem_ctx,
399 found_name);
402 static const char *skel_connectpath(struct vfs_handle_struct *handle,
403 const char *filename)
405 return SMB_VFS_NEXT_CONNECTPATH(handle, filename);
408 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
409 struct byte_range_lock *br_lck,
410 struct lock_struct *plock,
411 bool blocking_lock,
412 struct blocking_lock_record *blr)
414 return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle,
415 br_lck,
416 plock,
417 blocking_lock,
418 blr);
421 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
422 struct messaging_context *msg_ctx,
423 struct byte_range_lock *br_lck,
424 const struct lock_struct *plock)
426 return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle,
427 msg_ctx,
428 br_lck,
429 plock);
432 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
433 struct byte_range_lock *br_lck,
434 struct lock_struct *plock,
435 struct blocking_lock_record *blr)
437 return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle,
438 br_lck,
439 plock,
440 blr);
443 static bool skel_strict_lock(struct vfs_handle_struct *handle,
444 struct files_struct *fsp,
445 struct lock_struct *plock)
447 return SMB_VFS_NEXT_STRICT_LOCK(handle,
448 fsp,
449 plock);
452 static void skel_strict_unlock(struct vfs_handle_struct *handle,
453 struct files_struct *fsp,
454 struct lock_struct *plock)
456 SMB_VFS_NEXT_STRICT_UNLOCK(handle,
457 fsp,
458 plock);
461 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
462 const char *mapped_name,
463 enum vfs_translate_direction direction,
464 TALLOC_CTX *mem_ctx,
465 char **pmapped_name)
467 return SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction,
468 mem_ctx, pmapped_name);
471 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
472 uint32 security_info, struct security_descriptor **ppdesc)
474 return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
477 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
478 const char *name, uint32 security_info, struct security_descriptor **ppdesc)
480 return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
483 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
484 uint32 security_info_sent, const struct security_descriptor *psd)
486 return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
489 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode)
491 return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
494 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
496 return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
499 static int skel_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
501 return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p);
504 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)
506 return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p);
509 static int skel_sys_acl_get_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
511 return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p);
514 static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d)
516 return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d);
519 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type)
521 return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type);
524 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
526 return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
529 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset)
531 return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset);
534 static int skel_sys_acl_add_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
536 return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm);
539 static char *skel_sys_acl_to_text(vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen)
541 return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen);
544 static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, int count)
546 return SMB_VFS_NEXT_SYS_ACL_INIT(handle, count);
549 static int skel_sys_acl_create_entry(vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
551 return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry);
554 static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
556 return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype);
559 static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual)
561 return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual);
564 static int skel_sys_acl_set_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
566 return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset);
569 static int skel_sys_acl_valid(vfs_handle_struct *handle, SMB_ACL_T theacl )
571 return SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl);
574 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
576 return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
579 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
581 return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
584 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path)
586 return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
589 static int skel_sys_acl_get_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
591 return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm);
594 static int skel_sys_acl_free_text(vfs_handle_struct *handle, char *text)
596 return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text);
599 static int skel_sys_acl_free_acl(vfs_handle_struct *handle, SMB_ACL_T posix_acl)
601 return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl);
604 static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype)
606 return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype);
609 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
611 return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
614 static ssize_t skel_lgetxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t
615 size)
617 return SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size);
620 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
622 return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
625 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
627 return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
630 static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
632 return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size);
635 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
637 return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
640 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
642 return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
645 static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
647 return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
650 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
652 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
655 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
657 return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags);
660 static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
662 return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags);
665 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
667 return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
670 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
672 return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
675 static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
677 return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
680 static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
682 return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
685 static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
687 return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
690 static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
692 return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
695 static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
697 return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
700 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)
702 return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
705 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
707 return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
710 static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf)
712 return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
715 static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname)
717 return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
720 /* VFS operations structure */
722 struct vfs_fn_pointers skel_transparent_fns = {
723 /* Disk operations */
725 .connect_fn = skel_connect,
726 .disconnect = skel_disconnect,
727 .disk_free = skel_disk_free,
728 .get_quota = skel_get_quota,
729 .set_quota = skel_set_quota,
730 .get_shadow_copy_data = skel_get_shadow_copy_data,
731 .statvfs = skel_statvfs,
732 .fs_capabilities = skel_fs_capabilities,
734 /* Directory operations */
736 .opendir = skel_opendir,
737 .fdopendir = skel_fdopendir,
738 .readdir = skel_readdir,
739 .seekdir = skel_seekdir,
740 .telldir = skel_telldir,
741 .rewind_dir = skel_rewind_dir,
742 .mkdir = skel_mkdir,
743 .rmdir = skel_rmdir,
744 .closedir = skel_closedir,
745 .init_search_op = skel_init_search_op,
747 /* File operations */
749 .open_fn = skel_open,
750 .create_file = skel_create_file,
751 .close_fn = skel_close_fn,
752 .vfs_read = skel_vfs_read,
753 .pread = skel_pread,
754 .write = skel_write,
755 .pwrite = skel_pwrite,
756 .lseek = skel_lseek,
757 .sendfile = skel_sendfile,
758 .recvfile = skel_recvfile,
759 .rename = skel_rename,
760 .fsync = skel_fsync,
761 .stat = skel_stat,
762 .fstat = skel_fstat,
763 .lstat = skel_lstat,
764 .get_alloc_size = skel_get_alloc_size,
765 .unlink = skel_unlink,
766 .chmod = skel_chmod,
767 .fchmod = skel_fchmod,
768 .chown = skel_chown,
769 .fchown = skel_fchown,
770 .lchown = skel_lchown,
771 .chdir = skel_chdir,
772 .getwd = skel_getwd,
773 .ntimes = skel_ntimes,
774 .ftruncate = skel_ftruncate,
775 .fallocate = skel_fallocate,
776 .lock = skel_lock,
777 .kernel_flock = skel_kernel_flock,
778 .linux_setlease = skel_linux_setlease,
779 .getlock = skel_getlock,
780 .symlink = skel_symlink,
781 .vfs_readlink = skel_vfs_readlink,
782 .link = skel_link,
783 .mknod = skel_mknod,
784 .realpath = skel_realpath,
785 .notify_watch = skel_notify_watch,
786 .chflags = skel_chflags,
787 .file_id_create = skel_file_id_create,
789 .streaminfo = skel_streaminfo,
790 .get_real_filename = skel_get_real_filename,
791 .connectpath = skel_connectpath,
792 .brl_lock_windows = skel_brl_lock_windows,
793 .brl_unlock_windows = skel_brl_unlock_windows,
794 .brl_cancel_windows = skel_brl_cancel_windows,
795 .strict_lock = skel_strict_lock,
796 .strict_unlock = skel_strict_unlock,
797 .translate_name = skel_translate_name,
799 /* NT ACL operations. */
801 .fget_nt_acl = skel_fget_nt_acl,
802 .get_nt_acl = skel_get_nt_acl,
803 .fset_nt_acl = skel_fset_nt_acl,
805 /* POSIX ACL operations. */
807 .chmod_acl = skel_chmod_acl,
808 .fchmod_acl = skel_fchmod_acl,
810 .sys_acl_get_entry = skel_sys_acl_get_entry,
811 .sys_acl_get_tag_type = skel_sys_acl_get_tag_type,
812 .sys_acl_get_permset = skel_sys_acl_get_permset,
813 .sys_acl_get_qualifier = skel_sys_acl_get_qualifier,
814 .sys_acl_get_file = skel_sys_acl_get_file,
815 .sys_acl_get_fd = skel_sys_acl_get_fd,
816 .sys_acl_clear_perms = skel_sys_acl_clear_perms,
817 .sys_acl_add_perm = skel_sys_acl_add_perm,
818 .sys_acl_to_text = skel_sys_acl_to_text,
819 .sys_acl_init = skel_sys_acl_init,
820 .sys_acl_create_entry = skel_sys_acl_create_entry,
821 .sys_acl_set_tag_type = skel_sys_acl_set_tag_type,
822 .sys_acl_set_qualifier = skel_sys_acl_set_qualifier,
823 .sys_acl_set_permset = skel_sys_acl_set_permset,
824 .sys_acl_valid = skel_sys_acl_valid,
825 .sys_acl_set_file = skel_sys_acl_set_file,
826 .sys_acl_set_fd = skel_sys_acl_set_fd,
827 .sys_acl_delete_def_file = skel_sys_acl_delete_def_file,
828 .sys_acl_get_perm = skel_sys_acl_get_perm,
829 .sys_acl_free_text = skel_sys_acl_free_text,
830 .sys_acl_free_acl = skel_sys_acl_free_acl,
831 .sys_acl_free_qualifier = skel_sys_acl_free_qualifier,
833 /* EA operations. */
834 .getxattr = skel_getxattr,
835 .lgetxattr = skel_lgetxattr,
836 .fgetxattr = skel_fgetxattr,
837 .listxattr = skel_listxattr,
838 .llistxattr = skel_llistxattr,
839 .flistxattr = skel_flistxattr,
840 .removexattr = skel_removexattr,
841 .lremovexattr = skel_lremovexattr,
842 .fremovexattr = skel_fremovexattr,
843 .setxattr = skel_setxattr,
844 .lsetxattr = skel_lsetxattr,
845 .fsetxattr = skel_fsetxattr,
847 /* aio operations */
848 .aio_read = skel_aio_read,
849 .aio_write = skel_aio_write,
850 .aio_return_fn = skel_aio_return_fn,
851 .aio_cancel = skel_aio_cancel,
852 .aio_error_fn = skel_aio_error_fn,
853 .aio_fsync = skel_aio_fsync,
854 .aio_suspend = skel_aio_suspend,
855 .aio_force = skel_aio_force,
857 /* offline operations */
858 .is_offline = skel_is_offline,
859 .set_offline = skel_set_offline
862 NTSTATUS vfs_skel_transparent_init(void)
864 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", &skel_transparent_fns);