diff options
| author | Li Ming <[email protected]> | 2025-02-21 01:24:51 +0000 |
|---|---|---|
| committer | Dave Jiang <[email protected]> | 2025-03-14 21:45:04 +0000 |
| commit | a81ebe7d19b6fdc6de0159878fbed9945120813e (patch) | |
| tree | 4df2864731898d9bf91c720ce8460944e4065c46 /net/unix/af_unix.c | |
| parent | cxl/core: Use guard() to drop the goto pattern of cxl_dpa_free() (diff) | |
| download | kernel-a81ebe7d19b6fdc6de0159878fbed9945120813e.tar.gz kernel-a81ebe7d19b6fdc6de0159878fbed9945120813e.zip | |
cxl/core: Use guard() to drop goto pattern of cxl_dpa_alloc()
In cxl_dpa_alloc(), some checking and operations need to be protected by
a rwsem called cxl_dpa_rwsem, so there is a goto pattern in
cxl_dpa_alloc() to release the rwsem. The goto pattern can be optimized
by using guard() to hold the rwsem.
Creating a new function called __cxl_dpa_alloc() to include all checking
and operations needed to be protected by cxl_dpa_rwsem. Using
guard(rwsem_write()) to hold cxl_dpa_rwsem at the beginning of the new
function.
Reviewed-by: Jonathan Cameron <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Alison Schofield <[email protected]>
Reviewed-by: Dan Williams <[email protected]>
Reviewed-by: Ira Weiny <[email protected]>
Acked-by: Davidlohr Bueso <[email protected]>
Signed-off-by: Li Ming <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Dave Jiang <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
