diff options
author | Jeff Layton <jlayton@redhat.com> | 2011-01-11 07:24:02 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-01-19 12:52:38 -0500 |
commit | 8097531a5cb55c6472118da094dc88caf9be66ac (patch) | |
tree | 77707f0bc5fe63e08844426ffe878a0191f4faef /fs | |
parent | c5797a945cac4c470f0113fc839c521aab0d799d (diff) |
cifs: clean up accesses to midCount
It's an atomic_t and the code accesses the "counter" field in it directly
instead of using atomic_read(). It also is sometimes accessed under a
spinlock and sometimes not. Move it out of the spinlock since we don't need
belt-and-suspenders for something that's just informational.
Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de>
Reviewed-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifs_debug.c | 2 | ||||
-rw-r--r-- | fs/cifs/connect.c | 2 | ||||
-rw-r--r-- | fs/cifs/transport.c | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index ede98300a8cd..e2d0d5d455fa 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -331,7 +331,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) | |||
331 | atomic_read(&totSmBufAllocCount)); | 331 | atomic_read(&totSmBufAllocCount)); |
332 | #endif /* CONFIG_CIFS_STATS2 */ | 332 | #endif /* CONFIG_CIFS_STATS2 */ |
333 | 333 | ||
334 | seq_printf(m, "Operations (MIDs): %d\n", midCount.counter); | 334 | seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount)); |
335 | seq_printf(m, | 335 | seq_printf(m, |
336 | "\n%d session %d share reconnects\n", | 336 | "\n%d session %d share reconnects\n", |
337 | tcpSesReconnectCount.counter, tconInfoReconnectCount.counter); | 337 | tcpSesReconnectCount.counter, tconInfoReconnectCount.counter); |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 75b538f50b12..465ecad6d7cc 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -628,7 +628,7 @@ multi_t2_fnd: | |||
628 | } else if (!is_valid_oplock_break(smb_buffer, server) && | 628 | } else if (!is_valid_oplock_break(smb_buffer, server) && |
629 | !isMultiRsp) { | 629 | !isMultiRsp) { |
630 | cERROR(1, "No task to wake, unknown frame received! " | 630 | cERROR(1, "No task to wake, unknown frame received! " |
631 | "NumMids %d", midCount.counter); | 631 | "NumMids %d", atomic_read(&midCount)); |
632 | cifs_dump_mem("Received Data is: ", (char *)smb_buffer, | 632 | cifs_dump_mem("Received Data is: ", (char *)smb_buffer, |
633 | sizeof(struct smb_hdr)); | 633 | sizeof(struct smb_hdr)); |
634 | #ifdef CONFIG_CIFS_DEBUG2 | 634 | #ifdef CONFIG_CIFS_DEBUG2 |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 9a14f77e0ab2..b9eb0cffa003 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -61,10 +61,10 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) | |||
61 | temp->tsk = current; | 61 | temp->tsk = current; |
62 | } | 62 | } |
63 | 63 | ||
64 | spin_lock(&GlobalMid_Lock); | ||
65 | list_add_tail(&temp->qhead, &server->pending_mid_q); | ||
66 | atomic_inc(&midCount); | 64 | atomic_inc(&midCount); |
67 | temp->midState = MID_REQUEST_ALLOCATED; | 65 | temp->midState = MID_REQUEST_ALLOCATED; |
66 | spin_lock(&GlobalMid_Lock); | ||
67 | list_add_tail(&temp->qhead, &server->pending_mid_q); | ||
68 | spin_unlock(&GlobalMid_Lock); | 68 | spin_unlock(&GlobalMid_Lock); |
69 | return temp; | 69 | return temp; |
70 | } | 70 | } |
@@ -78,8 +78,8 @@ DeleteMidQEntry(struct mid_q_entry *midEntry) | |||
78 | spin_lock(&GlobalMid_Lock); | 78 | spin_lock(&GlobalMid_Lock); |
79 | midEntry->midState = MID_FREE; | 79 | midEntry->midState = MID_FREE; |
80 | list_del(&midEntry->qhead); | 80 | list_del(&midEntry->qhead); |
81 | atomic_dec(&midCount); | ||
82 | spin_unlock(&GlobalMid_Lock); | 81 | spin_unlock(&GlobalMid_Lock); |
82 | atomic_dec(&midCount); | ||
83 | if (midEntry->largeBuf) | 83 | if (midEntry->largeBuf) |
84 | cifs_buf_release(midEntry->resp_buf); | 84 | cifs_buf_release(midEntry->resp_buf); |
85 | else | 85 | else |