提交 46d673d7 编写于 作者: C Chen Wandun 提交者: Zheng Zengkai

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: NChen Wandun <chenwandun@huawei.com>
Reviewed-by: Kefeng Wang<wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b95abeb4
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册