summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_commit.c
AgeCommit message (Collapse)AuthorFilesLines
2026-01-07vfs_commit: Do initial eof calculation on demandVolker Lendecke1-22/+21
Avoid yet another fstat call at open time, we might never write to the file Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-07vfs_commit: Some README.Coding changesVolker Lendecke1-14/+19
Reduce indentation with early returns Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-07vfs_commit: Reduce indentation with early returnsVolker Lendecke1-10/+9
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-07vfs_commit: Make dbytes and dthresh size_tVolker Lendecke1-6/+6
Those can never go negative, use "%zu" as printf modifier Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2023-07-17s3:modules: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-08-06vfs: change openat propotype to match linux openat2Volker Lendecke1-6/+4
The Linux prototype for openat2 looks like this: long openat2(int dirfd, const char *pathname, struct open_how *how, size_t size); where "struct open_how" is defined in "linux/openat2.h". It is designed to be extensible with further flags. The "size" parameter is required because there is no type checking between userland and kernelspace, so the way for Linux to find which version of open_how is being passed in is looking at the size: "open_how" is expected to only every grow with additional fields, should a change be necessary in the future. Samba does not have this problem, we can typecheck the struct and pointers, we expect all VFS modules to be compiled against the current vfs.h. For now this adds no functionality, but it will make further patches much smaller. Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-12-30vfs_commit: Reset fsp->fd->fd to -1 after SMB_VFS_CLOSEVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-12-16smbd: use fh_[get|set]_pos() and fh_[get|set]_position_information()Ralph Boehme1-1/+3
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-16smbd: use fsp_get_io_fd() when accessing a file or it's associated metadataRalph Boehme1-3/+3
In all places where we access or modify a file or it's associated metadata, we use fsp_get_io_fd() to fetch the low-level fd from the fsp. This ensures we don't accidentally use a pathref fsp where the fd would be opened as root on systems lacking O_PATH. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-16smbd: use fsp_set_fd()Ralph Boehme1-1/+1
No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-21vfs: remove SMB_VFS_OPEN()Ralph Boehme1-72/+0
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-21vfs_commit: implement SMB_VFS_OPENAT()Ralph Boehme1-0/+77
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-28s3:modules: Use #ifdef instead of #if for config.h definitionsAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-05-05s3: VFS: Remove SMB_VFS_WRITE() function and all implementations.Jeremy Allison1-19/+0
All code in Samba now uses SMB_VFS_PWRITE or SMB_VFS_PWRITE_SEND. 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): Sat May 5 01:38:07 CEST 2018 on sn-devel-144
2017-12-18vfs: Use static_decl_vfs in all VFS modulesChristof Schmitt1-1/+1
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Dec 18 13:32:00 CET 2017 on sn-devel-144
2017-12-06vfs: drop casts for VFS_ADD_FSP_EXTENSION() callersDavid Disseldorp1-1/+1
VFS_ADD_FSP_EXTENSION() now returns a properly typed pointer. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Dec 6 03:43:48 CET 2017 on sn-devel-144
2017-04-22lib: modules: Change XXX_init interface from XXX_init(void) to ↵Jeremy Allison1-2/+2
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
2016-03-02s3/vfs: wrap async io function args inside struct vfs_aio_stateRalph Boehme1-5/+6
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>
2015-10-08vfs_commit: set the fd on open before calling SMB_VFS_FSTATUri Simchoni1-1/+10
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11547 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Oct 8 02:56:41 CEST 2015 on sn-devel-104
2013-01-15smbd: Fix bug 9544, part 2Volker Lendecke1-0/+80
Plug in async pwrite Reviewed by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jan 15 00:55:51 CET 2013 on sn-devel-104
2013-01-14smbd: Fix bug 9544, part 1Volker Lendecke1-3/+3
Adapt the sync function names Reviewed by: Jeremy Allison <jra@samba.org>
2012-04-06build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett1-7/+7
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
2011-11-30s3: Attempt to fix the vfs_commit moduleVolker Lendecke1-1/+1
This bug went in in 2007. I wonder how much this module is actually used.... Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Nov 30 21:46:09 CET 2011 on sn-devel-104
2011-06-24s3:vfs_commit: fix buildBjörn Jacke1-0/+1
fix build Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Björn Jacke <bj@sernet.de> Autobuild-Date: Fri Jun 24 14:51:31 CEST 2011 on sn-devel-104
2011-04-21s3-vfs: rename open function to open_fn.Günther Deschner1-1/+1
This should finally fix the AIX build and allow to remove AIX specific ifdefs. Guenther Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Apr 21 02:01:20 CEST 2011 on sn-devel-104
2011-03-30s3-vfs: include smbd/smbd.h in vfs modules.Günther Deschner1-0/+1
Guenther
2010-01-06vfs_commit: print warning when no fsync support is thereBjörn Jacke1-0/+2
this one was part of an old patch from jpeach.
2009-11-30Restructure the connect function code to always callJeremy Allison1-1/+7
down to NEXT-> before initializing. This allows us to do cleanup (by calling DISCONNECT) if initialization fails. Also fix vfs_acl_xattr which was failing to call the NEXT connect function. Jeremy.
2009-07-24Make the smbd VFS typesafeVolker Lendecke1-17/+9
2009-07-24Some more VFS type errorsVolker Lendecke1-2/+2
2009-07-24Fix some C++ warningsVolker Lendecke1-4/+7
2009-06-17s3: Change SMB_VFS_OPEN to take an smb_filename structTim Prouty1-3/+3
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-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-1/+1
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-02-09s3 vfs: Add a destructor to the fsp extension data APITim Prouty1-1/+1
I'm not certain if the dummy pointer is needed in struct vfs_fsp_data, but I added it to be consistent with the comment below.
2008-04-21Remove redundant parameter fd from SMB_VFS_CLOSE().Michael Adam1-3/+2
Now all those redundant fd's have vanished from the VFS API. Michael (This used to be commit 14294535512a7f191c5008e622b6708e417854ae)
2008-01-10Remove redundant parameter fd from SMB_VFS_WRITE().Michael Adam1-2/+1
Michael (This used to be commit c8ae7d095a2a6a7eac920a68ca7244e3a423e1b1)
2008-01-07Remove redundant parameter fd from SMB_VFS_FTRUNCATE().Michael Adam1-2/+1
Michael (This used to be commit 2ad66050a0452b8e7e08b1e7a01efa00c72fd451)
2008-01-07Remove redundant parameter fd from SMB_VFS_FSTAT().Michael Adam1-1/+1
Michael (This used to be commit 0b86c420be94d295f6917a220b5d699f65b46711)
2008-01-07Remove redundant parameter fd from SMB_VFS_PWRITE().Michael Adam1-2/+1
Michael (This used to be commit 8c4901a19ae2fd3ee085f9499f33aa7db016d182)
2007-11-20Extend commit module to help with NFS quotas.David Losada Carballo1-25/+158
Add "commit on eof" and "commit past eof" modes. Patch from David Losada Carballo with some modifications during the merge. (This used to be commit 12eee4f7fe27bb4ca376301b959dbfb918b7ba2d)
2007-10-10r23801: The FSF has moved around a lot. This fixes their Mass Ave address.Andrew Tridgell1-2/+1
(This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r20261: merge 20260 from samba_3_0_24Herb Lewis1-0/+1
clean up a bunch of no previous prototype warnings (This used to be commit c60687db112405262adf26dbf267804b04074e67)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-0/+189
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)