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 <Jonathan.Cameron@huawei.com> Reviewed-by:
Dave Jiang <dave.jiang@intel.com> Reviewed-by:
Alison Schofield <alison.schofield@intel.com> Reviewed-by:
Dan Williams <dan.j.williams@intel.com> Reviewed-by:
Ira Weiny <ira.weiny@intel.com> Acked-by:
Davidlohr Bueso <dave@stgolabs.net> Signed-off-by:
Li Ming <ming.li@zohomail.com> Link: https://patch.msgid.link/20250221013205.126419-1-ming.li@zohomail.com Signed-off-by:
Dave Jiang <dave.jiang@intel.com>
Loading
Please register or sign in to comment