summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-16 00:59:18 +0000
committerJeremy Allison <jra@samba.org>2000-11-16 00:59:18 +0000
commit6f58dd587124c8b85fc62177b26129aaea5819b0 (patch)
tree40c926a6f3e5b5db7e913e13ea6571b97dacf362 /source3/smbd/vfs.c
parent14355a6434952071e862af3a1e7bcfbbf640a6a3 (diff)
downloadsamba-6f58dd587124c8b85fc62177b26129aaea5819b0.tar.gz
samba-6f58dd587124c8b85fc62177b26129aaea5819b0.tar.bz2
samba-6f58dd587124c8b85fc62177b26129aaea5819b0.zip
Ok - fixed a bug in our levelII oplock code. We need to break a level II on
a byte range lock (write lock only, but Win2k breaks on read lock also so I do the same) - if you think about why, this is obvious. Also fixed our client code to do level II oplocks, if requested, and fixed the code where we would assume the client wanted level II if it advertised itself as being level II capable - it may not want that. Jeremy. (This used to be commit 213cd0b5192307cd4b0026cae94b2f52fb1b0c02)
Diffstat (limited to 'source3/smbd/vfs.c')
-rw-r--r--source3/smbd/vfs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 77b42361ed..3db150ab6f 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -385,6 +385,24 @@ ssize_t vfs_write_data(files_struct *fsp,char *buffer,size_t N)
}
/****************************************************************************
+ A vfs set_filelen call.
+ set the length of a file from a filedescriptor.
+ Returns 0 on success, -1 on failure.
+****************************************************************************/
+
+int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len)
+{
+ int ret;
+
+ release_level_2_oplocks_on_change(fsp);
+ if ((ret = fsp->conn->vfs_ops.ftruncate(fsp, fsp->fd, len)) != -1) {
+ set_filelen_write_cache(fsp, len);
+ }
+
+ return ret;
+}
+
+/****************************************************************************
Transfer some data between two file_struct's.
****************************************************************************/