s3: Lift smbd_server_conn from file_find_fd
authorVolker Lendecke <vl@samba.org>
Mon, 27 Sep 2010 02:54:29 +0000 (04:54 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 28 Sep 2010 05:36:18 +0000 (07:36 +0200)
source3/include/proto.h
source3/modules/vfs_hpuxacl.c
source3/smbd/files.c
source3/smbd/oplock_linux.c

index a6ae87f887678fcda41399c61f870921a99afa8f..88cb2c1fffb19c176b63cc75c8e2717bc9678914 100644 (file)
@@ -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,
index 5a54f79da360f556b6d8146030bde0ed1b6fb7fa..62a35b16805f38cf161942d3fcd7bc0374a0b1e8 100644 (file)
@@ -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;
index 99ceb51731a5d35fa28de5f93e0e0bff3f28e324..05b22dcd7c2d971934f87181b2fb2dd89be3a117 100644 (file)
@@ -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;
                }
index fe9c58d7ecdabd33ad342e90f5076894a697e5f4..bdc86b9fb9046bdd663b4d89d916f91852913e7a 100644 (file)
@@ -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;