Unverified Commit 7d7cb26c authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!2407 Revert "uacce: use filep->f_mapping to replace inode->i_mapping"

parents 9efec075 aa609da5
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -350,7 +350,7 @@ static int uacce_fops_open(struct inode *inode, struct file *filep)
	init_waitqueue_head(&q->wait);
	filep->private_data = q;
	q->state = UACCE_Q_INIT;
	q->private_data = filep;
	q->mapping = filep->f_mapping;
	mutex_init(&q->mutex);
	list_add(&q->list, &uacce->queues);
	mutex_unlock(&uacce->mutex);
@@ -1047,8 +1047,6 @@ void uacce_remove(struct uacce_device *uacce)
	mutex_lock(&uacce->mutex);
	/* ensure no open queue remains */
	list_for_each_entry_safe(q, next_q, &uacce->queues, list) {
		struct file *filep = q->private_data;

		/*
		 * Taking q->mutex ensures that fops do not use the defunct
		 * uacce->ops after the queue is disabled.
@@ -1062,7 +1060,7 @@ void uacce_remove(struct uacce_device *uacce)
		 * unmap remaining mapping from user space, preventing user still
		 * access the mmaped area while parent device is already removed
		 */
		unmap_mapping_range(filep->f_mapping, 0, 0, 1);
		unmap_mapping_range(q->mapping, 0, 0, 1);
	}

	/* disable sva now since no opened queues */
+2 −2
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ enum uacce_q_state {
 * @state: queue state machine
 * @pasid: pasid associated to the mm
 * @handle: iommu_sva handle returned by iommu_sva_bind_device()
 * @private_data: private data for saving filep
 * @mapping: user space mapping of the queue
 */
struct uacce_queue {
	struct uacce_device *uacce;
@@ -130,7 +130,7 @@ struct uacce_queue {
	enum uacce_q_state state;
	u32 pasid;
	struct iommu_sva *handle;
	void *private_data;
	struct address_space *mapping;
};

/**