Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43837
b: refs/heads/master
c: a3d77d3
h: refs/heads/master
i:
  43835: ff17331
v: v3
  • Loading branch information
Kiyoshi Ueda authored and Linus Torvalds committed Dec 8, 2006
1 parent 7704965 commit 162ab30
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 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: 74859364633963cb660c4fa518adca9ab1ca4229
refs/heads/master: a3d77d35be6f416a250c528c3ed5c70013a915e8
12 changes: 6 additions & 6 deletions trunk/drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,18 +765,18 @@ static int dev_set_geometry(struct dm_ioctl *param, size_t param_size)
static int do_suspend(struct dm_ioctl *param)
{
int r = 0;
int do_lockfs = 1;
unsigned suspend_flags = DM_SUSPEND_LOCKFS_FLAG;
struct mapped_device *md;

md = find_device(param);
if (!md)
return -ENXIO;

if (param->flags & DM_SKIP_LOCKFS_FLAG)
do_lockfs = 0;
suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG;

if (!dm_suspended(md))
r = dm_suspend(md, do_lockfs);
r = dm_suspend(md, suspend_flags);

if (!r)
r = __dev_status(md, param);
Expand All @@ -788,7 +788,7 @@ static int do_suspend(struct dm_ioctl *param)
static int do_resume(struct dm_ioctl *param)
{
int r = 0;
int do_lockfs = 1;
unsigned suspend_flags = DM_SUSPEND_LOCKFS_FLAG;
struct hash_cell *hc;
struct mapped_device *md;
struct dm_table *new_map;
Expand All @@ -814,9 +814,9 @@ static int do_resume(struct dm_ioctl *param)
if (new_map) {
/* Suspend if it isn't already suspended */
if (param->flags & DM_SKIP_LOCKFS_FLAG)
do_lockfs = 0;
suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG;
if (!dm_suspended(md))
dm_suspend(md, do_lockfs);
dm_suspend(md, suspend_flags);

r = dm_swap_table(md, new_map);
if (r) {
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1272,12 +1272,13 @@ static void unlock_fs(struct mapped_device *md)
* dm_bind_table, dm_suspend must be called to flush any in
* flight bios and ensure that any further io gets deferred.
*/
int dm_suspend(struct mapped_device *md, int do_lockfs)
int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
{
struct dm_table *map = NULL;
DECLARE_WAITQUEUE(wait, current);
struct bio *def;
int r = -EINVAL;
int do_lockfs = suspend_flags & DM_SUSPEND_LOCKFS_FLAG ? 1 : 0;

down(&md->suspend_lock);

Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/md/dm.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

#define SECTOR_SHIFT 9

/*
* Suspend feature flags
*/
#define DM_SUSPEND_LOCKFS_FLAG (1 << 0)

/*
* List of devices that a metadevice uses and should open/close.
*/
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/device-mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void *dm_get_mdptr(struct mapped_device *md);
/*
* A device can still be used while suspended, but I/O is deferred.
*/
int dm_suspend(struct mapped_device *md, int with_lockfs);
int dm_suspend(struct mapped_device *md, unsigned suspend_flags);
int dm_resume(struct mapped_device *md);

/*
Expand Down

0 comments on commit 162ab30

Please sign in to comment.