[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Mon Sep 27 10:14:48 MDT 2010
The branch, master has been updated
via 3235f44 s3: Make file_fnum static
via f1c1959 s3: Remove some unused code
via 6319e0d s3: Fix some comments
via 35d9530 Remove talloc_autofree_context() from pm_process
via 8e02130 Lift talloc_autofree_context() from OpenConfFile()
from 84127dd libsmbconf: parse an empty share as empty share, not as NULL.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 3235f44ac48e6945446329d57f3ecd0d10fa47e1
Author: Volker Lendecke <vl at samba.org>
Date: Mon Sep 27 02:32:50 2010 +0200
s3: Make file_fnum static
commit f1c1959f1368741df052fd1d53cd748b8608f2f0
Author: Volker Lendecke <vl at samba.org>
Date: Mon Sep 27 01:49:01 2010 +0200
s3: Remove some unused code
commit 6319e0da100f813efc12b13b805c6c59afe5ab26
Author: Volker Lendecke <vl at samba.org>
Date: Mon Sep 27 02:32:27 2010 +0200
s3: Fix some comments
commit 35d9530f3b210f182815fe07b5204be664d5972a
Author: Volker Lendecke <vl at samba.org>
Date: Sun Sep 26 22:16:14 2010 -0700
Remove talloc_autofree_context() from pm_process
This would be a classic for talloc_tos(), InFile is freed a few lines down. But
unfortunately S4 does not support talloc_tos().
commit 8e02130c623fca4bf06baff6789b45d8782bf5b0
Author: Volker Lendecke <vl at samba.org>
Date: Sun Sep 26 22:15:40 2010 -0700
Lift talloc_autofree_context() from OpenConfFile()
-----------------------------------------------------------------------
Summary of changes:
lib/util/params.c | 6 ++--
source3/include/proto.h | 4 ---
source3/smbd/files.c | 56 ++--------------------------------------------
3 files changed, 6 insertions(+), 60 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/params.c b/lib/util/params.c
index 80adc71..8d17e0d 100644
--- a/lib/util/params.c
+++ b/lib/util/params.c
@@ -488,7 +488,7 @@ static bool Parse( myFILE *InFile,
return( true );
} /* Parse */
-static myFILE *OpenConfFile( const char *FileName )
+static myFILE *OpenConfFile(TALLOC_CTX *mem_ctx, const char *FileName )
/* ------------------------------------------------------------------------ **
* Open a configuration file.
*
@@ -502,7 +502,7 @@ static myFILE *OpenConfFile( const char *FileName )
const char *func = "params.c:OpenConfFile() -";
myFILE *ret;
- ret = talloc(talloc_autofree_context(), myFILE);
+ ret = talloc(mem_ctx, myFILE);
if (!ret) return NULL;
ret->buf = file_load(FileName, &ret->size, 0, ret);
@@ -543,7 +543,7 @@ bool pm_process( const char *FileName,
myFILE *InFile;
const char *func = "params.c:pm_process() -";
- InFile = OpenConfFile( FileName ); /* Open the config file. */
+ InFile = OpenConfFile(NULL, FileName); /* Open the config file. */
if( NULL == InFile )
return( false );
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 1aefe66..c55bf83 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4754,21 +4754,17 @@ void file_close_conn(connection_struct *conn);
void file_close_pid(uint16 smbpid, int vuid);
void file_init(void);
void file_close_user(int vuid);
-void file_dump_open_table(void);
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_dif(struct file_id id, unsigned long gen_id);
-files_struct *file_find_fsp(files_struct *orig_fsp);
files_struct *file_find_di_first(struct file_id id);
files_struct *file_find_di_next(files_struct *start_fsp);
-files_struct *file_find_print(void);
bool file_find_subpath(files_struct *dir_fsp);
void file_sync_all(connection_struct *conn);
void file_free(struct smb_request *req, files_struct *fsp);
-files_struct *file_fnum(uint16 fnum);
files_struct *file_fsp(struct smb_request *req, uint16 fid);
NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from,
uint32 access_mask, uint32 share_access,
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 9a7c5b0..d1b5fb1 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -68,7 +68,7 @@ NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
/*
* Make a child of the connection_struct as an fsp can't exist
- * indepenedent of a connection.
+ * independent of a connection.
*/
fsp = talloc_zero(conn, struct files_struct);
if (!fsp) {
@@ -243,23 +243,6 @@ struct files_struct *files_forall(
}
/****************************************************************************
- Debug to enumerate all open files in the smbd.
-****************************************************************************/
-
-void file_dump_open_table(void)
-{
- int count=0;
- files_struct *fsp;
-
- for (fsp=Files;fsp;fsp=fsp->next,count++) {
- DEBUG(10,("Files[%d], fnum = %d, name %s, fd = %d, gen = %lu, "
- "fileid=%s\n", count, fsp->fnum, fsp_str_dbg(fsp),
- fsp->fh->fd, (unsigned long)fsp->fh->gen_id,
- file_id_string_tos(&fsp->file_id)));
- }
-}
-
-/****************************************************************************
Find a fsp given a file descriptor.
****************************************************************************/
@@ -317,22 +300,6 @@ files_struct *file_find_dif(struct file_id id, unsigned long gen_id)
}
/****************************************************************************
- Check if an fsp still exists.
-****************************************************************************/
-
-files_struct *file_find_fsp(files_struct *orig_fsp)
-{
- files_struct *fsp;
-
- for (fsp=Files;fsp;fsp=fsp->next) {
- if (fsp == orig_fsp)
- return fsp;
- }
-
- return NULL;
-}
-
-/****************************************************************************
Find the first fsp given a device and inode.
We use a singleton cache here to speed up searching from getfilepathinfo
calls.
@@ -380,23 +347,6 @@ files_struct *file_find_di_next(files_struct *start_fsp)
}
/****************************************************************************
- Find a fsp that is open for printing.
-****************************************************************************/
-
-files_struct *file_find_print(void)
-{
- files_struct *fsp;
-
- for (fsp=Files;fsp;fsp=fsp->next) {
- if (fsp->print_file) {
- return fsp;
- }
- }
-
- return NULL;
-}
-
-/****************************************************************************
Find any fsp open with a pathname below that of an already open path.
****************************************************************************/
@@ -534,7 +484,7 @@ void file_free(struct smb_request *req, files_struct *fsp)
Get an fsp from a 16 bit fnum.
****************************************************************************/
-files_struct *file_fnum(uint16 fnum)
+static struct files_struct *file_fnum(uint16 fnum)
{
files_struct *fsp;
int count=0;
@@ -551,7 +501,7 @@ files_struct *file_fnum(uint16 fnum)
}
/****************************************************************************
- Get an fsp from a packet given the offset of a 16 bit fnum.
+ Get an fsp from a packet given a 16 bit fnum.
****************************************************************************/
files_struct *file_fsp(struct smb_request *req, uint16 fid)
--
Samba Shared Repository
More information about the samba-cvs
mailing list