@@ -36,19 +36,21 @@ void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
36
36
EXPORT_SYMBOL_GPL (vhost_iotlb_map_free );
37
37
38
38
/**
39
- * vhost_iotlb_add_range - add a new range to vhost IOTLB
39
+ * vhost_iotlb_add_range_ctx - add a new range to vhost IOTLB
40
40
* @iotlb: the IOTLB
41
41
* @start: start of the IOVA range
42
42
* @last: last of IOVA range
43
43
* @addr: the address that is mapped to @start
44
44
* @perm: access permission of this range
45
+ * @opaque: the opaque pointer for the new mapping
45
46
*
46
47
* Returns an error last is smaller than start or memory allocation
47
48
* fails
48
49
*/
49
- int vhost_iotlb_add_range (struct vhost_iotlb * iotlb ,
50
- u64 start , u64 last ,
51
- u64 addr , unsigned int perm )
50
+ int vhost_iotlb_add_range_ctx (struct vhost_iotlb * iotlb ,
51
+ u64 start , u64 last ,
52
+ u64 addr , unsigned int perm ,
53
+ void * opaque )
52
54
{
53
55
struct vhost_iotlb_map * map ;
54
56
@@ -71,6 +73,7 @@ int vhost_iotlb_add_range(struct vhost_iotlb *iotlb,
71
73
map -> last = last ;
72
74
map -> addr = addr ;
73
75
map -> perm = perm ;
76
+ map -> opaque = opaque ;
74
77
75
78
iotlb -> nmaps ++ ;
76
79
vhost_iotlb_itree_insert (map , & iotlb -> root );
@@ -80,6 +83,15 @@ int vhost_iotlb_add_range(struct vhost_iotlb *iotlb,
80
83
81
84
return 0 ;
82
85
}
86
+ EXPORT_SYMBOL_GPL (vhost_iotlb_add_range_ctx );
87
+
88
+ int vhost_iotlb_add_range (struct vhost_iotlb * iotlb ,
89
+ u64 start , u64 last ,
90
+ u64 addr , unsigned int perm )
91
+ {
92
+ return vhost_iotlb_add_range_ctx (iotlb , start , last ,
93
+ addr , perm , NULL );
94
+ }
83
95
EXPORT_SYMBOL_GPL (vhost_iotlb_add_range );
84
96
85
97
/**
0 commit comments