summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_default.c
AgeCommit message (Collapse)AuthorFilesLines
2010-12-03Replace lseek()/write()/lseek() triple with pwrite call. We already emulate thisJeremy Allison1-12/+2
inside pwrite under the covers. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Dec 3 03:39:42 CET 2010 on sn-devel-104
2010-12-03Merge the two conflicting allocation codes into one function, ↵Jeremy Allison1-22/+4
vfs_slow_fallocate() and use that from both the truncate and fill_sparse functions. Jeremy.
2010-12-03Oops. Missed adding vfswrap_posix_fallocate to vfs_default_fns table.Jeremy Allison1-0/+1
Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Dec 3 02:26:23 CET 2010 on sn-devel-104
2010-12-02Move posix_fallocate into the VFS where it belongs.Jeremy Allison1-2/+15
Jeremy.
2010-12-01s3: Fix a typoVolker Lendecke1-1/+1
2010-11-20Move the uglyness of #ifdef REALPATH_TAKES_NULL into the vfs_defaultJeremy Allison1-2/+15
module, change the signature of VFS_REALPATH to always return a malloc'ed string. Needed to make some privileges work I plan on doing shortly easier to code. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Nov 20 02:15:50 CET 2010 on sn-devel-104
2010-10-28s3: Fix bug 7759Volodymyr Khomenko1-16/+18
2010-10-15Fix bug #7734 - When creating files with "inherit ACLs" set to true, we ↵Jeremy Allison1-1/+1
neglect to apply appropriate create masks. Jeremy.
2010-05-18s3-secdesc: remove "typedef struct security_descriptor SEC_DESC".Günther Deschner1-3/+5
Guenther
2010-03-08s3: remove cross-device rename support from vfs_defaultBjörn Jacke1-116/+0
cross-device rename support has some major limitations: - on huge files clients will timeout or hang - ACLs and EA information is not retained Usually a client will have to handle this. A Windows Server with a reparse point will also just return NT_STATUS_NOT_SAME_DEVICE. We will now by default do the same. I will add a vfs module which will restore the old cross-device renames.
2010-03-05Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.Jeremy Allison1-1/+3
Ensure we don't use any of the create_options for Samba private use. Add a new parameter to the VFS_CREATE call (private_flags) which is only used internally. Renumber NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to match the S4 code). Rev. the VFS interface to version 28. Jeremy.
2009-12-09s3: keep subsecond times on cross-filesystem moves and don't follow linksBjörn Jacke1-0/+22
2009-12-08s3: make sys_posix_fallocate more genericBjörn Jacke1-14/+11
this is in preparation for other preallocation methods to be introduced.
2009-12-08s3: allocate only "new" space, not "old" sparse space in the posix_fallocate ↵Björn Jacke1-2/+3
path this makes the posix_fallocate path work analogous to the manual allocate path.
2009-12-03ѕ3: remove superfluous option checkBjörn Jacke1-13/+10
this function is only called when strict alloc is set, no reason to check that twice.
2009-12-02s3: prefer posix_fallocate for doing "strict allocate"Björn Jacke1-4/+21
posix_fallocate is more efficient than manual zero'ing the file. When preallocation in kernel space is supported it's extremely fast. Support for preallocation at fs layer via posix_fallocate and fallocate at kernel site can be found in Linux kernel 2.6.23/glibc 2.10 with ext4, XFS and OCFS2. Other systems that I know of which support fast preallocation in kernel space are AIX 6.1 with JFS2 and recent Solaris versions with ZFS maybe UFS2, too. People who have a system with preallocation in kernel space might want to set "strict allocate = yes". This reduces file fragentation and it's also safer for setups with quota being turned on. As of today most systems still don't have preallocation in kernel space, and that's why "strict allocate = no" will stay the default for now.
2009-11-29s3: Restore "fake directory create times" as a share parameterVolker Lendecke1-3/+3
2009-11-29s3: "copy_reg" only looks at mode, uid, gid, atime and mtime (no birthtime)Volker Lendecke1-2/+1
2009-11-29s3: Pass the "fake dir create times" parameter to sys_*statVolker Lendecke1-4/+8
Step 0 to restore it as a per-share paramter
2009-11-18s3: Replace some create_synthetic_smb_fname() callsVolker Lendecke1-11/+7
In very hot codepaths like the statcache copy_smb_filename and the subsequent recursive talloc_free is noticable in the CPU load.
2009-11-18s3: Do not talloc in readdirVolker Lendecke1-9/+7
This is a hot codepath (called from the stat cache)
2009-11-17Remove "store create time" code, cause create time to be storedJeremy Allison1-3/+1
in the "user.DOSATTRIB" EA. From the docs: In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store the create time for a file as well as the DOS attributes. This is done in a backwards compatible way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this extended attribute by earlier versions of Samba, but they will not be able to read the create time stored there. Storing the create time separately from the normal filesystem meta-data allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem. Passes make test but will need more testing. Jeremy.
2009-11-11s3:vfs_fs_capabilities: fix a debug messageMichael Adam1-1/+1
Michael
2009-11-04s3: add support for full windows timestamps resolution on filesBjörn Jacke1-6/+13
setting nanosecond timestamps using utimensat() was first supported by Linux kernel 2.6.22 and glibc 2.6. It's specified in POSIX.1-2008. This effectively makes us use Windows' full 100ns timestamp resolution - actually just an improvement from 10^-6 to 10^-7. For now Linux CIFS vfs will also just be able to make use of 100ns resolution, not 1ns.
2009-10-06s3: Add access_mask to the flock VFS callAbhidnya P Chirmule1-2/+2
2009-10-01Fix bug #6769 - symlink unlink does nothing.Jeremy Allison1-1/+5
Always use LSTAT for POSIX pathnames. Jeremy.
2009-09-24s3:vfs_default - correct function parametersMatthias Dieter Wallnöfer1-1/+2
2009-09-09Fix compile in a usually non-selected define.Jeremy Allison1-1/+1
Jeremy.
2009-08-28s3: Add a new VFS op called SMB_VFS_TRANSLATE_NAMEAravind Srinivasan1-0/+11
This vop is designed to work in tandem with SMB_VFS_READDIR to allow vfs modules to make modifications to arbitrary filenames before they're consumed by callers. Subsequently the core directory enumeration code in smbd is now changed to free the memory that may be allocated in a module. This vop enables the new version of catia in the following patch. Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-08-24Second attempt at fix for bug 6529 - Offline files conflict with Vista and ↵Jeremy Allison1-12/+68
Office 2003. Confirmation from reporter that this fixes the issue in master on ext3/ext4. Back-ports to follow. Jeremy.
2009-08-12Add "store create time" parameter (docs to follow)Jeremy Allison1-0/+9
that stores the create time in the user.DosTimestamps EA. Jeremy.
2009-08-07Move the checks for null timestamps down below the VFS_NTIMESJeremy Allison1-0/+15
layer (as it's done in onefs). This simplifies greatly the code in smb_set_file_time() w.r.t. changenotify messages. Jeremy.
2009-07-24Make the smbd VFS typesafeVolker Lendecke1-244/+121
2009-07-21s3: Remove unnecessary callers of get_full_smb_filenameTim Prouty1-40/+18
This often times means explicitly denying certain operations on a stream as they are not supported or don't make sense at a particular level. At some point in the future these can be enabled, but for now it's better to remove ambiguity
2009-07-20s3: Finish plumbing the fsp->fsp_name smb_fname conversion through the modules.Tim Prouty1-1/+3
2009-07-19Fix a few type errors in VFS modulesVolker Lendecke1-2/+3
2009-07-06s3: Update streaminfo implementations now that only base names are passed ↵Tim Prouty1-1/+11
through the vfs
2009-07-06s3: Plumb smb_filename through SMB_VFS_NTIMESTim Prouty1-6/+14
2009-07-06s3: Plumb smb_filename through SMB_VFS_UNLINKTim Prouty1-5/+12
2009-07-06s3: Plumb smb_filename through SMB_VFS_RENAMETim Prouty1-3/+14
2009-06-24s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty1-5/+33
This patch introduces two new temporary helper functions vfs_stat_smb_fname and vfs_lstat_smb_fname. They basically allowed me to call the new smb_filename version of stat, while avoiding plumbing it through callers that are still too inconvenient. As the conversion moves along, I will be able to remove callers of this, with the goal being to remove all callers. There was also a bug in create_synthetic_smb_fname_split (also a temporary utility function) that caused it to incorrectly handle filenames with ':'s in them when in posix mode. This is now fixed.
2009-06-17s3: Change SMB_VFS_OPEN to take an smb_filename structTim Prouty1-2/+20
This was a little messy because of all of the vfs modules I had to touch. Most of them were pretty straight forward, but the streams modules required a little attention to handle smb_filename. Since the use of smb_filename enables the vfs modules to access the raw, over-the-wire stream, a little bit of the handling that was being done by split_ntfs_stream_name has now been shifted into the individual stream modules. It may be a little more code, but overall it gives more flexibility to the streams modules, while also allowing correct stream handling.
2009-06-12s3: Plumb smb_filename through SMB_VFS_CREATE_FILETim Prouty1-8/+6
2009-06-02Add SMB_VFS_CONNECTPATH operationVolker Lendecke1-0/+8
This is required for the shadow_copy2 module and "wide links = no". The file system snapshots by nature are typically outside of share directory. So the REALPATH result fails the wide links = no test.
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-22/+22
This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
2009-05-18Move down the become_root()/unbecome_root() calls into the VFS modulesVolker Lendecke1-2/+22
The aio_fork module does not need this, as it does not communicate via signals but with pipes. Watching a strace log with those become_root() calls in aio.c is absolutely awful, and it does affect performance.
2009-05-05s3: Fix trans2 path to use case-insensitive stat optimizationtprouty1-2/+6
Often times before creating a file, a client will first query to see if it already exists. Since some systems have a case-insensitive stat that is called from unix_convert, we can definitively return STATUS_NO_SUCH_FILE to the client without scanning the whole directory. This code path is taken from trans2querypathinfo, but trans2findfirst still does a full directory scan even though the get_real_filename (the case-insensitive stat vfs call) can prevent this. This patch adds the get_real_filename call to the trans2find* path, and also changes the vfs_default behavior for SMB_VFS_GET_REAL_FILENAME. Previously, in the absence of a get_real_filename implementation, we would fallback to the full directory scan. The default behavior now returns -1 and sets errno to EOPNOTSUPP. This allows SMB_VFS_GET_REALFILENAME to be called from trans2* and unix_convert.
2009-03-13s3: Don't return in a void funtionTim Prouty1-1/+1
2009-03-13s3: Add strict lock/unlock calls to the vfs layer to replace is_lockedDave Richards1-0/+24
2009-02-19s3: Add extid to the dev/inode pairTim Prouty1-0/+1
This extends the file_id struct to add an additional generic uint64_t field: extid. For backwards compatibility with dev/inodes stored in xattr_tdbs and acl_tdbs, the ext id is ignored for these databases. This patch should cause no functional change on systems that don't use SMB_VFS_FILE_ID_CREATE to set the extid. Existing code that uses the smb_share_mode library will need to be updated to be compatibile with the new extid.