Skip to content

Commit ed71e86

Browse files
kwan-intcjgunthorpe
authored andcommitted
IB/hfi1: Rename exp_lock to exp_mutex
The mutex exp_lock in struct hfi1_ctxtdata is used to protect all Expected TID data of a user context. This patch renames it to exp_mutex to better reflect its identity and prepare for upcoming patches. Reviewed-by: Ashutosh Dixit <[email protected]> Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Harish Chegondi <[email protected]> Signed-off-by: Kaike Wan <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent dc2b2a9 commit ed71e86

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

drivers/infiniband/hw/hfi1/hfi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ struct hfi1_ctxtdata {
245245
struct exp_tid_set tid_used_list;
246246
struct exp_tid_set tid_full_list;
247247

248-
/* lock protecting all Expected TID data */
249-
struct mutex exp_lock;
248+
/* lock protecting all Expected TID data of user contexts */
249+
struct mutex exp_mutex;
250250
/* per-context configuration flags */
251251
unsigned long flags;
252252
/* per-context event flags for fileops/intr communication */

drivers/infiniband/hw/hfi1/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ int hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, int numa,
368368
rcd->numa_id = numa;
369369
rcd->rcv_array_groups = dd->rcv_entries.ngroups;
370370

371-
mutex_init(&rcd->exp_lock);
371+
mutex_init(&rcd->exp_mutex);
372372

373373
hfi1_cdbg(PROC, "setting up context %u\n", rcd->ctxt);
374374

drivers/infiniband/hw/hfi1/user_exp_rcv.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright(c) 2015-2017 Intel Corporation.
2+
* Copyright(c) 2015-2018 Intel Corporation.
33
*
44
* This file is provided under a dual BSD/GPLv2 license. When using or
55
* redistributing this file, you may do so under either license.
@@ -375,7 +375,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
375375
* From this point on, we are going to be using shared (between master
376376
* and subcontexts) context resources. We need to take the lock.
377377
*/
378-
mutex_lock(&uctxt->exp_lock);
378+
mutex_lock(&uctxt->exp_mutex);
379379
/*
380380
* The first step is to program the RcvArray entries which are complete
381381
* groups.
@@ -461,7 +461,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
461461
}
462462
}
463463
unlock:
464-
mutex_unlock(&uctxt->exp_lock);
464+
mutex_unlock(&uctxt->exp_mutex);
465465
nomem:
466466
hfi1_cdbg(TID, "total mapped: tidpairs:%u pages:%u (%d)", tididx,
467467
mapped_pages, ret);
@@ -517,7 +517,7 @@ int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd,
517517
if (IS_ERR(tidinfo))
518518
return PTR_ERR(tidinfo);
519519

520-
mutex_lock(&uctxt->exp_lock);
520+
mutex_lock(&uctxt->exp_mutex);
521521
for (tididx = 0; tididx < tinfo->tidcnt; tididx++) {
522522
ret = unprogram_rcvarray(fd, tidinfo[tididx], NULL);
523523
if (ret) {
@@ -530,7 +530,7 @@ int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd,
530530
fd->tid_used -= tididx;
531531
spin_unlock(&fd->tid_lock);
532532
tinfo->tidcnt = tididx;
533-
mutex_unlock(&uctxt->exp_lock);
533+
mutex_unlock(&uctxt->exp_mutex);
534534

535535
kfree(tidinfo);
536536
return ret;

0 commit comments

Comments
 (0)