X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fcifs%2Fmisc.c;h=f3e258d11e89ced137fe45101fd532480098a867;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=ca96ffe2c80e67f7c70d66dd8443eb27c5a90d4b;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index ca96ffe2c..f3e258d11 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c @@ -21,6 +21,7 @@ #include #include +#include #include "cifspdu.h" #include "cifsglob.h" #include "cifsproto.h" @@ -28,7 +29,7 @@ #include "smberr.h" #include "nterr.h" -extern kmem_cache_t *cifs_req_cachep; +extern mempool_t *cifs_req_poolp; extern struct task_struct * oplockThread; __u16 GlobalMid; /* multiplex id - rotating counter */ @@ -122,6 +123,9 @@ tconInfoAlloc(void) ret_buf->tidStatus = CifsNew; INIT_LIST_HEAD(&ret_buf->openFileList); init_MUTEX(&ret_buf->tconSem); +#ifdef CONFIG_CIFS_STATS + ret_buf->stat_lock = SPIN_LOCK_UNLOCKED; +#endif write_unlock(&GlobalSMBSeslock); } return ret_buf; @@ -146,14 +150,14 @@ tconInfoFree(struct cifsTconInfo *buf_to_free) struct smb_hdr * cifs_buf_get(void) { - struct smb_hdr *ret_buf = 0; + struct smb_hdr *ret_buf = NULL; /* We could use negotiated size instead of max_msgsize - but it may be more efficient to always alloc same size albeit slightly larger than necessary and maxbuffersize defaults to this and can not be bigger */ ret_buf = - (struct smb_hdr *) kmem_cache_alloc(cifs_req_cachep, SLAB_KERNEL | SLAB_NOFS); + (struct smb_hdr *) mempool_alloc(cifs_req_poolp, SLAB_KERNEL | SLAB_NOFS); /* clear the first few header bytes */ if (ret_buf) { @@ -172,7 +176,7 @@ cifs_buf_release(void *buf_to_free) cFYI(1, ("Null buffer passed to cifs_buf_release")); return; } - kmem_cache_free(cifs_req_cachep, buf_to_free); + mempool_free(buf_to_free,cifs_req_poolp); atomic_dec(&bufAllocCount); return; @@ -391,6 +395,9 @@ is_valid_oplock_break(struct smb_hdr *buf) list_for_each(tmp, &GlobalTreeConnectionList) { tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); if (tcon->tid == buf->Tid) { +#ifdef CONFIG_CIFS_STATS + atomic_inc(&tcon->num_oplock_brks); +#endif list_for_each(tmp1,&tcon->openFileList){ netfile = list_entry(tmp1,struct cifsFileInfo,tlist); if(pSMB->Fid == netfile->netfid) {