aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/user.c')
-rw-r--r--kernel/power/user.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index a327b18a5ffd..f0b7ef8bdd74 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -126,7 +126,8 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
126{ 126{
127 int error = 0; 127 int error = 0;
128 struct snapshot_data *data; 128 struct snapshot_data *data;
129 loff_t offset, avail; 129 loff_t avail;
130 sector_t offset;
130 131
131 if (_IOC_TYPE(cmd) != SNAPSHOT_IOC_MAGIC) 132 if (_IOC_TYPE(cmd) != SNAPSHOT_IOC_MAGIC)
132 return -ENOTTY; 133 return -ENOTTY;
@@ -240,10 +241,10 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
240 break; 241 break;
241 } 242 }
242 } 243 }
243 offset = alloc_swap_page(data->swap, data->bitmap); 244 offset = alloc_swapdev_block(data->swap, data->bitmap);
244 if (offset) { 245 if (offset) {
245 offset <<= PAGE_SHIFT; 246 offset <<= PAGE_SHIFT;
246 error = put_user(offset, (loff_t __user *)arg); 247 error = put_user(offset, (sector_t __user *)arg);
247 } else { 248 } else {
248 error = -ENOSPC; 249 error = -ENOSPC;
249 } 250 }