sector_t *span)
{
int i;
- int error;
unsigned int nr_good_pages;
int nr_extents;
for (i = 0; i < swap_header->info.nr_badpages; i++) {
unsigned int page_nr = swap_header->info.badpages[i];
- if (page_nr == 0 || page_nr > swap_header->info.last_page) {
- error = -EINVAL;
- goto bad_swap;
- }
+ if (page_nr == 0 || page_nr > swap_header->info.last_page)
+ return -EINVAL;
if (page_nr < maxpages) {
swap_map[page_nr] = SWAP_MAP_BAD;
nr_good_pages--;
p->max = maxpages;
p->pages = nr_good_pages;
nr_extents = setup_swap_extents(p, span);
- if (nr_extents < 0) {
- error = nr_extents;
- goto bad_swap;
- }
+ if (nr_extents < 0)
+ return nr_extents;
nr_good_pages = p->pages;
}
if (!nr_good_pages) {
printk(KERN_WARNING "Empty swap-file\n");
- error = -EINVAL;
- goto bad_swap;
+ return -EINVAL;
}
return nr_extents;
-
-bad_swap:
- return error;
}
SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)