Commit 50d63b5
vfio: Change vfio_external_user_iommu_id() to vfio_file_iommu_group()
The only caller wants to get a pointer to the struct iommu_group
associated with the VFIO group file. Instead of returning the group ID
then searching sysfs for that string to get the struct iommu_group just
directly return the iommu_group pointer already held by the vfio_group
struct.
It already has a safe lifetime due to the struct file kref, the vfio_group
and thus the iommu_group cannot be destroyed while the group file is open.
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/3-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>1 parent d55d9e7 commit 50d63b5
3 files changed
Lines changed: 27 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
| 1656 | + | |
1660 | 1657 | | |
1661 | 1658 | | |
1662 | 1659 | | |
| |||
1697 | 1694 | | |
1698 | 1695 | | |
1699 | 1696 | | |
1700 | | - | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
1701 | 1704 | | |
1702 | | - | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1703 | 1710 | | |
1704 | | - | |
| 1711 | + | |
1705 | 1712 | | |
1706 | 1713 | | |
1707 | 1714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | | - | |
114 | | - | |
| 113 | + | |
| 114 | + | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 127 | | |
139 | | - | |
| 128 | + | |
140 | 129 | | |
141 | | - | |
| 130 | + | |
142 | 131 | | |
143 | 132 | | |
144 | 133 | | |
145 | 134 | | |
146 | 135 | | |
147 | | - | |
148 | 136 | | |
149 | 137 | | |
150 | 138 | | |
| |||
258 | 246 | | |
259 | 247 | | |
260 | 248 | | |
261 | | - | |
| 249 | + | |
262 | 250 | | |
263 | 251 | | |
264 | 252 | | |
| |||
304 | 292 | | |
305 | 293 | | |
306 | 294 | | |
307 | | - | |
| 295 | + | |
308 | 296 | | |
309 | 297 | | |
310 | 298 | | |
311 | 299 | | |
312 | 300 | | |
313 | 301 | | |
314 | 302 | | |
315 | | - | |
316 | 303 | | |
317 | 304 | | |
318 | 305 | | |
| |||
388 | 375 | | |
389 | 376 | | |
390 | 377 | | |
391 | | - | |
| 378 | + | |
392 | 379 | | |
393 | 380 | | |
394 | 381 | | |
| |||
0 commit comments