Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186724
b: refs/heads/master
c: 7eef753
h: refs/heads/master
v: v3
  • Loading branch information
Nitin Gupta authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent b8fa85c commit 279cab8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 6a90772886d5d6812f9b2775d3caa0dc002754e0
refs/heads/master: 7eef7533909f3ea50e8b375777242f778e8da11e
11 changes: 8 additions & 3 deletions trunk/drivers/staging/ramzswap/ramzswap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,9 @@ static void reset_device(struct ramzswap *rzs)
unsigned entries_per_page;
unsigned long num_table_pages, entry = 0;

/* Do not accept any new I/O request */
rzs->init_done = 0;

if (rzs->backing_swap && !rzs->num_extents)
is_backing_blkdev = 1;

Expand Down Expand Up @@ -1073,9 +1076,6 @@ static void reset_device(struct ramzswap *rzs)

rzs->disksize = 0;
rzs->memlimit = 0;

/* Back to uninitialized state */
rzs->init_done = 0;
}

static int ramzswap_ioctl_init_device(struct ramzswap *rzs)
Expand Down Expand Up @@ -1276,6 +1276,11 @@ static int ramzswap_ioctl(struct block_device *bdev, fmode_t mode,
ret = -EBUSY;
goto out;
}

/* Make sure all pending I/O is finished */
if (bdev)
fsync_bdev(bdev);

ret = ramzswap_ioctl_reset_device(rzs);
break;

Expand Down

0 comments on commit 279cab8

Please sign in to comment.