summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-09-11 14:37:31 -0700
committerRalph Boehme <slow@samba.org>2019-09-26 17:20:44 +0000
commitc58692cee919259edc4b95009925d516384bbc6a (patch)
tree6e7a447cb54a7a015e3a53c0f31e938d34b528d4 /examples
parent24f04c1cc561d9f4b7fada1ca87f52bed2167f8d (diff)
downloadsamba-c58692cee919259edc4b95009925d516384bbc6a.tar.gz
s3: VFS: Add SMB_VFS_UNLINKAT().
Currently identical to SMB_VFS_UNLINK(). Next, add to all VFS modules that implement unlink and eventually remove unlink. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/VFS/skel_opaque.c10
-rw-r--r--examples/VFS/skel_transparent.c12
2 files changed, 22 insertions, 0 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index c03a42fee04..2695b82ab45 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -351,6 +351,15 @@ static int skel_unlink(vfs_handle_struct *handle,
return -1;
}
+static int skel_unlinkat(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ int flags)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
static int skel_chmod(vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
mode_t mode)
@@ -1077,6 +1086,7 @@ static struct vfs_fn_pointers skel_opaque_fns = {
.lstat_fn = skel_lstat,
.get_alloc_size_fn = skel_get_alloc_size,
.unlink_fn = skel_unlink,
+ .unlinkat_fn = skel_unlinkat,
.chmod_fn = skel_chmod,
.fchmod_fn = skel_fchmod,
.chown_fn = skel_chown,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 656c933338a..f760730400b 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -468,6 +468,17 @@ static int skel_unlink(vfs_handle_struct *handle,
return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
}
+static int skel_unlinkat(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ int flags)
+{
+ return SMB_VFS_NEXT_UNLINKAT(handle,
+ dirfsp,
+ smb_fname,
+ flags);
+}
+
static int skel_chmod(vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
mode_t mode)
@@ -1362,6 +1373,7 @@ static struct vfs_fn_pointers skel_transparent_fns = {
.lstat_fn = skel_lstat,
.get_alloc_size_fn = skel_get_alloc_size,
.unlink_fn = skel_unlink,
+ .unlinkat_fn = skel_unlinkat,
.chmod_fn = skel_chmod,
.fchmod_fn = skel_fchmod,
.chown_fn = skel_chown,