summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/modules/vfs_hpuxacl.c6
-rw-r--r--source3/smbd/files.c6
-rw-r--r--source3/smbd/oplock_linux.c2
4 files changed, 9 insertions, 7 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index a6ae87f887..88cb2c1fff 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4760,7 +4760,7 @@ struct files_struct *files_forall(
struct files_struct *(*fn)(struct files_struct *fsp,
void *private_data),
void *private_data);
-files_struct *file_find_fd(int fd);
+files_struct *file_find_fd(struct smbd_server_connection *sconn, int fd);
files_struct *file_find_dif(struct smbd_server_connection *sconn,
struct file_id id, unsigned long gen_id);
files_struct *file_find_di_first(struct smbd_server_connection *sconn,
diff --git a/source3/modules/vfs_hpuxacl.c b/source3/modules/vfs_hpuxacl.c
index 5a54f79da3..62a35b1680 100644
--- a/source3/modules/vfs_hpuxacl.c
+++ b/source3/modules/vfs_hpuxacl.c
@@ -189,7 +189,8 @@ SMB_ACL_T hpuxacl_sys_acl_get_fd(vfs_handle_struct *handle,
*/
/* For all I see, the info should already be in the fsp
* parameter, but get it again to be safe --- necessary? */
- files_struct *file_struct_p = file_find_fd(fsp->fh->fd);
+ files_struct *file_struct_p = file_find_fd(fsp->conn->sconn,
+ fsp->fh->fd);
if (file_struct_p == NULL) {
errno = EBADF;
return NULL;
@@ -328,7 +329,8 @@ int hpuxacl_sys_acl_set_fd(vfs_handle_struct *handle,
*/
/* For all I see, the info should already be in the fsp
* parameter, but get it again to be safe --- necessary? */
- files_struct *file_struct_p = file_find_fd(fsp->fh->fd);
+ files_struct *file_struct_p = file_find_fd(fsp->conn->sconn,
+ fsp->fh->fd);
if (file_struct_p == NULL) {
errno = EBADF;
return -1;
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 99ceb51731..05b22dcd7c 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -248,15 +248,15 @@ struct files_struct *files_forall(
Find a fsp given a file descriptor.
****************************************************************************/
-files_struct *file_find_fd(int fd)
+files_struct *file_find_fd(struct smbd_server_connection *sconn, int fd)
{
int count=0;
files_struct *fsp;
- for (fsp=smbd_server_conn->files;fsp;fsp=fsp->next,count++) {
+ for (fsp=sconn->files; fsp; fsp=fsp->next,count++) {
if (fsp->fh->fd == fd) {
if (count > 10) {
- DLIST_PROMOTE(smbd_server_conn->files, fsp);
+ DLIST_PROMOTE(sconn->files, fsp);
}
return fsp;
}
diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c
index fe9c58d7ec..bdc86b9fb9 100644
--- a/source3/smbd/oplock_linux.c
+++ b/source3/smbd/oplock_linux.c
@@ -97,7 +97,7 @@ static void linux_oplock_signal_handler(struct tevent_context *ev_ctx,
int fd = info->si_fd;
files_struct *fsp;
- fsp = file_find_fd(fd);
+ fsp = file_find_fd(smbd_server_conn, fd);
if (fsp == NULL) {
DEBUG(0,("linux_oplock_signal_handler: failed to find fsp for file fd=%d (file was closed ?)\n", fd ));
return;