Commit 7713cd04 authored by Steve French's avatar Steve French Committed by Steve French

add additional cifs stats

parent cb104629
...@@ -2,7 +2,11 @@ Version 1.16 ...@@ -2,7 +2,11 @@ Version 1.16
------------ ------------
Fix incorrect file size in file handle based setattr on big endian hardware. Fix incorrect file size in file handle based setattr on big endian hardware.
Fix oops in build_path_from_dentry when out of memory. Add checks for invalid Fix oops in build_path_from_dentry when out of memory. Add checks for invalid
and closing file structs in writepage/partialpagewrite and closing file structs in writepage/partialpagewrite. Add statistics
for each mounted share (new menuconfig option). Fix endianness problem in
volume information displayed in /proc/fs/cifs/DebugData (only affects
affects big endian architectures). Prevent renames while constructing
path names for open, mkdir and rmdir.
Version 1.15 Version 1.15
------------ ------------
......
version 1.14 May 14, 2004 version 1.16 May 27, 2004
A Partial List of Known Problems and Missing Features A Partial List of Missing Features
===================================================== ==================================
Contributions are welcome. There are plenty of opportunities Contributions are welcome. There are plenty of opportunities
for visible, important contributions to this module. Here for visible, important contributions to this module. Here
...@@ -54,7 +54,8 @@ than resending (helps reduce server resource utilization and avoid ...@@ -54,7 +54,8 @@ than resending (helps reduce server resource utilization and avoid
spurious oplock breaks). spurious oplock breaks).
p) Improve performance of readpages by sending more than one read p) Improve performance of readpages by sending more than one read
at a time when 8 pages or more are requested. at a time when 8 pages or more are requested. Evaluate whether
reads larger than 16K would be helpful.
q) For support of Windows9x/98 we need to retry failed mounts q) For support of Windows9x/98 we need to retry failed mounts
to *SMBSERVER (default server name) with the uppercase hostname to *SMBSERVER (default server name) with the uppercase hostname
...@@ -66,8 +67,10 @@ to Windows servers) ...@@ -66,8 +67,10 @@ to Windows servers)
s) Finish fcntl D_NOTIFY support so kde and gnome file list windows s) Finish fcntl D_NOTIFY support so kde and gnome file list windows
will autorefresh will autorefresh
t) Add GUI tool to configure /proc/fs/cifs settings and for display of
the CIFS statistics
KNOWN BUGS (updated May 14, 2004) KNOWN BUGS (updated May 27, 2004)
==================================== ====================================
1) existing symbolic links (Windows reparse points) are recognized but 1) existing symbolic links (Windows reparse points) are recognized but
can not be created remotely. They are implemented for Samba and those that can not be created remotely. They are implemented for Samba and those that
...@@ -88,9 +91,19 @@ than to Windows. ...@@ -88,9 +91,19 @@ than to Windows.
page writes begin in the middle of a page (pages can get zeroed). page writes begin in the middle of a page (pages can get zeroed).
6) Write caching done incorrectly when files are only opened 6) Write caching done incorrectly when files are only opened
with write permission by the application. with write permission by the application.
7) Rename of files that are hardlinked does not work correctly e.g.
ln source target
mv source target
This should be no op since files are linked but in cifs it causes
the source file to go away. This may require implementation of
the cifs POSIX extensions (Unix Extensions version 2) for
it to be done correctly since Samba is failing the rename,
(rather than ignoring it) so the client not knowing they
are linked proceeds to delete the target and then retry the
move which succeeds this time (but the source is gone).
Misc testing to do Misc testing to do
================= ==================
1) check out max path names and max path name components against various server 1) check out max path names and max path name components against various server
types. Return max path name in stat -f information types. Return max path name in stat -f information
...@@ -102,5 +115,6 @@ there are some easy changes that can be done to parallelize sequential writes, ...@@ -102,5 +115,6 @@ there are some easy changes that can be done to parallelize sequential writes,
and when signing is disabled to request larger read sizes (larger than and when signing is disabled to request larger read sizes (larger than
negotiated size) and send larger write sizes to modern servers. negotiated size) and send larger write sizes to modern servers.
4) More exhaustively test the recently added NT4 support 4) More exhaustively test the recently added NT4 support against various
NT4 service pack levels.
...@@ -84,12 +84,12 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, ...@@ -84,12 +84,12 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList);
length = length =
sprintf(buf, sprintf(buf,
"\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\tTCP session status: %d", "\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\tTCP status: %d",
i, ses->serverName, ses->serverDomain, atomic_read(&ses->inUse), i, ses->serverName, ses->serverDomain, atomic_read(&ses->inUse),
ses->serverOS, ses->serverNOS, ses->capabilities,ses->status,ses->server->tcpStatus); ses->serverOS, ses->serverNOS, ses->capabilities,ses->status,ses->server->tcpStatus);
buf += length; buf += length;
if(ses->server) { if(ses->server) {
buf += sprintf(buf, "\n\tLocal Users To Same Server: %d SecMode: 0x%x Req Active: %d", buf += sprintf(buf, "\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d",
atomic_read(&ses->server->socketUseCount), atomic_read(&ses->server->socketUseCount),
ses->server->secMode, ses->server->secMode,
atomic_read(&ses->server->inFlight)); atomic_read(&ses->server->inFlight));
...@@ -125,7 +125,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, ...@@ -125,7 +125,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
length = length =
sprintf(buf, sprintf(buf,
"\n%d) %s Uses: %d on FS: %s with characteristics: 0x%x Attributes: 0x%x\nPathComponentMax: %d Status: %d", "\n%d) %s Uses: %d Type: %s Characteristics: 0x%x Attributes: 0x%x\nPathComponentMax: %d Status: %d",
i, tcon->treeName, i, tcon->treeName,
atomic_read(&tcon->useCount), atomic_read(&tcon->useCount),
tcon->nativeFileSystem, tcon->nativeFileSystem,
...@@ -145,14 +145,25 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, ...@@ -145,14 +145,25 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
if(tcon->tidStatus == CifsNeedReconnect) if(tcon->tidStatus == CifsNeedReconnect)
buf += sprintf(buf, "\tDISCONNECTED "); buf += sprintf(buf, "\tDISCONNECTED ");
#ifdef CONFIG_CIFS_STATS #ifdef CONFIG_CIFS_STATS
length = sprintf(buf, length = sprintf(buf,"\nSMBs: %d Oplock Breaks: %d",
"\nTotal SMBs: %d Reads: %d BytesRead %lld Writes: %d BytesWritten %lld",
atomic_read(&tcon->num_smbs_sent), atomic_read(&tcon->num_smbs_sent),
atomic_read(&tcon->num_oplock_brks));
buf += length;
length = sprintf(buf,"\nReads: %d Bytes %lld",
atomic_read(&tcon->num_reads), atomic_read(&tcon->num_reads),
(long long)(tcon->bytes_read), (long long)(tcon->bytes_read));
buf += length;
length = sprintf(buf,"\nWrites: %d Bytes: %lld",
atomic_read(&tcon->num_writes), atomic_read(&tcon->num_writes),
(long long)(tcon->bytes_written)); (long long)(tcon->bytes_written));
buf += length; buf += length;
length = sprintf(buf,
"\nOpens: %d Deletes: %d\nMkdirs: %d Rmdirs: %d",
atomic_read(&tcon->num_opens),
atomic_read(&tcon->num_deletes),
atomic_read(&tcon->num_mkdirs),
atomic_read(&tcon->num_rmdirs));
buf += length;
#endif #endif
} }
......
...@@ -201,6 +201,11 @@ struct cifsTconInfo { ...@@ -201,6 +201,11 @@ struct cifsTconInfo {
atomic_t num_smbs_sent; atomic_t num_smbs_sent;
atomic_t num_writes; atomic_t num_writes;
atomic_t num_reads; atomic_t num_reads;
atomic_t num_oplock_brks;
atomic_t num_opens;
atomic_t num_deletes;
atomic_t num_mkdirs;
atomic_t num_rmdirs;
__u64 bytes_read; __u64 bytes_read;
__u64 bytes_written; __u64 bytes_written;
spinlock_t stat_lock; spinlock_t stat_lock;
......
...@@ -436,7 +436,13 @@ CIFSSMBDelFile(const int xid, struct cifsTconInfo *tcon, ...@@ -436,7 +436,13 @@ CIFSSMBDelFile(const int xid, struct cifsTconInfo *tcon,
(struct smb_hdr *) pSMBr, &bytes_returned, 0); (struct smb_hdr *) pSMBr, &bytes_returned, 0);
if (rc) { if (rc) {
cFYI(1, ("Error in RMFile = %d", rc)); cFYI(1, ("Error in RMFile = %d", rc));
} }
#ifdef CONFIG_CIFS_STATS
else {
atomic_inc(&tcon->num_deletes);
}
#endif
if (pSMB) if (pSMB)
cifs_buf_release(pSMB); cifs_buf_release(pSMB);
if (rc == -EAGAIN) if (rc == -EAGAIN)
...@@ -483,6 +489,12 @@ CIFSSMBRmDir(const int xid, struct cifsTconInfo *tcon, ...@@ -483,6 +489,12 @@ CIFSSMBRmDir(const int xid, struct cifsTconInfo *tcon,
if (rc) { if (rc) {
cFYI(1, ("Error in RMDir = %d", rc)); cFYI(1, ("Error in RMDir = %d", rc));
} }
#ifdef CONFIG_CIFS_STATS
else {
atomic_inc(&tcon->num_rmdirs);
}
#endif
if (pSMB) if (pSMB)
cifs_buf_release(pSMB); cifs_buf_release(pSMB);
if (rc == -EAGAIN) if (rc == -EAGAIN)
...@@ -528,6 +540,11 @@ CIFSSMBMkDir(const int xid, struct cifsTconInfo *tcon, ...@@ -528,6 +540,11 @@ CIFSSMBMkDir(const int xid, struct cifsTconInfo *tcon,
if (rc) { if (rc) {
cFYI(1, ("Error in Mkdir = %d", rc)); cFYI(1, ("Error in Mkdir = %d", rc));
} }
#ifdef CONFIG_CIFS_STATS
else {
atomic_inc(&tcon->num_mkdirs);
}
#endif
if (pSMB) if (pSMB)
cifs_buf_release(pSMB); cifs_buf_release(pSMB);
if (rc == -EAGAIN) if (rc == -EAGAIN)
...@@ -624,6 +641,10 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon, ...@@ -624,6 +641,10 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
pfile_info->EndOfFile = pSMBr->EndOfFile; pfile_info->EndOfFile = pSMBr->EndOfFile;
pfile_info->NumberOfLinks = cpu_to_le32(1); pfile_info->NumberOfLinks = cpu_to_le32(1);
} }
#ifdef CONFIG_CIFS_STATS
atomic_inc(&tcon->num_opens);
#endif
} }
if (pSMB) if (pSMB)
cifs_buf_release(pSMB); cifs_buf_release(pSMB);
......
...@@ -392,6 +392,9 @@ is_valid_oplock_break(struct smb_hdr *buf) ...@@ -392,6 +392,9 @@ is_valid_oplock_break(struct smb_hdr *buf)
list_for_each(tmp, &GlobalTreeConnectionList) { list_for_each(tmp, &GlobalTreeConnectionList) {
tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
if (tcon->tid == buf->Tid) { if (tcon->tid == buf->Tid) {
#ifdef CONFIG_CIFS_STATS
atomic_inc(&tcon->num_oplock_brks);
#endif
list_for_each(tmp1,&tcon->openFileList){ list_for_each(tmp1,&tcon->openFileList){
netfile = list_entry(tmp1,struct cifsFileInfo,tlist); netfile = list_entry(tmp1,struct cifsFileInfo,tlist);
if(pSMB->Fid == netfile->netfid) { if(pSMB->Fid == netfile->netfid) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment