summaryrefslogtreecommitdiff
path: root/examples/VFS
Commit message (Collapse)AuthorAgeFilesLines
* VFS examples: remove init_search_opsUri Simchoni2017-11-112-12/+0
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/vfs: rename SMB_VFS_STRICT_LOCK to SMB_VFS_STRICT_LOCK_CHECKRalph Boehme2017-07-112-9/+9
| | | | | | | | | | | | | As per MS-SMB2 and MS-FSA and our SMB_VFS_STRICT_LOCK implementation, we're merely testing for locks, not setting any. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12887 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jul 11 03:37:44 CEST 2017 on sn-devel-144
* s3/vfs: remove SMB_VFS_STRICT_UNLOCKRalph Boehme2017-07-102-16/+0
| | | | | | | | | | It's just a noop, so let's remove it. SMB_VFS_STRICT_LOCK doesn't set logs, it just checks for the presence of incompatible locks. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12887 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/smbd: remove unneeded flags argument from SMB_VFS_OFFLOAD_WRITE_SENDRalph Boehme2017-07-032-5/+3
| | | | | | | | | | | | ...and instead use the fsctl to infer required behaviour in the VFS backends. Note that this removes the check from vfs_default because there we only handle FSCTL_SRV_COPYCHUNK(_WRITE) and must always perform the lock checks. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3/vfs: make SMB_VFS_OFFLOAD_WRITE_SEND offload token basedRalph Boehme2017-07-032-5/+7
| | | | | | | | | | | | | Remove the source fsp argument and instead pass the offload token generated with SMB_VFS_OFFLOAD_READ_SEND/RECV. An actual offload fsctl is not implemented yet, neither in the VFS nor at the SMB ioctl layer, and returns NT_STATUS_NOT_IMPLEMENTED With these changes we now pass the copy-chunk-across-shares test. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3/vfs: rename SMB_VFS_COPY_CHUNK_SEND/RECV to SMB_VFS_OFFLOAD_WRITE_SEND/RECVRalph Boehme2017-07-032-23/+23
| | | | | | | | | No change in behaviour, just a rename in preperation of more changes to SMB_VFS_OFFLOAD_WRITE_SEND. It helps keeping the diff of the actual changes smaller. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3/vfs: add SMB_VFS_OFFLOAD_READ_SEND/RECVRalph Boehme2017-07-032-0/+134
| | | | | | | | | | | | | | | | | | Add SMB_VFS_OFFLOAD_READ_SEND an SMB_VFS_OFFLOAD_READ_RECV. This paves the way for supporting server-side copy-chunk with source and destination file-handles on different shares. It can be used to implement copy offload fsctl in the future, but for now this will be used as a mere copy-chunk replacement. SMB_VFS_OFFLOAD_READ generates a token that associates an fsp with the token and stores the fsp in a in-memory db. Initially only a copy-chunk resume key fsctl is supported. In the future this can be enhanced to support real offload fsctl. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: VFS: Change SMB_VFS_CONNECTPATH to take const struct smb_filename * ↵Jeremy Allison2017-07-012-3/+3
| | | | | | | | | | | | | instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jul 1 07:20:28 CEST 2017 on sn-devel-144
* s3: VFS: Change SMB_VFS_REALPATH to take and return struct smb_filename * ↵Jeremy Allison2017-07-012-3/+7
| | | | | | | | | | instead of char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_GETWD to return struct smb_filename * instead of char *.Jeremy Allison2017-07-012-3/+5
| | | | | | | | We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_CHDIR to use const struct smb_filename * instead of ↵Jeremy Allison2017-07-012-3/+5
| | | | | | | | | | const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_SYMLINK to use const struct smb_filename * instead ↵Jeremy Allison2017-06-182-5/+7
| | | | | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Jun 18 07:03:18 CEST 2017 on sn-devel-144
* s3: VFS: Change SMB_VFS_READLINK to use const struct smb_filename * instead ↵Jeremy Allison2017-06-182-5/+9
| | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_STATVFS to use const struct smb_filename * instead ↵Jeremy Allison2017-06-182-3/+5
| | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_LINK to use const struct smb_filename * instead of ↵Jeremy Allison2017-06-182-5/+7
| | | | | | | | | | const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_GET_QUOTA to use const struct smb_filename * instead ↵Jeremy Allison2017-06-182-7/+11
| | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_DISK_FREE to use const struct smb_filename * instead ↵Jeremy Allison2017-06-182-7/+11
| | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_CHFLAGS to use const struct smb_filename * instead ↵Jeremy Allison2017-06-182-3/+5
| | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_MKNOD to use const struct smb_filename * instead of ↵Jeremy Allison2017-06-182-5/+9
| | | | | | | | | | const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_GETXATTR to use const struct smb_filename * instead ↵Jeremy Allison2017-06-012-5/+11
| | | | | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jun 1 02:58:53 CEST 2017 on sn-devel-144
* s3: VFS: Change SMB_VFS_SETXATTR to use const struct smb_filename * instead ↵Jeremy Allison2017-05-312-7/+14
| | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Change SMB_VFS_REMOVEXATTR to use const struct smb_filename * ↵Jeremy Allison2017-05-312-5/+7
| | | | | | | | | | instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Change SMB_VFS_LISTXATTR to use const struct smb_filename * instead ↵Jeremy Allison2017-05-312-5/+9
| | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Change SMB_VFS_SYS_ACL_SET_FILE to use const struct smb_filename * ↵Jeremy Allison2017-05-312-5/+10
| | | | | | | | | | instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Change SMB_VFS_SYS_ACL_BLOB_GET_FILE to use const struct ↵Jeremy Allison2017-05-312-5/+9
| | | | | | | | | | smb_filename * instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Change SMB_VFS_SYS_ACL_GET_FILE to use const struct smb_filename * ↵Jeremy Allison2017-05-312-3/+3
| | | | | | | | | | | | instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Requires a few extra cleanups in calling code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Change SMB_VFS_SYS_ACL_DELETE_DEF_FILE to use const struct ↵Jeremy Allison2017-05-312-3/+3
| | | | | | | | | | smb_filename * instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* vfs: add parameter to copy chunk VFS function to handle dup_extentsAurelien Aptel2017-05-102-3/+5
| | | | | | | | | FSCTL_DUPLICATE_EXTENTS_TO_FILE must be handled as a COW clone. Add a copy-chunk flags parameter to the VFS to handle this. Signed-off-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* lib: modules: Change XXX_init interface from XXX_init(void) to ↵Jeremy Allison2017-04-223-3/+3
| | | | | | | | | | | | | | | | | | | | XXX_init(TALLOC_CTX *) Not currently used - no logic changes inside. This will make it possible to pass down a long-lived talloc context from the loading function for modules to use instead of having them internally all use talloc_autofree_context() which is a hidden global. Updated all known module interface numbers, and added a WHATSNEW. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
* s3/vfs: remove now unused is_offline/set_offline VFS functionsRalph Boehme2016-10-112-36/+0
| | | | | | | | | | The previous commit removed all callers of this, so lets remove it. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Oct 11 14:44:03 CEST 2016 on sn-devel-144
* s3: vfs: Add VFS functions for setting and getting DOS attributes.Richard Sharpe2016-03-272-0/+76
| | | | | | | | | This will make it easier to support those systems and file systems that can store DOS attributes. It should retain the original functionality if VFS functions providing these things are not provided. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: smbd: Change open_streams_for_delete() to take a struct smb_filename *.Jeremy Allison2016-03-072-4/+7
| | | | | | | | | | Prepare for changing vfs_streaminfo to do the same. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Mar 7 21:12:56 CET 2016 on sn-devel-144
* VFS: Modify lchown to take a const struct smb_filename * instead of const char *Jeremy Allison2016-03-052-5/+9
| | | | | | | Preparing to reduce use of lp_posix_pathnames(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* VFS: Modify chown to take a const struct smb_filename * instead of const char *Jeremy Allison2016-03-052-5/+9
| | | | | | | Preparing to reduce use of lp_posix_pathnames(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* VFS: Modify chmod_acl to take a const struct smb_filename * instead of const ↵Jeremy Allison2016-03-032-5/+7
| | | | | | | | | char * Preparing to reduce use of lp_posix_pathnames(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* VFS: Modify chmod to take a const struct smb_filename * instead of const char *Jeremy Allison2016-03-032-3/+7
| | | | | | | Preparing to reduce use of lp_posix_pathnames(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3/vfs: wrap async io function args inside struct vfs_aio_stateRalph Boehme2016-03-022-21/+27
| | | | | | | | Subsequent commits that are going to track aio request duration in the aio backends will use this. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* VFS: Modify opendir to take a const struct smb_filename * instead of const ↵Jeremy Allison2016-03-012-5/+9
| | | | | | | | | | | | | char * Preparing to reduce use of lp_posix_pathnames(). Uses the same techniques as commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8 (synthetic_smb_fname()) to cope with modules that modify the incoming pathname. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* VFS: Modify rmdir to take a const struct smb_filename * instead of const char *Jeremy Allison2016-02-252-3/+5
| | | | | | | | | | | | | | Preparing to reduce use of lp_posix_pathnames(). Uses the same techniques as commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8 (synthetic_smb_fname()) to cope with modules that modify the incoming pathname. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Feb 25 20:46:49 CET 2016 on sn-devel-144
* s3: VFS: Modify mkdir to take a const struct smb_filename * instead of const ↵Jeremy Allison2016-02-242-3/+7
| | | | | | | | | | | | | | | | char * Preparing to reduce use of lp_posix_pathnames(). Uses the same techniques as commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8 (synthetic_smb_fname()) to cope with modules that modify the incoming pathname. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Wed Feb 24 16:05:55 CET 2016 on sn-devel-144
* s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const struct smb_filename * ↵Jeremy Allison2016-02-162-4/+9
| | | | | | | | | | | | | | | | | | | | | | | instead of const char * Bumps VFS version to 35. Preparing to reduce use of lp_posix_pathnames(). Most of this is boilerplate, the only subtleties are in the modules: vfs_catia.c vfs_media_harmony.c vfs_shadow_copy2.c vfs_unityed_media.c Where the path is modified then passed to SMB_VFS_NEXT_GET_NT_ACL(). In these cases the change uses synthetic_smb_fname() to create a new struct smb_filename from the modified path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <rb@sernet.de>
* vfs: add path parameter to get_quotaUri Simchoni2016-01-262-5/+7
| | | | | | | | | Adding a path parameter would allow the VFS get_quota function to be used for determining the quota/usage when calculating size and free spacei. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* examples/VFS: make function prototypes available via static_decl_vfs;Stefan Metzmacher2015-08-203-0/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: Remove SMB_VFS_NOTIFY_WATCHVolker Lendecke2015-07-072-30/+0
| | | | | | | No longer needed Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Convert all uint32/16/8 to _t in a grab-bag of remaining files.Richard Sharpe2015-05-143-15/+15
| | | | | | | | | | I still need to fix the rpc stuff, but we are almost there. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 14 22:16:56 CEST 2015 on sn-devel-104
* vfs: add snapshot create/delete hooksDavid Disseldorp2015-03-312-0/+62
| | | | | | | | | | | | | | | | | | | | | | | This change adds three new VFS hooks covering snapshot manipulation: - snap_check_path Check whether a path supports snapshots. - snap_create Request the creation of a snapshot of the provided path. - snap_delete Request the deletion of a snapshot. These VFS call-outs will be used in future by Samba's File Server Remote VSS Protocol (FSRVP) server. MS-FSVRP states: At any given time, Windows servers allow only one shadow copy set to be going through the creation process. Therefore, only provide synchronous hooks for now, which can be converted to asynchronous _send/_recv functions when the corresponding DCE/RPC server infrastructure is in place. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/vfs: change fallocate mode flags from enum->uint32_tDavid Disseldorp2015-03-092-2/+2
| | | | | | | | | | | | | | | | | | | | The Linux fallocate syscall offers a mode parameter which can take the following flags: FALLOC_FL_KEEP_SIZE FALLOC_FL_PUNCH_HOLE (since 2.6.38) FALLOC_FL_COLLAPSE_RANGE (since 3.15) FALLOC_FL_ZERO_RANGE (since 3.14) The flags are not exclusive, e.g. FALLOC_FL_PUNCH_HOLE must be specified alongside FALLOC_FL_KEEP_SIZE. Samba currently takes a vfs_fallocate_mode enum parameter for the VFS fallocate hook, taking either an EXTEND_SIZE or KEEP_SIZE value. This commit changes the fallocate hook such that it accepts a uint32_t flags parameter, in preparation for PUNCH_HOLE and ZERO_RANGE support. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/vfs: remove unused SMB_VFS_DISK_FREE() small_query parameterDavid Disseldorp2015-02-172-4/+3
| | | | | | | | | | | | | | | The small_query parameter for SMB_VFS_DISK_FREE() was, prior to the previous commit, used to obtain 16-bit wide free-space information for the deprecated dskattr SMB_COM_QUERY_INFORMATION_DISK command. With the dskattr handler now performing the 16-bit collapse directly, the small_query parameter can be removed from the entire code path. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Feb 17 05:37:20 CET 2015 on sn-devel-104
* s3:vfs: add create tags to SMB_VFS_CREATEFILERalph Boehme2014-12-042-3/+8
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:vfs: add SMB_VFS_READDIR_ATTR()Ralph Boehme2014-12-042-0/+18
| | | | | | | | | | | | SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata for a directory entry when we're already marshalling the SMB reply buffer. This would be used, when there's a need to repurpose some fields in the the reply, like it's done with Apple's SMB2 extension "AAPL". Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>