diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-17 06:13:32 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-17 06:13:32 +0000 |
commit | b7aaab1b6b2d2f72b2bb7c11f5c7bf081a6093d9 (patch) | |
tree | dfce95029fac84ce23c04419bc5a5204bf9cb7b5 /source/smbd/files.c | |
parent | 27da84b90df1f32e0d07acad04c72065b2005470 (diff) | |
download | samba-b7aaab1b6b2d2f72b2bb7c11f5c7bf081a6093d9.tar.gz samba-b7aaab1b6b2d2f72b2bb7c11f5c7bf081a6093d9.tar.xz samba-b7aaab1b6b2d2f72b2bb7c11f5c7bf081a6093d9.zip |
moved connection_struct handling code into smbd/conn.c and changed it
to a linked list with bitmap format.
Diffstat (limited to 'source/smbd/files.c')
-rw-r--r-- | source/smbd/files.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/smbd/files.c b/source/smbd/files.c index e66e53e6ed2..7bd5501de53 100644 --- a/source/smbd/files.c +++ b/source/smbd/files.c @@ -54,7 +54,7 @@ files_struct *file_new(void ) { int i; static int first_file; - files_struct *fsp; + files_struct *fsp, *next; /* we want to give out file handles differently on each new connection because of a common bug in MS clients where they try to @@ -76,7 +76,8 @@ files_struct *file_new(void ) * files batch oplocked for quite a long time * after they have finished with them. */ - for (fsp=Files;fsp;fsp=fsp->next) { + for (fsp=Files;fsp;fsp=next) { + next=fsp->next; if (attempt_close_oplocked_file(fsp)) { return file_new(); } @@ -200,9 +201,10 @@ close all open files for a connection ****************************************************************************/ void file_close_conn(connection_struct *conn) { - files_struct *fsp; + files_struct *fsp, *next; - for (fsp=Files;fsp;fsp=fsp->next) { + for (fsp=Files;fsp;fsp=next) { + next = fsp->next; if (fsp->conn == conn && fsp->open) { if (fsp->is_directory) close_directory(fsp); @@ -248,9 +250,10 @@ close files open by a specified vuid ****************************************************************************/ void file_close_user(int vuid) { - files_struct *fsp; + files_struct *fsp, *next; - for (fsp=Files;fsp;fsp=fsp->next) { + for (fsp=Files;fsp;fsp=next) { + next=fsp->next; if ((fsp->vuid == vuid) && fsp->open) { if(!fsp->is_directory) close_file(fsp,False); @@ -301,9 +304,10 @@ sync open files on a connection ****************************************************************************/ void file_sync_all(connection_struct *conn) { - files_struct *fsp; + files_struct *fsp, *next; - for (fsp=Files;fsp;fsp=fsp->next) { + for (fsp=Files;fsp;fsp=next) { + next=fsp->next; if (fsp->open && conn == fsp->conn) { sync_file(conn,fsp); } |