OSDN Git Service

iommu/vt-d: Refactor find_domain() helper
authorLu Baolu <baolu.lu@linux.intel.com>
Sat, 21 Sep 2019 07:06:44 +0000 (15:06 +0800)
committerJoerg Roedel <jroedel@suse.de>
Tue, 15 Oct 2019 09:52:25 +0000 (11:52 +0200)
commit1ee0186b9a128a872887e16e2d1520ea37a95dc4
treee0835eb23e87ed4fc2fe11fae4b4d82b2c8bc37e
parent4f5cafb5cb8471e54afdc9054d973535614f7675
iommu/vt-d: Refactor find_domain() helper

Current find_domain() helper checks and does the deferred domain
attachment and return the domain in use. This isn't always the
use case for the callers. Some callers only want to retrieve the
current domain in use.

This refactors find_domain() into two helpers: 1) find_domain()
only returns the domain in use; 2) deferred_attach_domain() does
the deferred domain attachment if required and return the domain
in use.

Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c