Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] dm: ioctl: add noflush suspend

Provide a dm ioctl option to request noflush suspending. (See next patch for
what this is for.) As the interface is extended, the version number is
incremented.

Other than accepting the new option through the interface, There is no change
to existing behaviour.

Test results:
Confirmed the option is given from user-space correctly.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Kiyoshi Ueda and committed by
Linus Torvalds
81fdb096 d2a7ad29

+12 -2
+4
drivers/md/dm-ioctl.c
··· 774 774 775 775 if (param->flags & DM_SKIP_LOCKFS_FLAG) 776 776 suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG; 777 + if (param->flags & DM_NOFLUSH_FLAG) 778 + suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG; 777 779 778 780 if (!dm_suspended(md)) 779 781 r = dm_suspend(md, suspend_flags); ··· 817 815 /* Suspend if it isn't already suspended */ 818 816 if (param->flags & DM_SKIP_LOCKFS_FLAG) 819 817 suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG; 818 + if (param->flags & DM_NOFLUSH_FLAG) 819 + suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG; 820 820 if (!dm_suspended(md)) 821 821 dm_suspend(md, suspend_flags); 822 822
+1
drivers/md/dm.h
··· 47 47 * Suspend feature flags 48 48 */ 49 49 #define DM_SUSPEND_LOCKFS_FLAG (1 << 0) 50 + #define DM_SUSPEND_NOFLUSH_FLAG (1 << 1) 50 51 51 52 /* 52 53 * List of devices that a metadevice uses and should open/close.
+7 -2
include/linux/dm-ioctl.h
··· 285 285 #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 286 286 287 287 #define DM_VERSION_MAJOR 4 288 - #define DM_VERSION_MINOR 10 288 + #define DM_VERSION_MINOR 11 289 289 #define DM_VERSION_PATCHLEVEL 0 290 - #define DM_VERSION_EXTRA "-ioctl (2006-09-14)" 290 + #define DM_VERSION_EXTRA "-ioctl (2006-10-12)" 291 291 292 292 /* Status bits */ 293 293 #define DM_READONLY_FLAG (1 << 0) /* In/Out */ ··· 322 322 * Set this to avoid attempting to freeze any filesystem when suspending. 323 323 */ 324 324 #define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */ 325 + 326 + /* 327 + * Set this to suspend without flushing queued ios. 328 + */ 329 + #define DM_NOFLUSH_FLAG (1 << 11) /* In */ 325 330 326 331 #endif /* _LINUX_DM_IOCTL_H */