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,
*/
/* 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;
*/
/* 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;
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;
}
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;