summaryrefslogtreecommitdiffstats
path: root/source3/include/vfs.h
Commit message (Collapse)AuthorAgeFilesLines
* system: add hole punch support to sys_fallocate()David Disseldorp2015-03-091-0/+1
| | | | | | | | If Samba is configured with FALLOC_FL_PUNCH_HOLE support, then allow sys_fallocate() to propogate the flag to syscall invocation. 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-091-8/+8
| | | | | | | | | | | | | | | | | | | | 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: bump interface version number to 33David Disseldorp2015-02-181-1/+2
| | | | | | | | | The SMB_VFS_DISK_FREE() small_query parameter removal cleanup will not be merged for Samba 4.2, so the master SMB_VFS_INTERFACE_VERSION number should be bumped above what's currently present in the 4.2 branch. 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-171-5/+5
| | | | | | | | | | | | | | | 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-041-2/+7
| | | | | 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-041-0/+10
| | | | | | | | | | | | 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>
* s3:vfs.h: add more elements to struct fsp_leaseStefan Metzmacher2014-12-041-0/+2
| | | | | | | | We'll need a reference to the smbd_server_connection as well as a timeout handler. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: Preparation for leases code merge. Ensure VFS is ready for 4.2.0.Jeremy Allison2014-10-101-0/+7
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Oct 10 02:55:53 CEST 2014 on sn-devel-104
* brlock: Do auto-cleanup at conflict timeVolker Lendecke2014-08-231-1/+0
| | | | | | | This avoids the need to do sweeping validate_lock_entries calls Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs3: Pass "lease" through SMB_VFS_CREATE_FILEVolker Lendecke2014-08-111-1/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: remember smbXsrv_connection for each smb_requestStefan Metzmacher2014-08-061-0/+1
| | | | | | | | This prepares the structures for multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Remove unused blocking_lock_record* from VFS_BRL_CANCEL_WINDOWSVolker Lendecke2014-07-041-4/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused blocking_lock_record* from VFS_BRL_LOCK_WINDOWSVolker Lendecke2014-07-041-4/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: add [GET/SET]_COMPRESSION hooksDavid Disseldorp2013-11-221-0/+19
| | | | | | | | | | | | | | | The VFS interfaces are sychronous, as the operations only modify meta-data. These hooks are dependent on support for transparent compression by the underlying filesystem - vfs_default returns INVALID_DEVICE_REQUEST. Support for other filesystems providing transparent comression, such as Btrfs and ZFS, can be added in future. The get_compression function takes fsp and smb_fname arguments. The smb_fname argument is needed due to the current dosmode() code-path. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove the unused fsp->pending_break_messages arrayVolker Lendecke2013-04-261-3/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: s/struct timed_event/struct tevent_timerStefan Metzmacher2013-02-191-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-vfs: add copy_chunk vfs hooksDavid Disseldorp2013-01-161-1/+24
| | | | | | | | | | | | | | | | | | copy_chunk copies n bytes from a source file at a specific offset to a destination file at a given offset. This interface will be used in handling smb2 FSCTL_SRV_COPYCHUNK ioctl requests. Use a pread/pwrite loop in vfs_default, so that requests referring to the same src and dest file are possible. Provide send and receive hooks for copy chunk VFS interface, allowing asynchronous behaviour. Check whether the request source offset + length exceeds the current size. Return STATUS_INVALID_VIEW_SIZE under such a condition, matching Windows server behaviour. Reviewed by: Jeremy Allison <jra@samba.org>
* Add uint32_t share_access to vuid_cache_entry.Jeremy Allison2013-01-091-0/+2
| | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Clean up struct connection_struct, make struct vuid_cache a pointer not inline.Jeremy Allison2013-01-091-2/+6
| | | | | | | | Change VFS ABI to 31 for 4.1.0. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* vfs: Remove type parameter from sys_acl_blob_get_{fd,file}Andrew Bartlett2012-10-111-4/+6
| | | | | | | | | This interface actually needs to match the get_nt_acl interface in that the system ACL implmenetation may not be posix ACLs, and the blob is not meant to be enforced to be of a particular system ACL structure. Andrew Bartlett
* smbd: Add mem_ctx to {f,}get_nt_acl VFS callAndrew Bartlett2012-10-111-0/+4
| | | | | | | | | | | This makes it clear which context the returned SD is allocated on, as a number of callers do not want it on talloc_tos(). As the ACL transformation allocates and then no longer needs a great deal of memory, a talloc_stackframe() call is used to contain the memory that is not returned further up the stack. Andrew Bartlett
* smbd: Add mem_ctx to sys_acl_init() and all callersAndrew Bartlett2012-10-111-4/+11
| | | | | | | | | | This changes from allocation on NULL to allocation on the supplied memory context. Currently that supplied context is talloc_tos() at the the final consumer of the ACL. Andrew Bartlett
* Move cached cwd onto conn struct.Jeremy Allison2012-09-121-0/+2
| | | | | This enables us to make VFS modules safe for use in root called code when we've changed directory under conn->connectpath.
* smbd: Add extra VFS hooks to get the posix ACL as a blobAndrew Bartlett2012-09-121-0/+18
| | | | | | | | | | | This will allow us to hash this, rather than the NT ACL it maps to. This will in turn allow us to know if the NT ACL is valid even if we have to change the mapping code. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Sep 12 07:06:01 CEST 2012 on sn-devel-104
* s3:smbd Bump the smbd vfs interface version to 30Christian Ambach2012-09-101-1/+2
| | | | | | | that is what Samba 4.0.0 will ship with Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Mon Sep 10 19:40:01 CEST 2012 on sn-devel-104
* s3:vfs: add durable VFS operationsMichael Adam2012-09-081-0/+35
| | | | | | This allows a VFS module to implement durable handles in different ways. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
* Add "backup_intent" bool to files_struct.Jeremy Allison2012-09-051-0/+3
| | | | | | Not used right now but I need this in the VFS to implement open for backup/restore later and don't want to break the ABI once 4.0.0 ships.
* s3-smbd: Remove sys_acl_*() VFS wrapper functionsAndrew Bartlett2012-08-151-58/+1
| | | | | | | | | | | | | | | | | | | | | | | We no longer do struct smb_acl_t manipuations via the VFS layer, which is now reduced to handling the get/set functions. The only backend that implemented these functions (aside from audit) was the vfs_default module calling the sys_acl code. The various ACL implementation modules either worked on the fully initilaised smb_acl_t object or on NT ACLs. This not only makes the operation of the posix ACL code more efficient (as allocation and free is not put via the VFS), it makes it easier to test and removes the fantasy that a module could safely redefine this structure or the behaviour here. The smb_acls.idl now defines the structure, and it is now allocated with talloc. These operations were originally added to the VFS in commit 3bb219161a270f12c27c3bc7e1220829c6e9f284. Andrew Bartlett
* s3-smb1: Postpone close_file until all aio is handledVolker Lendecke2012-07-181-0/+9
| | | | | | Thanks to Jeremy for this simple idea Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-vfs: async fsyncVolker Lendecke2012-07-181-0/+12
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-aio: Remove unused VFS functions and moreVolker Lendecke2012-07-181-32/+0
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Make smbd/aio.c not depend on aio.h anymoreVolker Lendecke2012-07-181-0/+6
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Properly handle shutdown with the _send/_recv based aioVolker Lendecke2012-07-181-0/+2
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-vfs: async preadVolker Lendecke2012-07-181-0/+15
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-vfs: async pwriteVolker Lendecke2012-07-181-0/+15
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3:vfs: use smbXsrv_open instead of smbXsrv_open0 in files_structMichael Adam2012-07-031-1/+1
|
* s3:vfs: use smbXsrv_tcon instead of smbXsrv_tcon0 in connection_struct.Michael Adam2012-07-031-1/+1
|
* Add uint64_t mid field to the files_struct.Jeremy Allison2012-06-301-0/+1
| | | | Ensure it is initialized so we know what mid created this file.
* s3:smbd: make use of smbXsrv_open for smb1/2/3Stefan Metzmacher2012-06-291-0/+1
| | | | | | | | | | | | This makes sure we generate unique persistent file ids, which are stored in smbXsrv_open_global.tdb. Pair-Programmed-With: Michael Adam <obnox@samba.org> metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jun 29 21:01:11 CEST 2012 on sn-devel-104
* s3:smbd: make use of smbXsrv_tcon for smb1Stefan Metzmacher2012-06-251-1/+1
| | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
* s3:smbd: make use of smbXsrv_tcon and smbXsrv_session for smb2Stefan Metzmacher2012-06-251-0/+1
| | | | | | | | | The removes the protocol specific smbd_smb2_session and smbd_smb2_tcon. Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
* s3:smbd: remember the request_time on an incoming requestStefan Metzmacher2012-06-151-0/+2
| | | | metze
* s3:vfs: change files_struct.fnum from int to uint64_tMichael Adam2012-06-151-1/+1
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jun 15 05:22:41 CEST 2012 on sn-devel-104
* s3:include: change connection_struct->cnum to uint32_tMichael Adam2012-06-061-1/+1
| | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
* s3:include: change smb_request->tid to uint32_tMichael Adam2012-06-061-1/+1
| | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
* s3:include: change smb_request->vuid to uint64_tStefan Metzmacher2012-06-061-1/+1
| | | | metze
* s3:include: move struct smb_request to vfs.hStefan Metzmacher2012-06-061-0/+61
| | | | metze
* s3:include: change files_struct->vuid to uint64_tStefan Metzmacher2012-06-061-1/+1
| | | | metze
* s3:include: change connection_struct->vuid to uint64_tStefan Metzmacher2012-06-061-1/+1
| | | | metze
* s3:includes: change vuid_cache_entry->vuid to uint64_tStefan Metzmacher2012-06-061-1/+1
| | | | metze