diff --git a/drivers/soc/qcom/mem_buf/mem-buf-ids.c b/drivers/soc/qcom/mem_buf/mem-buf-ids.c index a81f7f7bf347..846c7fb038ff 100644 --- a/drivers/soc/qcom/mem_buf/mem-buf-ids.c +++ b/drivers/soc/qcom/mem_buf/mem-buf-ids.c @@ -82,6 +82,12 @@ struct mem_buf_vm *pdata_array[] = { NULL, }; +int mem_buf_current_vmid(void) +{ + return current_vmid; +} +EXPORT_SYMBOL(mem_buf_current_vmid); + /* * Opening this file acquires a refcount on vm->dev's kobject - see * chrdev_open(). So private data won't be free'd out from diff --git a/include/linux/mem-buf.h b/include/linux/mem-buf.h index 8c08679abd52..43823d1304ae 100644 --- a/include/linux/mem-buf.h +++ b/include/linux/mem-buf.h @@ -104,6 +104,7 @@ int mem_buf_reclaim(struct dma_buf *dmabuf); void *mem_buf_alloc(struct mem_buf_allocation_data *alloc_data); void mem_buf_free(void *membuf); struct gh_sgl_desc *mem_buf_get_sgl(void *membuf); +int mem_buf_current_vmid(void); #else static inline void *mem_buf_alloc(struct mem_buf_allocation_data *alloc_data) @@ -117,6 +118,10 @@ static inline struct gh_sgl_desc *mem_buf_get_sgl(void *membuf) { return ERR_PTR(-EINVAL); } +static inline int mem_buf_current_vmid(void) +{ + return ERR_PTR(-EINVAL); +} #endif /* CONFIG_QCOM_MEM_BUF */