1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00

r6346: Add a counter for the number of SMB operations per connection/file.

You will need to do a make clean after SVN updating this. Next will
come a smbcontrol message to dump this info. This should be interesting
to profile client activity.
Jeremy.
This commit is contained in:
Jeremy Allison 2005-04-14 23:32:56 +00:00 committed by Gerald (Jerry) Carter
parent 77c0ade9fa
commit 743174da86
3 changed files with 9 additions and 2 deletions

View File

@ -412,6 +412,7 @@ typedef struct files_struct {
int fnum;
struct connection_struct *conn;
int fd;
unsigned int num_smb_operations;
uint16 rap_print_jobid;
SMB_DEV_T dev;
SMB_INO_T inode;
@ -533,6 +534,7 @@ typedef struct connection_struct
time_t lastused;
BOOL used;
int num_files_open;
unsigned int num_smb_operations; /* Count of smb operations on this tree. */
BOOL case_sensitive;
BOOL case_preserve;

View File

@ -94,6 +94,7 @@
return(ERROR_DOS(ERRDOS,ERRbadfid)); \
else if((fsp)->fd == -1) \
return(ERROR_DOS(ERRDOS,ERRbadaccess));\
(fsp)->num_smb_operations++;\
} while(0)
#define CHECK_READ(fsp) if (!(fsp)->can_read) \

View File

@ -962,8 +962,12 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize
return(ERROR_DOS(ERRSRV,ERRaccess));
/* load service specific parameters */
if (conn && !set_current_service(conn,SVAL(inbuf,smb_flg),(flags & (AS_USER|DO_CHDIR)?True:False)))
return(ERROR_DOS(ERRSRV,ERRaccess));
if (conn) {
if (!set_current_service(conn,SVAL(inbuf,smb_flg),(flags & (AS_USER|DO_CHDIR)?True:False))) {
return(ERROR_DOS(ERRSRV,ERRaccess));
}
conn->num_smb_operations++;
}
/* does this protocol need to be run as guest? */
if ((flags & AS_GUEST) && (!change_to_guest() ||