Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186728
b: refs/heads/master
c: c25d75a
h: refs/heads/master
v: v3
  • Loading branch information
Nitin Gupta authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 58e78fe commit 8830b9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e882281742f7e483e751bbbaf6c0946b5f8513f
refs/heads/master: c25d75a234df36446dc0d9bb3365ab8b83374d50
16 changes: 11 additions & 5 deletions trunk/drivers/staging/ramzswap/ramzswap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static int setup_swap_header(struct ramzswap *rzs, union swap_header *s)
return ret;
}

void ramzswap_ioctl_get_stats(struct ramzswap *rzs,
static void ramzswap_ioctl_get_stats(struct ramzswap *rzs,
struct ramzswap_ioctl_stats *s)
{
strncpy(s->backing_swap_name, rzs->backing_swap_name,
Expand Down Expand Up @@ -502,6 +502,14 @@ static int setup_backing_swap(struct ramzswap *rzs)
goto bad_param;
}
disksize = i_size_read(inode);
/*
* Can happen if user gives an extended partition as
* backing swap or simply a bad disk.
*/
if (!disksize) {
pr_err("Error reading backing swap size.\n");
goto bad_param;
}
} else if (S_ISREG(inode->i_mode)) {
bdev = inode->i_sb->s_bdev;
if (IS_SWAPFILE(inode)) {
Expand All @@ -519,7 +527,6 @@ static int setup_backing_swap(struct ramzswap *rzs)
rzs->swap_file = swap_file;
rzs->backing_swap = bdev;
rzs->disksize = disksize;
BUG_ON(!rzs->disksize);

return 0;

Expand All @@ -537,7 +544,7 @@ static int setup_backing_swap(struct ramzswap *rzs)
* Map logical page number 'pagenum' to physical page number
* on backing swap device. For block device, this is a nop.
*/
u32 map_backing_swap_page(struct ramzswap *rzs, u32 pagenum)
static u32 map_backing_swap_page(struct ramzswap *rzs, u32 pagenum)
{
u32 skip_pages, entries_per_page;
size_t delta, se_offset, skipped;
Expand Down Expand Up @@ -668,7 +675,6 @@ static int handle_uncompressed_page(struct ramzswap *rzs, struct bio *bio)
return 0;
}


/*
* Called when request page is not present in ramzswap.
* Its either in backing swap device (if present) or
Expand Down Expand Up @@ -936,7 +942,6 @@ static int ramzswap_write(struct ramzswap *rzs, struct bio *bio)
return 0;
}


/*
* Check if request is within bounds and page aligned.
*/
Expand Down Expand Up @@ -1064,6 +1069,7 @@ static void reset_device(struct ramzswap *rzs)
bd_release(rzs->backing_swap);
filp_close(rzs->swap_file, NULL);
rzs->backing_swap = NULL;
memset(rzs->backing_swap_name, 0, MAX_SWAP_NAME_LEN);
}

/* Reset stats */
Expand Down

0 comments on commit 8830b9a

Please sign in to comment.