Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 959804ef authored by Michael Bestas's avatar Michael Bestas
Browse files

erofs: Switch to attach/detach_page_private

Matches upstream behaviour

Change-Id: Ia85c5472aef465ec5beffc494bf4a4c6edc0bd16
parent 1d696af8
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -331,11 +331,8 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,

		/* barrier is implied in the following 'unlock_page' */
		WRITE_ONCE(pcl->compressed_pages[i], NULL);

		set_page_private(page, 0);
		ClearPagePrivate(page);
		detach_page_private(page);
		unlock_page(page);
		put_page(page);
	}
	return 0;
}
@@ -358,11 +355,8 @@ int erofs_try_to_free_cached_page(struct address_space *mapping,
		}
		erofs_workgroup_unfreeze(&pcl->obj, 1);

		if (ret) {
			set_page_private(page, 0);
			ClearPagePrivate(page);
			put_page(page);
		}
		if (ret)
			detach_page_private(page);
	}
	return ret;
}
@@ -1184,8 +1178,9 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
		set_page_private(page, Z_EROFS_SHORTLIVED_PAGE);
		goto out;
	}
	set_page_private(page, (unsigned long)pcl);
	SetPagePrivate(page);
	attach_page_private(page, pcl);
	/* drop a refcount added by allocpage (then we have 2 refs here) */
	put_page(page);

out:	/* the only exit (for tracing and debugging) */
	return page;