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

Commit f42158fe authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk Committed by Linus Torvalds
Browse files

zcache/tmem: Better error checking on frontswap_register_ops return value.



In the past it either used to be NULL or the "older" backend. Now we
also return -Exx error codes.

Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: default avatarBob Liu <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andor Daam <andor.daam@googlemail.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Florian Schmaus <fschmaus@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 10a7a077
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1886,9 +1886,12 @@ static int __init zcache_init(void)
			namestr, frontswap_has_exclusive_gets,
			!disable_frontswap_ignore_nonactive);
#endif
		if (old_ops != NULL)
		if (IS_ERR(old_ops) || old_ops) {
			if (IS_ERR(old_ops))
				return PTR_RET(old_ops);
			pr_warn("%s: frontswap_ops overridden\n", namestr);
		}
	}
	if (ramster_enabled)
		ramster_init(!disable_cleancache, !disable_frontswap,
				frontswap_has_exclusive_gets);
+4 −1
Original line number Diff line number Diff line
@@ -397,8 +397,11 @@ static int xen_tmem_init(void)
			frontswap_register_ops(&tmem_frontswap_ops);

		tmem_frontswap_poolid = -1;
		if (old_ops)
		if (IS_ERR(old_ops) || old_ops) {
			if (IS_ERR(old_ops))
				return PTR_ERR(old_ops);
			s = " (WARNING: frontswap_ops overridden)";
		}
		printk(KERN_INFO "frontswap enabled, RAM provided by "
				 "Xen Transcendent Memory%s\n", s);
	}