summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/files.c30
-rw-r--r--source3/smbd/globals.c1
-rw-r--r--source3/smbd/globals.h2
3 files changed, 16 insertions, 17 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index d1b5fb1146..1715190cc3 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -113,7 +113,7 @@ NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
TALLOC_FREE(fsp->fh);
}
- DLIST_ADD(Files, fsp);
+ DLIST_ADD(smbd_server_conn->files, fsp);
DEBUG(5,("allocated file structure %d, fnum = %d (%d used)\n",
i, fsp->fnum, files_used));
@@ -143,7 +143,7 @@ void file_close_conn(connection_struct *conn)
{
files_struct *fsp, *next;
- for (fsp=Files;fsp;fsp=next) {
+ for (fsp=smbd_server_conn->files;fsp;fsp=next) {
next = fsp->next;
if (fsp->conn == conn) {
close_file(NULL, fsp, SHUTDOWN_CLOSE);
@@ -159,7 +159,7 @@ void file_close_pid(uint16 smbpid, int vuid)
{
files_struct *fsp, *next;
- for (fsp=Files;fsp;fsp=next) {
+ for (fsp=smbd_server_conn->files;fsp;fsp=next) {
next = fsp->next;
if ((fsp->file_pid == smbpid) && (fsp->vuid == vuid)) {
close_file(NULL, fsp, SHUTDOWN_CLOSE);
@@ -212,7 +212,7 @@ void file_close_user(int vuid)
{
files_struct *fsp, *next;
- for (fsp=Files;fsp;fsp=next) {
+ for (fsp=smbd_server_conn->files;fsp;fsp=next) {
next=fsp->next;
if (fsp->vuid == vuid) {
close_file(NULL, fsp, SHUTDOWN_CLOSE);
@@ -231,7 +231,7 @@ struct files_struct *files_forall(
{
struct files_struct *fsp, *next;
- for (fsp = Files; fsp; fsp = next) {
+ for (fsp = smbd_server_conn->files; fsp; fsp = next) {
struct files_struct *ret;
next = fsp->next;
ret = fn(fsp, private_data);
@@ -251,10 +251,10 @@ files_struct *file_find_fd(int fd)
int count=0;
files_struct *fsp;
- for (fsp=Files;fsp;fsp=fsp->next,count++) {
+ for (fsp=smbd_server_conn->files;fsp;fsp=fsp->next,count++) {
if (fsp->fh->fd == fd) {
if (count > 10) {
- DLIST_PROMOTE(Files, fsp);
+ DLIST_PROMOTE(smbd_server_conn->files, fsp);
}
return fsp;
}
@@ -272,12 +272,12 @@ files_struct *file_find_dif(struct file_id id, unsigned long gen_id)
int count=0;
files_struct *fsp;
- for (fsp=Files;fsp;fsp=fsp->next,count++) {
+ for (fsp=smbd_server_conn->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(Files, fsp);
+ DLIST_PROMOTE(smbd_server_conn->files, fsp);
}
/* Paranoia check. */
if ((fsp->fh->fd == -1) &&
@@ -316,7 +316,7 @@ files_struct *file_find_di_first(struct file_id id)
fsp_fi_cache.id = id;
- for (fsp=Files;fsp;fsp=fsp->next) {
+ for (fsp=smbd_server_conn->files;fsp;fsp=fsp->next) {
if (file_id_equal(&fsp->file_id, &id)) {
/* Setup positive cache. */
fsp_fi_cache.fsp = fsp;
@@ -366,7 +366,7 @@ bool file_find_subpath(files_struct *dir_fsp)
dlen = strlen(d_fullname);
- for (fsp=Files;fsp;fsp=fsp->next) {
+ for (fsp=smbd_server_conn->files;fsp;fsp=fsp->next) {
char *d1_fullname;
if (fsp == dir_fsp) {
@@ -403,7 +403,7 @@ void file_sync_all(connection_struct *conn)
{
files_struct *fsp, *next;
- for (fsp=Files;fsp;fsp=next) {
+ for (fsp=smbd_server_conn->files;fsp;fsp=next) {
next=fsp->next;
if ((conn == fsp->conn) && (fsp->fh->fd != -1)) {
sync_file(conn, fsp, True /* write through */);
@@ -417,7 +417,7 @@ void file_sync_all(connection_struct *conn)
void file_free(struct smb_request *req, files_struct *fsp)
{
- DLIST_REMOVE(Files, fsp);
+ DLIST_REMOVE(smbd_server_conn->files, fsp);
TALLOC_FREE(fsp->fake_file_handle);
@@ -489,10 +489,10 @@ static struct files_struct *file_fnum(uint16 fnum)
files_struct *fsp;
int count=0;
- for (fsp=Files;fsp;fsp=fsp->next, count++) {
+ for (fsp=smbd_server_conn->files;fsp;fsp=fsp->next, count++) {
if (fsp->fnum == fnum) {
if (count > 10) {
- DLIST_PROMOTE(Files, fsp);
+ DLIST_PROMOTE(smbd_server_conn->files, fsp);
}
return fsp;
}
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index 340789ba8e..155629fa96 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -40,7 +40,6 @@ unsigned int allocated_write_caches = 0;
int real_max_open_files = 0;
struct bitmap *file_bmap = NULL;
-files_struct *Files = NULL;
int files_used = 0;
struct fsp_singleton_cache fsp_fi_cache = {
.fsp = NULL,
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index f4fb4f0b40..46c08222da 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -38,7 +38,6 @@ extern unsigned int allocated_write_caches;
extern int real_max_open_files;
extern struct bitmap *file_bmap;
-extern files_struct *Files;
extern int files_used;
/* A singleton cache to speed up searching by dev/inode. */
struct fsp_singleton_cache {
@@ -463,6 +462,7 @@ struct smbd_server_connection {
} nbt;
bool using_smb2;
int trans_num;
+ struct files_struct *files;
struct {
struct fd_event *fde;