aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
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 */