Commit 5ec6759
cxl/region: Drop goto pattern of construct_region()
Some operations need to be protected by the cxl_region_rwsem in
construct_region(). Currently, construct_region() uses down_write() and
up_write() for the cxl_region_rwsem locking, so there is a goto pattern
after down_write() invoked to release cxl_region_rwsem.
construct region() can be optimized to remove the goto pattern. The
changes are creating a new function called __construct_region() which
will include all checking and operations protected by the
cxl_region_rwsem, and using guard(rwsem_write) to replace down_write()
and up_write() in __construct_region().
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]>1 parent 9e7b7ab commit 5ec6759
1 file changed
+39
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3216 | 3216 | | |
3217 | 3217 | | |
3218 | 3218 | | |
3219 | | - | |
3220 | | - | |
3221 | | - | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
3222 | 3222 | | |
3223 | 3223 | | |
3224 | | - | |
3225 | 3224 | | |
3226 | 3225 | | |
3227 | | - | |
3228 | 3226 | | |
3229 | 3227 | | |
3230 | 3228 | | |
3231 | | - | |
3232 | | - | |
3233 | | - | |
3234 | | - | |
3235 | | - | |
3236 | | - | |
3237 | | - | |
3238 | | - | |
3239 | | - | |
3240 | | - | |
3241 | | - | |
3242 | | - | |
3243 | | - | |
3244 | | - | |
| 3229 | + | |
3245 | 3230 | | |
3246 | 3231 | | |
3247 | 3232 | | |
3248 | 3233 | | |
3249 | 3234 | | |
3250 | 3235 | | |
3251 | | - | |
3252 | | - | |
| 3236 | + | |
3253 | 3237 | | |
3254 | 3238 | | |
3255 | 3239 | | |
3256 | 3240 | | |
3257 | 3241 | | |
3258 | | - | |
3259 | | - | |
3260 | | - | |
3261 | | - | |
| 3242 | + | |
| 3243 | + | |
3262 | 3244 | | |
3263 | 3245 | | |
3264 | 3246 | | |
| |||
3281 | 3263 | | |
3282 | 3264 | | |
3283 | 3265 | | |
3284 | | - | |
| 3266 | + | |
3285 | 3267 | | |
3286 | 3268 | | |
3287 | 3269 | | |
| |||
3290 | 3272 | | |
3291 | 3273 | | |
3292 | 3274 | | |
3293 | | - | |
3294 | 3275 | | |
3295 | | - | |
| 3276 | + | |
| 3277 | + | |
3296 | 3278 | | |
3297 | | - | |
3298 | | - | |
3299 | | - | |
3300 | | - | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
3301 | 3308 | | |
3302 | 3309 | | |
3303 | 3310 | | |
| |||
0 commit comments