Commit c208b35c authored by Steve French's avatar Steve French

Fix /proc/fs/cifs/Stats to handle larger return data, and correct Kconfig...

Fix /proc/fs/cifs/Stats to handle larger return data, and correct Kconfig reference to /proc/fs/cifs/Stats

Signed-off-by: Steve French (sfrench@us.ibm.com)
parent adf791bd
...@@ -1562,7 +1562,7 @@ config SMB_NLS_REMOTE ...@@ -1562,7 +1562,7 @@ config SMB_NLS_REMOTE
smbmount from samba 2.2.0 or later supports this. smbmount from samba 2.2.0 or later supports this.
config CIFS config CIFS
tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)(EXPERIMENTAL)" tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)"
depends on INET depends on INET
select NLS select NLS
help help
...@@ -1592,7 +1592,16 @@ config CIFS_STATS ...@@ -1592,7 +1592,16 @@ config CIFS_STATS
depends on CIFS depends on CIFS
help help
Enabling this option will cause statistics for each server share Enabling this option will cause statistics for each server share
mounted by the cifs client to be displayed in /proc/fs/cifs/DebugData mounted by the cifs client to be displayed in /proc/fs/cifs/Stats
config CIFS_POSIX
bool "CIFS statistics (EXPERIMENTAL)"
depends on CIFS
help
Enabling this option will cause the cifs client to attempt to
negotiate a newer dialect with servers, such as Samba 3.0.5
or later, that optionally can handle more POSIX like (rather
than Windows like) file behavior. If unsure, say N.
config NCP_FS config NCP_FS
tristate "NCP file system support (to mount NetWare volumes)" tristate "NCP file system support (to mount NetWare volumes)"
......
Version 1.19
------------
Fix /proc/fs/cifs/Stats and DebugData display to handle larger
amounts of return data.
Version 1.18 Version 1.18
------------ ------------
Do not rename hardlinked files (since that should be a noop). Flush Do not rename hardlinked files (since that should be a noop). Flush
cached write behind data when reopening a file after session abend, cached write behind data when reopening a file after session abend,
except when already in write. Grab per socket sem during reconnect except when already in write. Grab per socket sem during reconnect
to avoid oops in sendmsg if overlapping with reconnect. to avoid oops in sendmsg if overlapping with reconnect. Do not
reset cached inode file size on readdir for files open for write on
client.
Version 1.17 Version 1.17
......
...@@ -62,11 +62,16 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, ...@@ -62,11 +62,16 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
struct list_head *tmp; struct list_head *tmp;
struct list_head *tmp1;
struct mid_q_entry * mid_entry;
struct cifsSesInfo *ses; struct cifsSesInfo *ses;
struct cifsTconInfo *tcon; struct cifsTconInfo *tcon;
int i; int i;
int length = 0; int length = 0;
char *buf_start = buf; char * original_buf = buf;
*beginBuffer = buf + offset;
length = length =
sprintf(buf, sprintf(buf,
...@@ -94,7 +99,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, ...@@ -94,7 +99,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
ses->server->secMode, ses->server->secMode,
atomic_read(&ses->server->inFlight)); atomic_read(&ses->server->inFlight));
/* length = sprintf(buf, "\nMIDs: \n"); length = sprintf(buf, "\nMIDs: \n");
buf += length; buf += length;
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
...@@ -107,7 +112,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, ...@@ -107,7 +112,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
buf += length; buf += length;
} }
} }
spin_unlock(&GlobalMid_Lock); */ spin_unlock(&GlobalMid_Lock);
} }
} }
...@@ -152,19 +157,22 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, ...@@ -152,19 +157,22 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
length = sprintf(buf, "\n"); length = sprintf(buf, "\n");
buf += length; buf += length;
*eof = 1;
/* BB add code to dump additional info such as TCP session info now */ /* BB add code to dump additional info such as TCP session info now */
/* /* Now calculate total size of returned data */
if (offset >= (buf - buf_start)) length = buf - original_buf;
{
*beginBuffer = buf; if(offset + count >= length)
*eof = 1;
if(length < offset) {
*eof = 1;
return 0; return 0;
} else {
length = length - offset;
} }
*beginBuffer = buf + offset; if (length > count)
if ((buf - buf_start - offset) > count) length = count;
return count;
else */ return length;
return (buf - buf_start - offset);
} }
int int
...@@ -183,12 +191,14 @@ cifs_total_xid_read(char *buf, char **beginBuffer, off_t offset, ...@@ -183,12 +191,14 @@ cifs_total_xid_read(char *buf, char **beginBuffer, off_t offset,
#ifdef CONFIG_CIFS_STATS #ifdef CONFIG_CIFS_STATS
int int
cifs_stats_read(char *buf, char **beginBuffer, off_t offset, cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
int length, int *eof, void *data) int count, int *eof, void *data)
{ {
int item_length,i; int item_length,i,length;
struct list_head *tmp; struct list_head *tmp;
struct cifsTconInfo *tcon; struct cifsTconInfo *tcon;
*beginBuffer = buf + offset;
length = sprintf(buf, length = sprintf(buf,
"Resources in use\nCIFS Session: %d\n", "Resources in use\nCIFS Session: %d\n",
sesInfoAllocCount.counter); sesInfoAllocCount.counter);
...@@ -235,10 +245,12 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, ...@@ -235,10 +245,12 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
atomic_read(&tcon->num_reads), atomic_read(&tcon->num_reads),
(long long)(tcon->bytes_read)); (long long)(tcon->bytes_read));
buf += item_length; buf += item_length;
length += item_length;
item_length = sprintf(buf,"\nWrites: %d Bytes: %lld", item_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 += item_length; buf += item_length;
length += item_length;
item_length = sprintf(buf, item_length = sprintf(buf,
"\nOpens: %d Deletes: %d\nMkdirs: %d Rmdirs: %d", "\nOpens: %d Deletes: %d\nMkdirs: %d Rmdirs: %d",
atomic_read(&tcon->num_opens), atomic_read(&tcon->num_opens),
...@@ -250,6 +262,19 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, ...@@ -250,6 +262,19 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
} }
read_unlock(&GlobalSMBSeslock); read_unlock(&GlobalSMBSeslock);
buf += sprintf(buf,"\n");
length++;
if(offset + count >= length)
*eof = 1;
if(length < offset) {
*eof = 1;
return 0;
} else {
length = length - offset;
}
if (length > count)
length = count;
return length; return length;
} }
......
...@@ -93,5 +93,5 @@ extern int cifs_setxattr(struct dentry *, const char *, const void *, ...@@ -93,5 +93,5 @@ extern int cifs_setxattr(struct dentry *, const char *, const void *,
size_t, int); size_t, int);
extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t); extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t);
extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
#define CIFS_VERSION "1.18" #define CIFS_VERSION "1.19"
#endif /* _CIFSFS_H */ #endif /* _CIFSFS_H */
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