Commit 46d673d7 authored by Chen Wandun's avatar Chen Wandun Committed by Zheng Zengkai
Browse files

mm/swapfile: fix broken kabi in swap_info_struct

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I645JI



-------------------------------

This patch fix kabi problem introduced by commit
("mm/swapfile:use percpu_ref to serialize against concurrent swapoff").

Considering swap_info_struct is referenced by pointer and dont use
in third module, so use KABI_EXTEND for two new member variables in
swap_info_struct. Besides, dont remove unused enum value SWP_VALID,
avoid unnecessary undefined alarms.

Signed-off-by: default avatarChen Wandun <chenwandun@huawei.com>
Reviewed-by: default avatarKefeng <Wang&lt;wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent b95abeb4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ enum {
	SWP_PAGE_DISCARD = (1 << 10),	/* freed swap page-cluster discards */
	SWP_STABLE_WRITES = (1 << 11),	/* no overwrite PG_writeback pages */
	SWP_SYNCHRONOUS_IO = (1 << 12),	/* synchronous IO is efficient */
	SWP_VALID	= (1 << 13),	/* swap is valid to be operated on? */
					/* add others here before... */
	SWP_SCANNING	= (1 << 14),	/* refcount in scan_swap_map */
};
@@ -249,7 +250,6 @@ struct swap_cluster_list {
 * The in-memory structure used to track swap areas.
 */
struct swap_info_struct {
	struct percpu_ref users;	/* indicate and keep swap device valid. */
	unsigned long	flags;		/* SWP_USED etc: see above */
	signed short	prio;		/* swap priority of this type */
	struct plist_node list;		/* entry in swap_active_head */
@@ -270,7 +270,6 @@ struct swap_info_struct {
	struct block_device *bdev;	/* swap device or bdev of swap file */
	struct file *swap_file;		/* seldom referenced */
	unsigned int old_block_size;	/* seldom referenced */
	struct completion comp;		/* seldom referenced */
#ifdef CONFIG_FRONTSWAP
	unsigned long *frontswap_map;	/* frontswap in-use, one bit per page */
	atomic_t frontswap_pages;	/* frontswap pages in-use counter */
@@ -296,6 +295,8 @@ struct swap_info_struct {
	struct swap_cluster_list discard_clusters; /* discard clusters list */
	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_EXTEND(struct percpu_ref users)	/* indicate and keep swap device valid. */
	KABI_EXTEND(struct completion comp)	/* seldom referenced */
	struct plist_node avail_lists[]; /*
					   * entries in swap_avail_heads, one
					   * entry per node.