/*
* fs/cifs_debug.c
*
- * Copyright (C) International Business Machines Corp., 2000,2003
+ * Copyright (C) International Business Machines Corp., 2000,2005
*
* Modified by Steve French (sfrench@us.ibm.com)
*
#include "cifsglob.h"
#include "cifsproto.h"
#include "cifs_debug.h"
+#include "cifsfs.h"
void
cifs_dump_mem(char *label, void *data, int length)
}
#ifdef CONFIG_PROC_FS
-int
+static int
cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
int count, int *eof, void *data)
{
"Display Internal CIFS Data Structures for Debugging\n"
"---------------------------------------------------\n");
buf += length;
-
- length = sprintf(buf, "Servers:\n");
+ length = sprintf(buf,"CIFS Version %s\n",CIFS_VERSION);
+ buf += length;
+ length = sprintf(buf, "Servers:");
buf += length;
i = 0;
list_for_each(tmp, &GlobalSMBSessionList) {
i++;
ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList);
- length =
- sprintf(buf,
- "\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),
- ses->serverOS, ses->serverNOS, ses->capabilities,ses->status,ses->server->tcpStatus);
- buf += length;
+ if((ses->serverDomain == NULL) || (ses->serverOS == NULL) ||
+ (ses->serverNOS == NULL)) {
+ buf += sprintf("\nentry for %s not fully displayed\n\t",
+ ses->serverName);
+
+ } else {
+ length =
+ sprintf(buf,
+ "\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\t",
+ i, ses->serverName, ses->serverDomain,
+ atomic_read(&ses->inUse),
+ ses->serverOS, ses->serverNOS,
+ ses->capabilities,ses->status);
+ buf += length;
+ }
if(ses->server) {
- buf += sprintf(buf, "\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d",
+ buf += sprintf(buf, "TCP status: %d\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d",
+ ses->server->tcpStatus,
atomic_read(&ses->server->socketUseCount),
ses->server->secMode,
atomic_read(&ses->server->inFlight));
- length = sprintf(buf, "\nMIDs: \n");
+ length = sprintf(buf, "\nMIDs:\n");
buf += length;
spin_lock(&GlobalMid_Lock);
mid_q_entry,
qhead);
if(mid_entry) {
- length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p mid %d\n",mid_entry->midState,mid_entry->command,mid_entry->pid,mid_entry->tsk,mid_entry->mid);
+ length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p mid %d\n",
+ mid_entry->midState,
+ (int)mid_entry->command,
+ mid_entry->pid,
+ mid_entry->tsk,
+ mid_entry->mid);
buf += length;
}
}
sprintf(buf, "\n");
buf++;
- length = sprintf(buf, "\nShares:\n");
+ length = sprintf(buf, "Shares:");
buf += length;
i = 0;
}
#ifdef CONFIG_CIFS_STATS
-int
+static int
cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
int count, int *eof, void *data)
{
length += item_length;
buf += item_length;
item_length =
- sprintf(buf,"SMB Request/Response Buffer: %d\n",
- bufAllocCount.counter);
+ sprintf(buf,"SMB Request/Response Buffer: %d Pool size: %d\n",
+ bufAllocCount.counter,
+ cifs_min_rcv + tcpSesAllocCount.counter);
length += item_length;
- buf += item_length;
+ buf += item_length;
+ item_length =
+ sprintf(buf,"SMB Small Req/Resp Buffer: %d Pool size: %d\n",
+ smBufAllocCount.counter,cifs_min_small);
+ length += item_length;
+ buf += item_length;
item_length =
sprintf(buf,"Operations (MIDs): %d\n",
midCount.counter);
}
#endif
-struct proc_dir_entry *proc_fs_cifs;
+static struct proc_dir_entry *proc_fs_cifs;
read_proc_t cifs_txanchor_read;
static read_proc_t cifsFYI_read;
static write_proc_t cifsFYI_write;
if (pde)
pde->write_proc = oplockEnabled_write;
- pde = create_proc_read_entry("QuotaEnabled", 0, proc_fs_cifs,
+ pde = create_proc_read_entry("ReenableOldCifsReaddirCode", 0, proc_fs_cifs,
quotaEnabled_read, NULL);
if (pde)
pde->write_proc = quotaEnabled_write;
remove_proc_entry("ExtendedSecurity",proc_fs_cifs);
remove_proc_entry("PacketSigningEnabled",proc_fs_cifs);
remove_proc_entry("LinuxExtensionsEnabled",proc_fs_cifs);
- remove_proc_entry("QuotaEnabled",proc_fs_cifs);
+ remove_proc_entry("ReenableOldCifsReaddirCode",proc_fs_cifs);
remove_proc_entry("LookupCacheEnabled",proc_fs_cifs);
remove_proc_entry("cifs", proc_root_fs);
}
{
int len;
- len = sprintf(page, "%d\n", quotaEnabled);
+ len = sprintf(page, "%d\n", experimEnabled);
/* could also check if quotas are enabled in kernel
as a whole first */
len -= off;
if (rc)
return rc;
if (c == '0' || c == 'n' || c == 'N')
- quotaEnabled = 0;
+ experimEnabled = 0;
else if (c == '1' || c == 'y' || c == 'Y')
- quotaEnabled = 1;
+ experimEnabled = 1;
return count;
}