diff options
author | Steve French <sfrench@us.ibm.com> | 2005-08-24 16:59:35 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-08-24 16:59:35 -0400 |
commit | a45443475835ab4d1c753159812aca21b5c333a3 (patch) | |
tree | 308c2535875dec62bdafae3d3ed2a98af588d608 /fs/cifs/file.c | |
parent | 6b8edfe0f918e7585acb3bd63f62ff56e32dd3d2 (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/file.c')
-rw-r--r-- | fs/cifs/file.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index b054df2dee1e..5857d12611e6 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -744,13 +744,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, | |||
744 | 15 seconds is plenty */ | 744 | 15 seconds is plenty */ |
745 | } | 745 | } |
746 | 746 | ||
747 | #ifdef CONFIG_CIFS_STATS | 747 | cifs_stats_bytes_written(pTcon, total_written); |
748 | if (total_written > 0) { | ||
749 | spin_lock(&pTcon->stat_lock); | ||
750 | pTcon->bytes_written += total_written; | ||
751 | spin_unlock(&pTcon->stat_lock); | ||
752 | } | ||
753 | #endif | ||
754 | 748 | ||
755 | /* since the write may have blocked check these pointers again */ | 749 | /* since the write may have blocked check these pointers again */ |
756 | if (file->f_dentry) { | 750 | if (file->f_dentry) { |
@@ -878,13 +872,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data, | |||
878 | 15 seconds is plenty */ | 872 | 15 seconds is plenty */ |
879 | } | 873 | } |
880 | 874 | ||
881 | #ifdef CONFIG_CIFS_STATS | 875 | cifs_stats_bytes_written(pTcon, total_written); |
882 | if (total_written > 0) { | ||
883 | spin_lock(&pTcon->stat_lock); | ||
884 | pTcon->bytes_written += total_written; | ||
885 | spin_unlock(&pTcon->stat_lock); | ||
886 | } | ||
887 | #endif | ||
888 | 876 | ||
889 | /* since the write may have blocked check these pointers again */ | 877 | /* since the write may have blocked check these pointers again */ |
890 | if (file->f_dentry) { | 878 | if (file->f_dentry) { |
@@ -1245,11 +1233,7 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data, | |||
1245 | return rc; | 1233 | return rc; |
1246 | } | 1234 | } |
1247 | } else { | 1235 | } else { |
1248 | #ifdef CONFIG_CIFS_STATS | 1236 | cifs_stats_bytes_read(pTcon, bytes_read); |
1249 | spin_lock(&pTcon->stat_lock); | ||
1250 | pTcon->bytes_read += total_read; | ||
1251 | spin_unlock(&pTcon->stat_lock); | ||
1252 | #endif | ||
1253 | *poffset += bytes_read; | 1237 | *poffset += bytes_read; |
1254 | } | 1238 | } |
1255 | } | 1239 | } |
@@ -1312,11 +1296,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
1312 | return rc; | 1296 | return rc; |
1313 | } | 1297 | } |
1314 | } else { | 1298 | } else { |
1315 | #ifdef CONFIG_CIFS_STATS | 1299 | cifs_stats_bytes_read(pTcon, total_read); |
1316 | spin_lock(&pTcon->stat_lock); | ||
1317 | pTcon->bytes_read += total_read; | ||
1318 | spin_unlock(&pTcon->stat_lock); | ||
1319 | #endif | ||
1320 | *poffset += bytes_read; | 1300 | *poffset += bytes_read; |
1321 | } | 1301 | } |
1322 | } | 1302 | } |
@@ -1488,11 +1468,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
1488 | le16_to_cpu(pSMBr->DataOffset), &lru_pvec); | 1468 | le16_to_cpu(pSMBr->DataOffset), &lru_pvec); |
1489 | 1469 | ||
1490 | i += bytes_read >> PAGE_CACHE_SHIFT; | 1470 | i += bytes_read >> PAGE_CACHE_SHIFT; |
1491 | #ifdef CONFIG_CIFS_STATS | 1471 | cifs_stats_bytes_read(pTcon, bytes_read); |
1492 | spin_lock(&pTcon->stat_lock); | ||
1493 | pTcon->bytes_read += bytes_read; | ||
1494 | spin_unlock(&pTcon->stat_lock); | ||
1495 | #endif | ||
1496 | if ((int)(bytes_read & PAGE_CACHE_MASK) != bytes_read) { | 1472 | if ((int)(bytes_read & PAGE_CACHE_MASK) != bytes_read) { |
1497 | i++; /* account for partial page */ | 1473 | i++; /* account for partial page */ |
1498 | 1474 | ||