summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2019-09-27 11:19:37 +0530
committerRalph Boehme <slow@samba.org>2019-10-08 08:38:32 +0000
commit5084a69de14f24e9d804998580eefcba773fdd5a (patch)
treeb916c4c98de899dbf47e16c87c46e780ea558e5d /examples
parentc9d302f20b066267a8fd2d7ce4dc171161c9c40c (diff)
downloadsamba-5084a69de14f24e9d804998580eefcba773fdd5a.tar.gz
s3: VFS: Add SMB_VFS_FCNTL
Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/VFS/skel_opaque.c8
-rw-r--r--examples/VFS/skel_transparent.c16
2 files changed, 24 insertions, 0 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 59804675c8e..be3773965e7 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -444,6 +444,13 @@ static int skel_kernel_flock(struct vfs_handle_struct *handle,
return -1;
}
+static int skel_fcntl(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, int cmd, va_list cmd_arg)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
static int skel_linux_setlease(struct vfs_handle_struct *handle,
struct files_struct *fsp, int leasetype)
{
@@ -1091,6 +1098,7 @@ static struct vfs_fn_pointers skel_opaque_fns = {
.fallocate_fn = skel_fallocate,
.lock_fn = skel_lock,
.kernel_flock_fn = skel_kernel_flock,
+ .fcntl_fn = skel_fcntl,
.linux_setlease_fn = skel_linux_setlease,
.getlock_fn = skel_getlock,
.symlinkat_fn = skel_symlinkat,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index c73c2a2692b..063af8f3aed 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -552,6 +552,21 @@ static int skel_kernel_flock(struct vfs_handle_struct *handle,
return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
}
+static int skel_fcntl(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, int cmd, va_list cmd_arg)
+{
+ void *arg;
+ va_list dup_cmd_arg;
+ int result;
+
+ va_copy(dup_cmd_arg, cmd_arg);
+ arg = va_arg(dup_cmd_arg, void *);
+ result = SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, arg);
+ va_end(dup_cmd_arg);
+
+ return result;
+}
+
static int skel_linux_setlease(struct vfs_handle_struct *handle,
struct files_struct *fsp, int leasetype)
{
@@ -1379,6 +1394,7 @@ static struct vfs_fn_pointers skel_transparent_fns = {
.fallocate_fn = skel_fallocate,
.lock_fn = skel_lock,
.kernel_flock_fn = skel_kernel_flock,
+ .fcntl_fn = skel_fcntl,
.linux_setlease_fn = skel_linux_setlease,
.getlock_fn = skel_getlock,
.symlinkat_fn = skel_symlinkat,