summaryrefslogtreecommitdiffstats
path: root/net/smc/smc_core.h
diff options
context:
space:
mode:
authorKarsten Graul <kgraul@linux.ibm.com>2020-04-29 17:10:48 +0200
committerDavid S. Miller <davem@davemloft.net>2020-04-29 12:26:33 -0700
commitfaca536008375bece23783e7382b5d0356c13ba5 (patch)
tree69406ee8f26c28173e6956e1547aa98a86547a42 /net/smc/smc_core.h
parentef79d439cd124d9fb7258bb35d44c71aec11b829 (diff)
downloadlinux-faca536008375bece23783e7382b5d0356c13ba5.tar.gz
linux-faca536008375bece23783e7382b5d0356c13ba5.tar.bz2
linux-faca536008375bece23783e7382b5d0356c13ba5.zip
net/smc: use mutex instead of rwlock_t to protect buffers
The locks for sndbufs and rmbs are never used from atomic context. Using a mutex for these locks will allow to nest locks with other mutexes. Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_core.h')
-rw-r--r--net/smc/smc_core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h
index d785656b3489..379ced490c49 100644
--- a/net/smc/smc_core.h
+++ b/net/smc/smc_core.h
@@ -205,9 +205,9 @@ struct smc_link_group {
unsigned short vlan_id; /* vlan id of link group */
struct list_head sndbufs[SMC_RMBE_SIZES];/* tx buffers */
- rwlock_t sndbufs_lock; /* protects tx buffers */
+ struct mutex sndbufs_lock; /* protects tx buffers */
struct list_head rmbs[SMC_RMBE_SIZES]; /* rx buffers */
- rwlock_t rmbs_lock; /* protects rx buffers */
+ struct mutex rmbs_lock; /* protects rx buffers */
u8 id[SMC_LGR_ID_SIZE]; /* unique lgr id */
struct delayed_work free_work; /* delayed freeing of an lgr */