aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-08-24 16:59:35 -0400
committerSteve French <sfrench@us.ibm.com>2005-08-24 16:59:35 -0400
commita45443475835ab4d1c753159812aca21b5c333a3 (patch)
tree308c2535875dec62bdafae3d3ed2a98af588d608 /fs/cifs/cifsglob.h
parent6b8edfe0f918e7585acb3bd63f62ff56e32dd3d2 (diff)
CIFS: Reduce CONFIG_CIFS_STATS ifdefs
Make cifs_stats code conditional in the header files to avoid ifdefs in the main code. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index f143975627e0..9a3c85bdd77e 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -339,6 +339,34 @@ static inline const char CIFS_DIR_SEP(const struct cifs_sb_info *cifs_sb)
339 return '\\'; 339 return '\\';
340} 340}
341 341
342#ifdef CONFIG_CIFS_STATS
343#define cifs_stats_inc atomic_inc
344
345static inline void cifs_stats_bytes_written(struct cifsTconInfo *tcon,
346 unsigned int bytes)
347{
348 if (bytes) {
349 spin_lock(&tcon->stat_lock);
350 tcon->bytes_written += bytes;
351 spin_unlock(&tcon->stat_lock);
352 }
353}
354
355static inline void cifs_stats_bytes_read(struct cifsTconInfo *tcon,
356 unsigned int bytes)
357{
358 spin_lock(&tcon->stat_lock);
359 tcon->bytes_read += bytes;
360 spin_unlock(&tcon->stat_lock);
361}
362#else
363
364#define cifs_stats_inc(field) do {} while(0)
365#define cifs_stats_bytes_written(tcon, bytes) do {} while(0)
366#define cifs_stats_bytes_read(tcon, bytes) do {} while(0)
367
368#endif
369
342/* one of these for every pending CIFS request to the server */ 370/* one of these for every pending CIFS request to the server */
343struct mid_q_entry { 371struct mid_q_entry {
344 struct list_head qhead; /* mids waiting on reply from this server */ 372 struct list_head qhead; /* mids waiting on reply from this server */