diff options
author | Volker Lendecke <vl@samba.org> | 2010-09-27 04:00:31 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-09-28 07:36:16 +0200 |
commit | b448e42de4070410eddbe2fa0085b9328a301159 (patch) | |
tree | ea295ef2120a31b32fe775b1d5127ff3e757bb6a /source3 | |
parent | fb8686962a542c70a2104247a77b48cacd8a9663 (diff) | |
download | samba-b448e42de4070410eddbe2fa0085b9328a301159.tar.gz samba-b448e42de4070410eddbe2fa0085b9328a301159.tar.bz2 samba-b448e42de4070410eddbe2fa0085b9328a301159.zip |
s3: Lift smbd_server_conn from file_find_dif
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 3 | ||||
-rw-r--r-- | source3/smbd/close.c | 2 | ||||
-rw-r--r-- | source3/smbd/files.c | 7 | ||||
-rw-r--r-- | source3/smbd/open.c | 2 | ||||
-rw-r--r-- | source3/smbd/oplock.c | 2 |
5 files changed, 9 insertions, 7 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index af25db66a1..d70c823e20 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4761,7 +4761,8 @@ struct files_struct *files_forall( void *private_data), void *private_data); files_struct *file_find_fd(int fd); -files_struct *file_find_dif(struct file_id id, unsigned long gen_id); +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 file_id id); files_struct *file_find_di_next(files_struct *start_fsp); bool file_find_subpath(files_struct *dir_fsp); diff --git a/source3/smbd/close.c b/source3/smbd/close.c index fad9601491..c25d7e1168 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1117,7 +1117,7 @@ void msg_close_file(struct messaging_context *msg_ctx, TALLOC_FREE(sm_str); } - fsp = file_find_dif(e.id, e.share_file_id); + fsp = file_find_dif(smbd_server_conn, e.id, e.share_file_id); if (!fsp) { DEBUG(10,("msg_close_file: failed to find file.\n")); return; diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 5293529411..3f353a3eb2 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -269,17 +269,18 @@ files_struct *file_find_fd(int fd) Find a fsp given a device, inode and file_id. ****************************************************************************/ -files_struct *file_find_dif(struct file_id id, unsigned long gen_id) +files_struct *file_find_dif(struct smbd_server_connection *sconn, + struct file_id id, unsigned long gen_id) { 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++) { /* We can have a fsp->fh->fd == -1 here as it could be a stat open. */ if (file_id_equal(&fsp->file_id, &id) && fsp->fh->gen_id == gen_id ) { if (count > 10) { - DLIST_PROMOTE(smbd_server_conn->files, fsp); + DLIST_PROMOTE(sconn->files, fsp); } /* Paranoia check. */ if ((fsp->fh->fd == -1) && diff --git a/source3/smbd/open.c b/source3/smbd/open.c index e9f0e6cd4f..44de5a3cd0 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -765,7 +765,7 @@ static void validate_my_share_entries(int num, return; } - fsp = file_find_dif(share_entry->id, + fsp = file_find_dif(smbd_server_conn, share_entry->id, share_entry->share_file_id); if (!fsp) { DEBUG(0,("validate_my_share_entries: PANIC : %s\n", diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 63a17e16a3..5521a95c4c 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -273,7 +273,7 @@ static files_struct *initial_break_processing(struct file_id id, unsigned long f * we have an oplock on it. */ - fsp = file_find_dif(id, file_id); + fsp = file_find_dif(smbd_server_conn, id, file_id); if(fsp == NULL) { /* The file could have been closed in the meantime - return success. */ |