if (memcmp("SWAPSPACE2", swap_header->magic.magic, 10)) {
printk(KERN_ERR "Unable to find swap-space signature\n");
- goto bad_swap;
+ return 0;
}
/* swap partition endianess hack... */
printk(KERN_WARNING
"Unable to handle swap header version %d\n",
swap_header->info.version);
- goto bad_swap;
+ return 0;
}
p->lowest_bit = 1;
p->highest_bit = maxpages - 1;
if (!maxpages)
- goto bad_swap;
+ return 0;
swapfilepages = i_size_read(inode) >> PAGE_SHIFT;
if (swapfilepages && maxpages > swapfilepages) {
printk(KERN_WARNING
"Swap area shorter than signature indicates\n");
- goto bad_swap;
+ return 0;
}
if (swap_header->info.nr_badpages && S_ISREG(inode->i_mode))
- goto bad_swap;
+ return 0;
if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES)
- goto bad_swap;
+ return 0;
return maxpages;
-
-bad_swap:
- return 0;
}
SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)