blob: c827f694551cba08e3b5de59ef16224767b8aef7 [file] [log] [blame]
Dominique Martinet024b7d62021-11-02 22:12:01 +09001// SPDX-License-Identifier: LGPL-2.1
Venkateswararao Jujjuri (JV)022cae362011-01-28 14:11:13 -08002/*
3 * Copyright IBM Corporation, 2010
4 * Author Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Venkateswararao Jujjuri (JV)022cae362011-01-28 14:11:13 -08005 */
6
Al Virodcdbd7b2015-04-02 23:11:36 -04007#include <linux/mm.h>
Venkateswararao Jujjuri (JV)022cae362011-01-28 14:11:13 -08008#include <linux/module.h>
Adeodato Simó52ad2592018-11-13 03:28:53 -03009#include "trans_common.h"
Venkateswararao Jujjuri (JV)022cae362011-01-28 14:11:13 -080010
11/**
Andrew Lunn760b3d62020-10-31 19:26:55 +010012 * p9_release_pages - Release pages after the transaction.
13 * @pages: array of pages to be put
14 * @nr_pages: size of array
Venkateswararao Jujjuri (JV)022cae362011-01-28 14:11:13 -080015 */
Aneesh Kumar K.Vabfa0342011-08-16 10:50:10 +053016void p9_release_pages(struct page **pages, int nr_pages)
Venkateswararao Jujjuri (JV)022cae362011-01-28 14:11:13 -080017{
Sasha Levin110ecd62013-07-11 13:16:54 -040018 int i;
19
20 for (i = 0; i < nr_pages; i++)
21 if (pages[i])
22 put_page(pages[i]);
Venkateswararao Jujjuri (JV)022cae362011-01-28 14:11:13 -080023}
Aneesh Kumar K.Vabfa0342011-08-16 10:50:10 +053024EXPORT_SYMBOL(p9_release_pages);