Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16522
b: refs/heads/master
c: 6da487d
h: refs/heads/master
v: v3
  • Loading branch information
Alasdair G Kergon authored and Linus Torvalds committed Jan 6, 2006
1 parent 155883c commit 42f05a5
Show file tree
Hide file tree
Showing 3 changed files with 18 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: aa8d7c2fbe619d8c0837296d2eaf4c14cebac198
refs/heads/master: 6da487dcc0c6f4c827779687a20016efeffc4d60
11 changes: 9 additions & 2 deletions trunk/drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,14 +693,18 @@ static int dev_rename(struct dm_ioctl *param, size_t param_size)
static int do_suspend(struct dm_ioctl *param)
{
int r = 0;
int do_lockfs = 1;
struct mapped_device *md;

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

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

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

if (!r)
r = __dev_status(md, param);
Expand All @@ -712,6 +716,7 @@ static int do_suspend(struct dm_ioctl *param)
static int do_resume(struct dm_ioctl *param)
{
int r = 0;
int do_lockfs = 1;
struct hash_cell *hc;
struct mapped_device *md;
struct dm_table *new_map;
Expand All @@ -737,8 +742,10 @@ static int do_resume(struct dm_ioctl *param)
/* Do we need to load a new map ? */
if (new_map) {
/* Suspend if it isn't already suspended */
if (param->flags & DM_SKIP_LOCKFS_FLAG)
do_lockfs = 0;
if (!dm_suspended(md))
dm_suspend(md, 1);
dm_suspend(md, do_lockfs);

r = dm_swap_table(md, new_map);
if (r) {
Expand Down
11 changes: 8 additions & 3 deletions trunk/include/linux/dm-ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ typedef char ioctl_struct[308];
#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)

#define DM_VERSION_MAJOR 4
#define DM_VERSION_MINOR 4
#define DM_VERSION_MINOR 5
#define DM_VERSION_PATCHLEVEL 0
#define DM_VERSION_EXTRA "-ioctl (2005-01-12)"
#define DM_VERSION_EXTRA "-ioctl (2005-10-04)"

/* Status bits */
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
Expand All @@ -301,8 +301,13 @@ typedef char ioctl_struct[308];
#define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */

/*
* Set this to improve performance when you aren't going to use open_count
* Set this to improve performance when you aren't going to use open_count.
*/
#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */

/*
* Set this to avoid attempting to freeze any filesystem when suspending.
*/
#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */

#endif /* _LINUX_DM_IOCTL_H */

0 comments on commit 42f05a5

Please sign in to comment.