summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_default.c
AgeCommit message (Collapse)AuthorFilesLines
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.
2009-02-19s3: Modify SMB_VFS_FILE_ID_CREATE to take a stat structTim Prouty1-2/+12
Since file_id_create_dev is incompatible with the concept of file_ids, it is now static and in the one file that needs it.
2009-02-13Add VFS ops for Windows BRL: Lock, Unlock and Cancel:Zack Kirsch1-0/+41
This patch adds 3 new VFS OPs for Windows byte range locking: BRL_LOCK_WINDOWS, BRL_UNLOCK_WINDOWS and BRL_CANCEL_WINDOWS. Specifically: * I renamed brl_lock_windows, brl_unlock_windows and brl_lock_cancel to *_default as the default implementations of the VFS ops. * The blocking_lock_record (BLR) is now passed into the brl_lock_windows and brl_cancel_windows paths. The Onefs implementation uses it - future implementations may find it useful too. * Created brl_lock_cancel to do what brl_lock/brl_unlock do: set up a lock_struct and call either the Posix or Windows lock function. These happen to be the same for the default implementation. * Added helper functions: increment_current_lock_count() and decrement_current_lock_count(). * Minor spelling correction in brl_timeout_fn: brl -> blr. * Changed blocking_lock_cancel() to return the BLR that it has cancelled. This allows us to assert its the lock that we wanted to cancel. If this assert ever fires, this path will need to take in the BLR to cancel, rather than choosing on its own. * Adds a small helper function: find_blocking_lock_record_by_id(). Used by the OneFS implementation, but could be useful for others.
2009-02-09s3: OneFS bulk directory enumeration supportSteven Danneman1-2/+1
OneFS provides the bulk directory enumeration syscall readdirplus(). This syscall has the same semantics as the NFSv3 READDIRPLUS command, returning a batch of directory entries with prefetched stat information via one syscall. This commit wraps the readdirplus() call in the existing POSIX readdir/seekdir VFS interface. By default a batch of 128 directory entries are optimistically read from the kernel into a global cache, and fed to iterative calls of VFS_OP_READDIR. The global buffers could be avoided in the future by hanging connection specific buffers off the conn struct. Added new parameter "onefs:use readdirplus" which toggles usage of this code on or off.
2009-02-09s3: Added SMB_VFS_INIT_SEARCH_OP to initialize data at the beginning of SMB ↵Steven Danneman1-0/+9
search requests. By default this VFS call is a NOOP, but the onefs vfs module takes advantage of it to initialize direntry search caches at the beginning of each TRANS2_FIND_FIRST, TRANS2_FIND_NEXT, SMBffirst, SMBsearch, and SMBunique
2009-02-09Add an optional SMB_STRUCT_SMB parameter to VFS_OP_READDIRSteven Danneman1-1/+7
* this allows VFS implementations that prefetch stat information on readdir to return it through one VFS call * backwards compatibility is maintained by passing in NULL * if the system readdir doesn't return stat info, the stat struct is set to invalid
2009-02-03Fix bug #6085 - In vfs_default.c change utime( ) call.Miguel Suarez1-1/+1
2009-01-29s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operationTim Prouty1-1/+36
This allows module implementors to customize what allocation size is returned to the client.
2009-01-23Extend NTIMES to allow setting create_timetodd stecher1-7/+8
1) Add in smb_file_time struct to clarify code and make room for createtime. 2) Get and set create time from SMB messages. 3) Fixup existing VFS modules + examples Some OS'es allow for the setting of the birthtime through kernel interfaces. This value is generically used for Windows createtime, but is not settable in the code today.
2008-12-31Rename parent_dirname_talloc() to parent_dirname()Volker Lendecke1-1/+1
2008-12-31Use parent_dirname_talloc instead of parent_dirname in vfswrap_mkdirVolker Lendecke1-1/+6
2008-12-26Try to fix the build by fixing some typos in the vfs codeKai Blin1-3/+3
2008-12-25Fix bug #5990 - strict allocate should be checked before ftruncateJeremy Allison1-0/+14
reported by and based on a patch by Yasuma Takeda <yasuma@osstech.co.jp>. Jeremy.
2008-12-10Pass the get_real_filename operation through the VFSVolker Lendecke1-0/+12
This is done to help file systems that can tell us about the real upper/lower case combination given a case-insensitive file name. The sample I will soon push is the gpfs module (recent gpfs has a get_real_filename function), others might have a similar function to help alleviate the 1million files in a single directory problem. Jeremy, please comment! Thanks, Volker
2008-12-03s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argumentTim Prouty1-2/+2
This replaces the is_dos_path bool with a more future-proof argument. The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead of overridding the oplock_request.
2008-12-03s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILETim Prouty1-1/+2
Now unix paths can be differentiated from windows paths so the underlying create_file implementations can convert paths correctly.
2008-12-03s3: Add SMB_VFS_CREATE_FILE to the vfs layerTim Prouty1-0/+27
Modify all callers of create_file to go through SMB_VFS_CREATE_FILE
2008-11-01Move sys_realpath() to libreplace.Jelmer Vernooij1-1/+1
2008-11-01Move sys_lchown() to libreplace.Jelmer Vernooij1-1/+1
2008-11-01Move sys_symlink() to libreplace.Jelmer Vernooij1-2/+2