s3-vfs: rename open function to open_fn.
[Samba.git] / examples / VFS / skel_transparent.c
blobf06e02afe5ffc329fd913c9fd308f5d9b158d20c
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_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
89 return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
92 static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
93 SMB_STRUCT_DIR *dirp,
94 SMB_STRUCT_STAT *sbuf)
96 return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
99 static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset)
101 SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
104 static long skel_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
106 return SMB_VFS_NEXT_TELLDIR(handle, dirp);
109 static void skel_rewind_dir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
111 SMB_VFS_NEXT_REWINDDIR(handle, dirp);
114 static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode)
116 return SMB_VFS_NEXT_MKDIR(handle, path, mode);
119 static int skel_rmdir(vfs_handle_struct *handle, const char *path)
121 return SMB_VFS_NEXT_RMDIR(handle, path);
124 static int skel_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dir)
126 return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
129 static void skel_init_search_op(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp)
131 SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
134 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
135 files_struct *fsp, int flags, mode_t mode)
137 return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
140 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
141 struct smb_request *req,
142 uint16_t root_dir_fid,
143 struct smb_filename *smb_fname,
144 uint32_t access_mask,
145 uint32_t share_access,
146 uint32_t create_disposition,
147 uint32_t create_options,
148 uint32_t file_attributes,
149 uint32_t oplock_request,
150 uint64_t allocation_size,
151 uint32_t private_flags,
152 struct security_descriptor *sd,
153 struct ea_list *ea_list,
154 files_struct **result,
155 int *pinfo)
157 return SMB_VFS_NEXT_CREATE_FILE(handle,
158 req,
159 root_dir_fid,
160 smb_fname,
161 access_mask,
162 share_access,
163 create_disposition,
164 create_options,
165 file_attributes,
166 oplock_request,
167 allocation_size,
168 private_flags,
170 ea_list,
171 result,
172 pinfo);
175 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
177 return SMB_VFS_NEXT_CLOSE(handle, fsp);
180 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
182 return SMB_VFS_NEXT_READ(handle, fsp, data, n);
185 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
187 return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
190 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
192 return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
195 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
197 return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
200 static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
202 return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
205 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)
207 return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
210 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
212 return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
215 static int skel_rename(vfs_handle_struct *handle,
216 const struct smb_filename *smb_fname_src,
217 const struct smb_filename *smb_fname_dst)
219 return SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
222 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
224 return SMB_VFS_NEXT_FSYNC(handle, fsp);
227 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
229 return SMB_VFS_NEXT_STAT(handle, smb_fname);
232 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
234 return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
237 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
239 return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
242 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
244 return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
247 static int skel_unlink(vfs_handle_struct *handle,
248 const struct smb_filename *smb_fname)
250 return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
253 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
255 return SMB_VFS_NEXT_CHMOD(handle, path, mode);
258 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
260 return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
263 static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
265 return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
268 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
270 return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
273 static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
275 return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
278 static int skel_chdir(vfs_handle_struct *handle, const char *path)
280 return SMB_VFS_NEXT_CHDIR(handle, path);
283 static char *skel_getwd(vfs_handle_struct *handle, char *buf)
285 return SMB_VFS_NEXT_GETWD(handle, buf);
288 static int skel_ntimes(vfs_handle_struct *handle,
289 const struct smb_filename *smb_fname,
290 struct smb_file_time *ft)
292 return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
295 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
297 return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
300 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
301 enum vfs_fallocate_mode mode,
302 SMB_OFF_T offset,
303 SMB_OFF_T len)
305 return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
308 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
310 return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
313 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode, uint32 access_mask)
315 return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
318 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype)
320 return SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
323 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
325 return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
328 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath)
330 return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
333 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz)
335 return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
338 static int skel_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath)
340 return SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
343 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev)
345 return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev);
348 static char *skel_realpath(vfs_handle_struct *handle, const char *path)
350 return SMB_VFS_NEXT_REALPATH(handle, path);
353 static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
354 struct sys_notify_context *ctx, struct notify_entry *e,
355 void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev),
356 void *private_data, void *handle_p)
358 return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback,
359 private_data, handle_p);
362 static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags)
364 return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
367 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
368 const SMB_STRUCT_STAT *sbuf)
370 return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
373 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
374 struct files_struct *fsp,
375 const char *fname,
376 TALLOC_CTX *mem_ctx,
377 unsigned int *num_streams,
378 struct stream_struct **streams)
380 return SMB_VFS_NEXT_STREAMINFO(handle,
381 fsp,
382 fname,
383 mem_ctx,
384 num_streams,
385 streams);
388 static int skel_get_real_filename(struct vfs_handle_struct *handle,
389 const char *path,
390 const char *name,
391 TALLOC_CTX *mem_ctx,
392 char **found_name)
394 return SMB_VFS_NEXT_GET_REAL_FILENAME(handle,
395 path,
396 name,
397 mem_ctx,
398 found_name);
401 static const char *skel_connectpath(struct vfs_handle_struct *handle,
402 const char *filename)
404 return SMB_VFS_NEXT_CONNECTPATH(handle, filename);
407 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
408 struct byte_range_lock *br_lck,
409 struct lock_struct *plock,
410 bool blocking_lock,
411 struct blocking_lock_record *blr)
413 return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle,
414 br_lck,
415 plock,
416 blocking_lock,
417 blr);
420 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
421 struct messaging_context *msg_ctx,
422 struct byte_range_lock *br_lck,
423 const struct lock_struct *plock)
425 return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle,
426 msg_ctx,
427 br_lck,
428 plock);
431 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
432 struct byte_range_lock *br_lck,
433 struct lock_struct *plock,
434 struct blocking_lock_record *blr)
436 return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle,
437 br_lck,
438 plock,
439 blr);
442 static bool skel_strict_lock(struct vfs_handle_struct *handle,
443 struct files_struct *fsp,
444 struct lock_struct *plock)
446 return SMB_VFS_NEXT_STRICT_LOCK(handle,
447 fsp,
448 plock);
451 static void skel_strict_unlock(struct vfs_handle_struct *handle,
452 struct files_struct *fsp,
453 struct lock_struct *plock)
455 SMB_VFS_NEXT_STRICT_UNLOCK(handle,
456 fsp,
457 plock);
460 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
461 const char *mapped_name,
462 enum vfs_translate_direction direction,
463 TALLOC_CTX *mem_ctx,
464 char **pmapped_name)
466 return SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction,
467 mem_ctx, pmapped_name);
470 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
471 uint32 security_info, struct security_descriptor **ppdesc)
473 return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
476 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
477 const char *name, uint32 security_info, struct security_descriptor **ppdesc)
479 return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
482 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
483 uint32 security_info_sent, const struct security_descriptor *psd)
485 return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
488 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode)
490 return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
493 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
495 return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
498 static int skel_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
500 return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p);
503 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)
505 return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p);
508 static int skel_sys_acl_get_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
510 return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p);
513 static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d)
515 return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d);
518 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type)
520 return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type);
523 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
525 return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
528 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset)
530 return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset);
533 static int skel_sys_acl_add_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
535 return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm);
538 static char *skel_sys_acl_to_text(vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen)
540 return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen);
543 static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, int count)
545 return SMB_VFS_NEXT_SYS_ACL_INIT(handle, count);
548 static int skel_sys_acl_create_entry(vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
550 return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry);
553 static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
555 return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype);
558 static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual)
560 return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual);
563 static int skel_sys_acl_set_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
565 return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset);
568 static int skel_sys_acl_valid(vfs_handle_struct *handle, SMB_ACL_T theacl )
570 return SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl);
573 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
575 return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
578 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
580 return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
583 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path)
585 return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
588 static int skel_sys_acl_get_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
590 return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm);
593 static int skel_sys_acl_free_text(vfs_handle_struct *handle, char *text)
595 return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text);
598 static int skel_sys_acl_free_acl(vfs_handle_struct *handle, SMB_ACL_T posix_acl)
600 return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl);
603 static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype)
605 return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype);
608 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
610 return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
613 static ssize_t skel_lgetxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t
614 size)
616 return SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size);
619 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
621 return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
624 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
626 return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
629 static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
631 return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size);
634 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
636 return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
639 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
641 return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
644 static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
646 return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
649 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
651 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
654 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
656 return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags);
659 static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
661 return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags);
664 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
666 return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
669 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
671 return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
674 static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
676 return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
679 static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
681 return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
684 static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
686 return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
689 static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
691 return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
694 static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
696 return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
699 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)
701 return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
704 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
706 return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
709 static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf)
711 return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
714 static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname)
716 return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
719 /* VFS operations structure */
721 struct vfs_fn_pointers skel_transparent_fns = {
722 /* Disk operations */
724 .connect_fn = skel_connect,
725 .disconnect = skel_disconnect,
726 .disk_free = skel_disk_free,
727 .get_quota = skel_get_quota,
728 .set_quota = skel_set_quota,
729 .get_shadow_copy_data = skel_get_shadow_copy_data,
730 .statvfs = skel_statvfs,
731 .fs_capabilities = skel_fs_capabilities,
733 /* Directory operations */
735 .opendir = skel_opendir,
736 .fdopendir = skel_fdopendir,
737 .readdir = skel_readdir,
738 .seekdir = skel_seekdir,
739 .telldir = skel_telldir,
740 .rewind_dir = skel_rewind_dir,
741 .mkdir = skel_mkdir,
742 .rmdir = skel_rmdir,
743 .closedir = skel_closedir,
744 .init_search_op = skel_init_search_op,
746 /* File operations */
748 .open_fn = skel_open,
749 .create_file = skel_create_file,
750 .close_fn = skel_close_fn,
751 .vfs_read = skel_vfs_read,
752 .pread = skel_pread,
753 .write = skel_write,
754 .pwrite = skel_pwrite,
755 .lseek = skel_lseek,
756 .sendfile = skel_sendfile,
757 .recvfile = skel_recvfile,
758 .rename = skel_rename,
759 .fsync = skel_fsync,
760 .stat = skel_stat,
761 .fstat = skel_fstat,
762 .lstat = skel_lstat,
763 .get_alloc_size = skel_get_alloc_size,
764 .unlink = skel_unlink,
765 .chmod = skel_chmod,
766 .fchmod = skel_fchmod,
767 .chown = skel_chown,
768 .fchown = skel_fchown,
769 .lchown = skel_lchown,
770 .chdir = skel_chdir,
771 .getwd = skel_getwd,
772 .ntimes = skel_ntimes,
773 .ftruncate = skel_ftruncate,
774 .fallocate = skel_fallocate,
775 .lock = skel_lock,
776 .kernel_flock = skel_kernel_flock,
777 .linux_setlease = skel_linux_setlease,
778 .getlock = skel_getlock,
779 .symlink = skel_symlink,
780 .vfs_readlink = skel_vfs_readlink,
781 .link = skel_link,
782 .mknod = skel_mknod,
783 .realpath = skel_realpath,
784 .notify_watch = skel_notify_watch,
785 .chflags = skel_chflags,
786 .file_id_create = skel_file_id_create,
788 .streaminfo = skel_streaminfo,
789 .get_real_filename = skel_get_real_filename,
790 .connectpath = skel_connectpath,
791 .brl_lock_windows = skel_brl_lock_windows,
792 .brl_unlock_windows = skel_brl_unlock_windows,
793 .brl_cancel_windows = skel_brl_cancel_windows,
794 .strict_lock = skel_strict_lock,
795 .strict_unlock = skel_strict_unlock,
796 .translate_name = skel_translate_name,
798 /* NT ACL operations. */
800 .fget_nt_acl = skel_fget_nt_acl,
801 .get_nt_acl = skel_get_nt_acl,
802 .fset_nt_acl = skel_fset_nt_acl,
804 /* POSIX ACL operations. */
806 .chmod_acl = skel_chmod_acl,
807 .fchmod_acl = skel_fchmod_acl,
809 .sys_acl_get_entry = skel_sys_acl_get_entry,
810 .sys_acl_get_tag_type = skel_sys_acl_get_tag_type,
811 .sys_acl_get_permset = skel_sys_acl_get_permset,
812 .sys_acl_get_qualifier = skel_sys_acl_get_qualifier,
813 .sys_acl_get_file = skel_sys_acl_get_file,
814 .sys_acl_get_fd = skel_sys_acl_get_fd,
815 .sys_acl_clear_perms = skel_sys_acl_clear_perms,
816 .sys_acl_add_perm = skel_sys_acl_add_perm,
817 .sys_acl_to_text = skel_sys_acl_to_text,
818 .sys_acl_init = skel_sys_acl_init,
819 .sys_acl_create_entry = skel_sys_acl_create_entry,
820 .sys_acl_set_tag_type = skel_sys_acl_set_tag_type,
821 .sys_acl_set_qualifier = skel_sys_acl_set_qualifier,
822 .sys_acl_set_permset = skel_sys_acl_set_permset,
823 .sys_acl_valid = skel_sys_acl_valid,
824 .sys_acl_set_file = skel_sys_acl_set_file,
825 .sys_acl_set_fd = skel_sys_acl_set_fd,
826 .sys_acl_delete_def_file = skel_sys_acl_delete_def_file,
827 .sys_acl_get_perm = skel_sys_acl_get_perm,
828 .sys_acl_free_text = skel_sys_acl_free_text,
829 .sys_acl_free_acl = skel_sys_acl_free_acl,
830 .sys_acl_free_qualifier = skel_sys_acl_free_qualifier,
832 /* EA operations. */
833 .getxattr = skel_getxattr,
834 .lgetxattr = skel_lgetxattr,
835 .fgetxattr = skel_fgetxattr,
836 .listxattr = skel_listxattr,
837 .llistxattr = skel_llistxattr,
838 .flistxattr = skel_flistxattr,
839 .removexattr = skel_removexattr,
840 .lremovexattr = skel_lremovexattr,
841 .fremovexattr = skel_fremovexattr,
842 .setxattr = skel_setxattr,
843 .lsetxattr = skel_lsetxattr,
844 .fsetxattr = skel_fsetxattr,
846 /* aio operations */
847 .aio_read = skel_aio_read,
848 .aio_write = skel_aio_write,
849 .aio_return_fn = skel_aio_return_fn,
850 .aio_cancel = skel_aio_cancel,
851 .aio_error_fn = skel_aio_error_fn,
852 .aio_fsync = skel_aio_fsync,
853 .aio_suspend = skel_aio_suspend,
854 .aio_force = skel_aio_force,
856 /* offline operations */
857 .is_offline = skel_is_offline,
858 .set_offline = skel_set_offline
861 NTSTATUS vfs_skel_transparent_init(void)
863 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", &skel_transparent_fns);