summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-01-10 16:36:05 -0800
committerJeremy Allison <jra@samba.org>2008-01-10 16:36:05 -0800
commit6a8fad084cda2b68ced5aaa8c6ef6a03c7350c57 (patch)
tree90f31e435fac5c882591305e7ff1ff4377eec266 /source3/modules
parentf33f4ef4a24fcbf09eeba0d51e7db74e9b13b432 (diff)
parentfef9cf00e1e110ff5872f1c368d080fe4f7939d6 (diff)
downloadsamba-6a8fad084cda2b68ced5aaa8c6ef6a03c7350c57.tar.gz
samba-6a8fad084cda2b68ced5aaa8c6ef6a03c7350c57.tar.bz2
samba-6a8fad084cda2b68ced5aaa8c6ef6a03c7350c57.zip
Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test
(This used to be commit 767e0164adf8803df50b0b7bd8e81d25af72bb78)
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_cacheprime.c14
-rw-r--r--source3/modules/vfs_default.c9
-rw-r--r--source3/modules/vfs_full_audit.c18
-rw-r--r--source3/modules/vfs_readahead.c14
4 files changed, 24 insertions, 31 deletions
diff --git a/source3/modules/vfs_cacheprime.c b/source3/modules/vfs_cacheprime.c
index 5675108f1e..be934f6bd6 100644
--- a/source3/modules/vfs_cacheprime.c
+++ b/source3/modules/vfs_cacheprime.c
@@ -48,7 +48,6 @@ static void * g_readbuf = NULL;
static bool prime_cache(
struct vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
SMB_OFF_T offset,
size_t count)
{
@@ -75,7 +74,7 @@ static bool prime_cache(
MODULE, (long long)g_readsz, (long long)*last,
fsp->fsp_name));
- nread = sys_pread(fd, g_readbuf, g_readsz, *last);
+ nread = sys_pread(fsp->fh->fd, g_readbuf, g_readsz, *last);
if (nread < 0) {
*last = -1;
return False;
@@ -125,17 +124,16 @@ static int cprime_connect(
static ssize_t cprime_sendfile(
struct vfs_handle_struct * handle,
int tofd,
- files_struct * fsp,
- int fromfd,
+ files_struct * fromfsp,
const DATA_BLOB * header,
SMB_OFF_T offset,
size_t count)
{
if (g_readbuf && offset == 0) {
- prime_cache(handle, fsp, fromfd, offset, count);
+ prime_cache(handle, fromfsp, offset, count);
}
- return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd,
+ return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp,
header, offset, count);
}
@@ -149,7 +147,7 @@ static ssize_t cprime_read(
offset = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
if (offset >= 0 && g_readbuf) {
- prime_cache(handle, fsp, fsp->fh->fd, offset, count);
+ prime_cache(handle, fsp, offset, count);
SMB_VFS_LSEEK(fsp, offset, SEEK_SET);
}
@@ -164,7 +162,7 @@ static ssize_t cprime_pread(
SMB_OFF_T offset)
{
if (g_readbuf) {
- prime_cache(handle, fsp, fsp->fh->fd, offset, count);
+ prime_cache(handle, fsp, offset, count);
}
return SMB_VFS_NEXT_PREAD(handle, fsp, data, count, offset);
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index e57d24cb1a..e21136ccee 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -337,28 +337,27 @@ static SMB_OFF_T vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB
return result;
}
-static ssize_t vfswrap_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr,
+static ssize_t vfswrap_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr,
SMB_OFF_T offset, size_t n)
{
ssize_t result;
START_PROFILE_BYTES(syscall_sendfile, n);
- result = sys_sendfile(tofd, fromfd, hdr, offset, n);
+ result = sys_sendfile(tofd, fromfsp->fh->fd, hdr, offset, n);
END_PROFILE(syscall_sendfile);
return result;
}
static ssize_t vfswrap_recvfile(vfs_handle_struct *handle,
int fromfd,
- files_struct *fsp,
- int tofd,
+ files_struct *tofsp,
SMB_OFF_T offset,
size_t n)
{
ssize_t result;
START_PROFILE_BYTES(syscall_recvfile, n);
- result = sys_recvfile(fromfd, tofd, offset, n);
+ result = sys_recvfile(fromfd, tofsp->fh->fd, offset, n);
END_PROFILE(syscall_recvfile);
return result;
}
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 00512678b1..5aa9bab5b5 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -124,11 +124,11 @@ static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fs
static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp,
SMB_OFF_T offset, int whence);
static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
- files_struct *fsp, int fromfd,
+ files_struct *fromfsp,
const DATA_BLOB *hdr, SMB_OFF_T offset,
size_t n);
static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
- files_struct *fsp, int tofd,
+ files_struct *tofsp,
SMB_OFF_T offset,
size_t n);
static int smb_full_audit_rename(vfs_handle_struct *handle,
@@ -1149,33 +1149,31 @@ static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *f
}
static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
- files_struct *fsp, int fromfd,
+ files_struct *fromfsp,
const DATA_BLOB *hdr, SMB_OFF_T offset,
size_t n)
{
ssize_t result;
- result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, hdr,
- offset, n);
+ result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
do_log(SMB_VFS_OP_SENDFILE, (result >= 0), handle,
- "%s", fsp->fsp_name);
+ "%s", fromfsp->fsp_name);
return result;
}
static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
- files_struct *fsp, int tofd,
+ files_struct *tofsp,
SMB_OFF_T offset,
size_t n)
{
ssize_t result;
- result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd,
- offset, n);
+ result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
do_log(SMB_VFS_OP_RECVFILE, (result >= 0), handle,
- "%s", fsp->fsp_name);
+ "%s", tofsp->fsp_name);
return result;
}
diff --git a/source3/modules/vfs_readahead.c b/source3/modules/vfs_readahead.c
index b3642d558f..df75814b72 100644
--- a/source3/modules/vfs_readahead.c
+++ b/source3/modules/vfs_readahead.c
@@ -35,8 +35,7 @@ struct readahead_data {
static ssize_t readahead_sendfile(struct vfs_handle_struct *handle,
int tofd,
- files_struct *fsp,
- int fromfd,
+ files_struct *fromfsp,
const DATA_BLOB *header,
SMB_OFF_T offset,
size_t count)
@@ -45,16 +44,16 @@ static ssize_t readahead_sendfile(struct vfs_handle_struct *handle,
if ( offset % rhd->off_bound == 0) {
#if defined(HAVE_LINUX_READAHEAD)
- int err = readahead(fromfd, offset, (size_t)rhd->len);
+ int err = readahead(fromfsp->fh->fd, offset, (size_t)rhd->len);
DEBUG(10,("readahead_sendfile: readahead on fd %u, offset %llu, len %u returned %d\n",
- (unsigned int)fromfd,
+ (unsigned int)fromfsp->fh->fd,
(unsigned long long)offset,
(unsigned int)rhd->len,
err ));
#elif defined(HAVE_POSIX_FADVISE)
- int err = posix_fadvise(fromfd, offset, (off_t)rhd->len, POSIX_FADV_WILLNEED);
+ int err = posix_fadvise(fromfsp->fh->fd, offset, (off_t)rhd->len, POSIX_FADV_WILLNEED);
DEBUG(10,("readahead_sendfile: posix_fadvise on fd %u, offset %llu, len %u returned %d\n",
- (unsigned int)fromfd,
+ (unsigned int)fromfsp->fh->fd,
(unsigned long long)offset,
(unsigned int)rhd->len,
err ));
@@ -67,8 +66,7 @@ static ssize_t readahead_sendfile(struct vfs_handle_struct *handle,
}
return SMB_VFS_NEXT_SENDFILE(handle,
tofd,
- fsp,
- fromfd,
+ fromfsp,
header,
offset,
count);