@@ -59,16 +59,14 @@ static void fc_disc_restart(struct fc_disc *);
59
59
/**
60
60
* fc_disc_stop_rports() - Delete all the remote ports associated with the lport
61
61
* @disc: The discovery job to stop remote ports on
62
- *
63
- * Locking Note: This function expects that the lport mutex is locked before
64
- * calling it.
65
62
*/
66
63
static void fc_disc_stop_rports (struct fc_disc * disc )
67
64
{
68
65
struct fc_lport * lport ;
69
66
struct fc_rport_priv * rdata ;
70
67
71
68
lport = fc_disc_lport (disc );
69
+ lockdep_assert_held (& lport -> lp_mutex );
72
70
73
71
rcu_read_lock ();
74
72
list_for_each_entry_rcu (rdata , & disc -> rports , peers ) {
@@ -84,9 +82,6 @@ static void fc_disc_stop_rports(struct fc_disc *disc)
84
82
* fc_disc_recv_rscn_req() - Handle Registered State Change Notification (RSCN)
85
83
* @disc: The discovery object to which the RSCN applies
86
84
* @fp: The RSCN frame
87
- *
88
- * Locking Note: This function expects that the disc_mutex is locked
89
- * before it is called.
90
85
*/
91
86
static void fc_disc_recv_rscn_req (struct fc_disc * disc , struct fc_frame * fp )
92
87
{
@@ -101,6 +96,8 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp)
101
96
LIST_HEAD (disc_ports );
102
97
struct fc_disc_port * dp , * next ;
103
98
99
+ lockdep_assert_held (& disc -> disc_mutex );
100
+
104
101
lport = fc_disc_lport (disc );
105
102
106
103
FC_DISC_DBG (disc , "Received an RSCN event\n" );
@@ -220,12 +217,11 @@ static void fc_disc_recv_req(struct fc_lport *lport, struct fc_frame *fp)
220
217
/**
221
218
* fc_disc_restart() - Restart discovery
222
219
* @disc: The discovery object to be restarted
223
- *
224
- * Locking Note: This function expects that the disc mutex
225
- * is already locked.
226
220
*/
227
221
static void fc_disc_restart (struct fc_disc * disc )
228
222
{
223
+ lockdep_assert_held (& disc -> disc_mutex );
224
+
229
225
if (!disc -> disc_callback )
230
226
return ;
231
227
@@ -271,16 +267,13 @@ static void fc_disc_start(void (*disc_callback)(struct fc_lport *,
271
267
* fc_disc_done() - Discovery has been completed
272
268
* @disc: The discovery context
273
269
* @event: The discovery completion status
274
- *
275
- * Locking Note: This function expects that the disc mutex is locked before
276
- * it is called. The discovery callback is then made with the lock released,
277
- * and the lock is re-taken before returning from this function
278
270
*/
279
271
static void fc_disc_done (struct fc_disc * disc , enum fc_disc_event event )
280
272
{
281
273
struct fc_lport * lport = fc_disc_lport (disc );
282
274
struct fc_rport_priv * rdata ;
283
275
276
+ lockdep_assert_held (& disc -> disc_mutex );
284
277
FC_DISC_DBG (disc , "Discovery complete\n" );
285
278
286
279
disc -> pending = 0 ;
@@ -360,15 +353,14 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
360
353
/**
361
354
* fc_disc_gpn_ft_req() - Send Get Port Names by FC-4 type (GPN_FT) request
362
355
* @lport: The discovery context
363
- *
364
- * Locking Note: This function expects that the disc_mutex is locked
365
- * before it is called.
366
356
*/
367
357
static void fc_disc_gpn_ft_req (struct fc_disc * disc )
368
358
{
369
359
struct fc_frame * fp ;
370
360
struct fc_lport * lport = fc_disc_lport (disc );
371
361
362
+ lockdep_assert_held (& disc -> disc_mutex );
363
+
372
364
WARN_ON (!fc_lport_test_ready (lport ));
373
365
374
366
disc -> pending = 1 ;
@@ -658,15 +650,14 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
658
650
* @lport: The local port to initiate discovery on
659
651
* @rdata: remote port private data
660
652
*
661
- * Locking Note: This function expects that the disc_mutex is locked
662
- * before it is called.
663
653
* On failure, an error code is returned.
664
654
*/
665
655
static int fc_disc_gpn_id_req (struct fc_lport * lport ,
666
656
struct fc_rport_priv * rdata )
667
657
{
668
658
struct fc_frame * fp ;
669
659
660
+ lockdep_assert_held (& lport -> disc .disc_mutex );
670
661
fp = fc_frame_alloc (lport , sizeof (struct fc_ct_hdr ) +
671
662
sizeof (struct fc_ns_fid ));
672
663
if (!fp )
@@ -683,14 +674,13 @@ static int fc_disc_gpn_id_req(struct fc_lport *lport,
683
674
* fc_disc_single() - Discover the directory information for a single target
684
675
* @lport: The local port the remote port is associated with
685
676
* @dp: The port to rediscover
686
- *
687
- * Locking Note: This function expects that the disc_mutex is locked
688
- * before it is called.
689
677
*/
690
678
static int fc_disc_single (struct fc_lport * lport , struct fc_disc_port * dp )
691
679
{
692
680
struct fc_rport_priv * rdata ;
693
681
682
+ lockdep_assert_held (& lport -> disc .disc_mutex );
683
+
694
684
rdata = fc_rport_create (lport , dp -> port_id );
695
685
if (!rdata )
696
686
return - ENOMEM ;
0 commit comments