r1036 - in trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian: . patches

Simon Horman horms@haydn.debian.org
Wed, 11 Aug 2004 23:43:27 -0600


Author: horms
Date: 2004-08-11 23:43:24 -0600 (Wed, 11 Aug 2004)
New Revision: 1036

Modified:
   trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian/changelog
   trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian/patches/patch-2.4.26-6
Log:
Merged in updated device mapper patch

Modified: trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian/changelog
===================================================================
--- trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian/changelog	2004-08-12 05:36:20 UTC (rev 1035)
+++ trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian/changelog	2004-08-12 05:43:24 UTC (rev 1036)
@@ -1,4 +1,4 @@
-kernel-source-2.4.26 (2.4.26-6) UNRELEASED; urgency=low
+kernel-source-2.4.26 (2.4.26-6) unstable; urgency=low
 
   * Fix handling of offset pointers [CAN-2004-0415]
     http://linux.bkbits.net:8080/linux-2.4/cset@1.1465?nav=index.html
@@ -76,8 +76,36 @@
   * Reversed bogus patch to parse_arg introduced as part of the fix to
     CAN-2004-0495 in 2.4.26-3 (closes: Bug#264202)
     . drivers/acpi/asus_acpi.c
+  * Merged device mapper patch from devmapper-1.00.19
+    There was an existing older version of this patch in the tree already
+    . MAINTAINERS
+    . arch/mips64/kernel/ioctl32.c
+    . arch/parisc/kernel/ioctl32.c
+    . arch/ppc64/kernel/ioctl32.c
+    . arch/s390x/kernel/ioctl32.c
+    . arch/sparc64/kernel/ioctl32.c
+    . arch/x86_64/ia32/ia32_ioctl.c
+    . drivers/md/Config.in
+    . drivers/md/Makefile
+    . drivers/md/dm-ioctl.c
+    . drivers/md/dm-linear.c
+    . drivers/md/dm-stripe.c
+    . drivers/md/dm-target.c
+    . drivers/md/dm.c
+    . drivers/md/dm.h
+    . drivers/md/lvm.c
+    . fs/buffer.c
+    . fs/reiserfs/super.c
+    . fs/super.c
+    . include/linux/device-mapper.h
+    . include/linux/dm-ioctl.h
+    . include/linux/fs.h
+    . kernel/ksyms.c
+    . mm/filemap.c
+  * Added conflicts for kernel-patch-device-mapper as this
+    patch is in this tree now. (closes: Bug#262870)
 
- -- Simon Horman <horms@debian.org>  Thu, 12 Aug 2004 12:53:46 +0900
+ -- Simon Horman <horms@debian.org>  Thu, 12 Aug 2004 14:19:41 +0900
 
 kernel-source-2.4.26 (2.4.26-5) unstable; urgency=high
 

Modified: trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian/patches/patch-2.4.26-6
===================================================================
--- trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian/patches/patch-2.4.26-6	2004-08-12 05:36:20 UTC (rev 1035)
+++ trunk/kernel-2.4/source/kernel-source-2.4.26-2.4.26/debian/patches/patch-2.4.26-6	2004-08-12 05:43:24 UTC (rev 1036)
@@ -4757,6 +4757,9 @@
 #   Fix net/atm/br2684.c file offset patch
 # *** Incorporated into patch for ChangeSet 1.1465 above - Horms 2004/08/12 ***
 # 
+
+# Device mapper merged in from devmapper-1.00.19
+# Horms 2004/08/12
 --- a/drivers/acpi/asus_acpi.c.orig	2004-08-12 12:39:49.000000000 +0900
 +++ b/drivers/acpi/asus_acpi.c	2004-08-12 10:21:11.000000000 +0900
 @@ -403,7 +403,8 @@
@@ -4769,3 +4772,757 @@
  		return -EINVAL;
  	return count;
  }
+--- kernel-source-2.4.26-2.4.26/MAINTAINERS	2004-08-12 14:04:29.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/MAINTAINERS	2004-08-12 13:57:11.000000000 +0900
+@@ -589,9 +589,9 @@
+ 
+ DEVICE MAPPER
+ P:	Joe Thornber
+-M:	dm@uk.sistina.com
+-L:	linux-LVM@sistina.com
+-W:	http://www.sistina.com/lvm
++M:	dm-devel@redhat.com
++L:	dm-devel@redhat.com
++W:	http://sources.redhat.com/dm
+ S:	Maintained
+ 
+ DEVICE NUMBER REGISTRY
+--- kernel-source-2.4.26-2.4.26/arch/mips64/kernel/ioctl32.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/arch/mips64/kernel/ioctl32.c	2004-08-12 14:03:12.000000000 +0900
+@@ -49,7 +49,6 @@
+ #if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE)
+ #include <linux/lvm.h>
+ #endif /* LVM */
+-#include <linux/dm-ioctl.h>
+ 
+ #include <scsi/scsi.h>
+ #undef __KERNEL__		/* This file was born to be ugly ...  */
+@@ -63,6 +62,7 @@
+ 
+ #include <linux/mtd/mtd.h>
+ #include <linux/serial.h>
++#include <linux/dm-ioctl.h>
+ 
+ #ifdef CONFIG_SIBYTE_TBPROF
+ #include <asm/sibyte/trace_prof.h>
+@@ -2342,6 +2342,7 @@
+ 	IOCTL32_DEFAULT(DM_DEV_WAIT),
+ 	IOCTL32_DEFAULT(DM_LIST_DEVICES),
+ 	IOCTL32_DEFAULT(DM_TABLE_CLEAR),
++	IOCTL32_DEFAULT(DM_LIST_VERSIONS),
+ #endif /* CONFIG_BLK_DEV_DM */
+ 
+ #ifdef CONFIG_SIBYTE_TBPROF
+--- kernel-source-2.4.26-2.4.26/arch/parisc/kernel/ioctl32.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/arch/parisc/kernel/ioctl32.c	2004-08-12 13:41:02.000000000 +0900
+@@ -3439,6 +3439,7 @@
+ COMPATIBLE_IOCTL(DM_DEV_WAIT)
+ COMPATIBLE_IOCTL(DM_LIST_DEVICES)
+ COMPATIBLE_IOCTL(DM_TABLE_CLEAR)
++COMPATIBLE_IOCTL(DM_LIST_VERSIONS)
+ #endif /* CONFIG_BLK_DEV_DM */
+ #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
+ COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC)
+--- kernel-source-2.4.26-2.4.26/arch/ppc64/kernel/ioctl32.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/arch/ppc64/kernel/ioctl32.c	2004-08-12 13:44:38.000000000 +0900
+@@ -4408,7 +4408,6 @@
+ COMPATIBLE_IOCTL(NBD_CLEAR_QUE),
+ COMPATIBLE_IOCTL(NBD_PRINT_DEBUG),
+ COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS),
+-COMPATIBLE_IOCTL(NBD_DISCONNECT),
+ /* device-mapper */
+ #if defined(CONFIG_BLK_DEV_DM) || defined(CONFIG_BLK_DEV_DM_MODULE)
+ COMPATIBLE_IOCTL(DM_VERSION),
+@@ -4424,6 +4423,7 @@
+ COMPATIBLE_IOCTL(DM_DEV_WAIT),
+ COMPATIBLE_IOCTL(DM_LIST_DEVICES),
+ COMPATIBLE_IOCTL(DM_TABLE_CLEAR),
++COMPATIBLE_IOCTL(DM_LIST_VERSIONS),
+ #endif /* CONFIG_BLK_DEV_DM */
+ /* Remove *PRIVATE in 2.5 */
+ COMPATIBLE_IOCTL(SIOCDEVPRIVATE),
+--- kernel-source-2.4.26-2.4.26/arch/s390x/kernel/ioctl32.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/arch/s390x/kernel/ioctl32.c	2004-08-12 13:41:02.000000000 +0900
+@@ -641,6 +641,7 @@
+ 	IOCTL32_DEFAULT(DM_DEV_WAIT),
+ 	IOCTL32_DEFAULT(DM_LIST_DEVICES),
+ 	IOCTL32_DEFAULT(DM_TABLE_CLEAR),
++	IOCTL32_DEFAULT(DM_LIST_VERSIONS),
+ 
+ 	IOCTL32_DEFAULT(LOOP_SET_FD),
+ 	IOCTL32_DEFAULT(LOOP_CLR_FD),
+--- kernel-source-2.4.26-2.4.26/arch/sparc64/kernel/ioctl32.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/arch/sparc64/kernel/ioctl32.c	2004-08-12 13:41:02.000000000 +0900
+@@ -5126,7 +5126,7 @@
+ COMPATIBLE_IOCTL(NBD_PRINT_DEBUG)
+ COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS)
+ COMPATIBLE_IOCTL(NBD_DISCONNECT)
+-/* device-mapper */
+++/* device-mapper */
+ #if defined(CONFIG_BLK_DEV_DM) || defined(CONFIG_BLK_DEV_DM_MODULE)
+ COMPATIBLE_IOCTL(DM_VERSION)
+ COMPATIBLE_IOCTL(DM_REMOVE_ALL)
+@@ -5141,6 +5141,7 @@
+ COMPATIBLE_IOCTL(DM_DEV_WAIT)
+ COMPATIBLE_IOCTL(DM_LIST_DEVICES)
+ COMPATIBLE_IOCTL(DM_TABLE_CLEAR)
++COMPATIBLE_IOCTL(DM_LIST_VERSIONS)
+ #endif /* CONFIG_BLK_DEV_DM */
+ /* Linux-1394 */
+ #if defined(CONFIG_IEEE1394) || defined(CONFIG_IEEE1394_MODULE)
+--- kernel-source-2.4.26-2.4.26/arch/x86_64/ia32/ia32_ioctl.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/arch/x86_64/ia32/ia32_ioctl.c	2004-08-12 13:41:02.000000000 +0900
+@@ -4156,6 +4156,7 @@
+ COMPATIBLE_IOCTL(DM_DEV_WAIT)
+ COMPATIBLE_IOCTL(DM_LIST_DEVICES)
+ COMPATIBLE_IOCTL(DM_TABLE_CLEAR)
++COMPATIBLE_IOCTL(DM_LIST_VERSIONS)
+ #endif /* CONFIG_BLK_DEV_DM */
+ #ifdef CONFIG_AUTOFS_FS
+ COMPATIBLE_IOCTL(AUTOFS_IOC_READY)
+--- kernel-source-2.4.26-2.4.26/drivers/md/Config.in	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/Config.in	2004-08-12 13:41:02.000000000 +0900
+@@ -15,5 +15,6 @@
+ 
+ dep_tristate ' Logical volume manager (LVM) support' CONFIG_BLK_DEV_LVM $CONFIG_MD
+ dep_tristate ' Device-mapper support' CONFIG_BLK_DEV_DM $CONFIG_MD
++dep_tristate '  Mirror (RAID-1) support' CONFIG_BLK_DEV_DM_MIRROR $CONFIG_BLK_DEV_DM
+ 
+ endmenu
+--- kernel-source-2.4.26-2.4.26/drivers/md/Makefile	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/Makefile	2004-08-12 13:41:02.000000000 +0900
+@@ -4,13 +4,16 @@
+ 
+ O_TARGET	:= mddev.o
+ 
+-export-objs	:= md.o xor.o dm-table.o dm-target.o \
+-		   dm.o
++export-objs	:= md.o xor.o dm-table.o dm-target.o kcopyd.o dm-daemon.o \
++		   dm-log.o dm-io.o dm.o
+ 
+-list-multi	:= lvm-mod.o dm-mod.o
++list-multi	:= lvm-mod.o dm-mod.o dm-mirror-mod.o
+ lvm-mod-objs	:= lvm.o lvm-snap.o lvm-fs.o
+ dm-mod-objs	:= dm.o dm-table.o dm-target.o dm-ioctl.o \
+-		   dm-linear.o dm-stripe.o
++		   dm-linear.o dm-stripe.o dm-snapshot.o dm-exception-store.o \
++		   kcopyd.o dm-daemon.o dm-io.o
++dm-mirror-mod-objs := dm-raid1.o dm-log.o
++
+ 
+ # Note: link order is important.  All raid personalities
+ # and xor.o must come before md.o, as they each initialise 
+@@ -27,6 +30,7 @@
+ obj-$(CONFIG_BLK_DEV_LVM)		+= lvm-mod.o
+ 
+ obj-$(CONFIG_BLK_DEV_DM)		+= dm-mod.o
++obj-$(CONFIG_BLK_DEV_DM_MIRROR)		+= dm-mirror.o
+ 
+ include $(TOPDIR)/Rules.make
+ 
+@@ -36,3 +40,7 @@
+ dm-mod.o: $(dm-mod-objs)
+ 	$(LD) -r -o $@ $(dm-mod-objs)
+ 
++dm-mirror.o: $(dm-mirror-mod-objs)
++	$(LD) -r -o $@ $(dm-mirror-mod-objs)
++
++
+--- kernel-source-2.4.26-2.4.26/drivers/md/dm-ioctl.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/dm-ioctl.c	2004-08-12 13:41:02.000000000 +0900
+@@ -17,7 +17,7 @@
+ 
+ #include <asm/uaccess.h>
+ 
+-#define DM_DRIVER_EMAIL "dm@uk.sistina.com"
++#define DM_DRIVER_EMAIL "dm-devel@redhat.com"
+ 
+ /*-----------------------------------------------------------------
+  * The ioctl interface needs to be able to look up devices by
+@@ -36,6 +36,13 @@
+ 	devfs_handle_t devfs_entry;
+ };
+ 
++struct vers_iter {
++	size_t param_size;
++	struct dm_target_versions *vers, *old_vers;
++	char *end;
++	uint32_t flags;
++};
++
+ #define NUM_BUCKETS 64
+ #define MASK_BUCKETS (NUM_BUCKETS - 1)
+ static struct list_head _name_buckets[NUM_BUCKETS];
+@@ -420,6 +427,78 @@
+ 	return 0;
+ }
+ 
++static void list_version_get_needed(struct target_type *tt, void *param)
++{
++	int *needed = param;
++
++	*needed += strlen(tt->name);
++	*needed += sizeof(tt->version);
++	*needed += ALIGN_MASK;
++}
++
++static void list_version_get_info(struct target_type *tt, void *param)
++{
++	struct vers_iter *info = param;
++
++	/* Check space - it might have changed since the first iteration */
++	if ((char *)info->vers + sizeof(tt->version) + strlen(tt->name) + 1 >
++	    info->end) {
++		info->flags = DM_BUFFER_FULL_FLAG;
++		return;
++	}
++
++	if (info->old_vers)
++		info->old_vers->next = (uint32_t) ((void *)info->vers -
++		    (void *)info->old_vers);
++
++	info->vers->version[0] = tt->version[0];
++	info->vers->version[1] = tt->version[1];
++	info->vers->version[2] = tt->version[2];
++	info->vers->next = 0;
++	strcpy(info->vers->name, tt->name);
++
++	info->old_vers = info->vers;
++	info->vers = align_ptr(((void *) ++info->vers) + strlen(tt->name) + 1);
++}
++
++static int list_versions(struct dm_ioctl *param, size_t param_size)
++{
++	size_t len, needed = 0;
++	struct dm_target_versions *vers;
++	struct vers_iter iter_info;
++
++	/*
++	 * Loop through all the devices working out how much
++	 * space we need.
++	 */
++	dm_target_iterate(list_version_get_needed, &needed);
++
++	/*
++	 * Grab our output buffer.
++	 */
++	vers = get_result_buffer(param, param_size, &len);
++	if (len < needed) {
++		param->flags |= DM_BUFFER_FULL_FLAG;
++		goto out;
++	}
++	param->data_size = param->data_start + needed;
++
++	iter_info.param_size = param_size;
++	iter_info.old_vers = NULL;
++	iter_info.vers = vers;
++	iter_info.flags = 0;
++	iter_info.end = (char *)vers+len;
++
++	/*
++	 * Now loop through filling out the names & versions.
++	 */
++	dm_target_iterate(list_version_get_info, &iter_info);
++	param->flags |= iter_info.flags;
++
++      out:
++	return 0;
++}
++
+ static int check_name(const char *name)
+ {
+ 	if (strchr(name, '/')) {
+@@ -723,7 +802,7 @@
+ 		struct dm_target *ti = dm_table_get_target(table, i);
+ 
+ 		remaining = len - (outptr - outbuf);
+-		if (remaining < sizeof(struct dm_target_spec)) {
++		if (remaining <= sizeof(struct dm_target_spec)) {
+ 			param->flags |= DM_BUFFER_FULL_FLAG;
+ 			break;
+ 		}
+@@ -1044,7 +1123,9 @@
+ 		{DM_TABLE_LOAD_CMD, table_load},
+ 		{DM_TABLE_CLEAR_CMD, table_clear},
+ 		{DM_TABLE_DEPS_CMD, table_deps},
+-		{DM_TABLE_STATUS_CMD, table_status}
++		{DM_TABLE_STATUS_CMD, table_status},
++
++		{DM_LIST_VERSIONS_CMD, list_versions}
+ 	};
+ 
+ 	return (cmd >= ARRAY_SIZE(_ioctls)) ? NULL : _ioctls[cmd].fn;
+@@ -1118,7 +1199,8 @@
+ 	param->flags &= ~DM_BUFFER_FULL_FLAG;
+ 
+ 	/* Ignores parameters */
+-	if (cmd == DM_REMOVE_ALL_CMD || cmd == DM_LIST_DEVICES_CMD)
++	if (cmd == DM_REMOVE_ALL_CMD || cmd == DM_LIST_DEVICES_CMD ||
++	    cmd == DM_LIST_VERSIONS_CMD)
+ 		return 0;
+ 
+ 	/* Unless creating, either name or uuid but not both */
+--- kernel-source-2.4.26-2.4.26/drivers/md/dm-linear.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/dm-linear.c	2004-08-12 13:41:02.000000000 +0900
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (C) 2001 Sistina Software (UK) Limited.
++ * Copyright (C) 2001-2003 Sistina Software (UK) Limited.
+  *
+  * This file is released under the GPL.
+  */
+@@ -97,6 +97,7 @@
+ 
+ static struct target_type linear_target = {
+ 	.name   = "linear",
++	.version= {1, 0, 1},
+ 	.module = THIS_MODULE,
+ 	.ctr    = linear_ctr,
+ 	.dtr    = linear_dtr,
+--- kernel-source-2.4.26-2.4.26/drivers/md/dm-stripe.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/dm-stripe.c	2004-08-12 13:41:02.000000000 +0900
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (C) 2001 Sistina Software (UK) Limited.
++ * Copyright (C) 2001-2003 Sistina Software (UK) Limited.
+  *
+  * This file is released under the GPL.
+  */
+@@ -231,6 +231,7 @@
+ 
+ static struct target_type stripe_target = {
+ 	.name   = "striped",
++	.version= {1, 0, 1},
+ 	.module = THIS_MODULE,
+ 	.ctr    = stripe_ctr,
+ 	.dtr    = stripe_dtr,
+--- kernel-source-2.4.26-2.4.26/drivers/md/dm-target.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/dm-target.c	2004-08-12 13:41:02.000000000 +0900
+@@ -105,6 +105,20 @@
+ 	return ti;
+ }
+ 
++
++int dm_target_iterate(void (*iter_func)(struct target_type *tt,
++					void *param), void *param)
++{
++	struct tt_internal *ti;
++
++	down_read(&_lock);
++	list_for_each_entry (ti, &_targets, list)
++		iter_func(&ti->tt, param);
++	up_read(&_lock);
++
++	return 0;
++}
++
+ int dm_register_target(struct target_type *t)
+ {
+ 	int rv = 0;
+@@ -168,6 +182,7 @@
+ 
+ static struct target_type error_target = {
+ 	.name = "error",
++	.version = {1, 0, 1},
+ 	.ctr  = io_err_ctr,
+ 	.dtr  = io_err_dtr,
+ 	.map  = io_err_map,
+--- kernel-source-2.4.26-2.4.26/drivers/md/dm.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/dm.c	2004-08-12 13:41:02.000000000 +0900
+@@ -5,6 +5,7 @@
+  */
+ 
+ #include "dm.h"
++#include "kcopyd.h"
+ 
+ #include <linux/init.h>
+ #include <linux/module.h>
+@@ -363,9 +364,11 @@
+ } _inits[] = {
+ #define xx(n) {n ## _init, n ## _exit},
+ 	xx(local)
++	xx(kcopyd)
+ 	xx(dm_target)
+ 	xx(dm_linear)
+ 	xx(dm_stripe)
++	xx(dm_snapshot)
+ 	xx(dm_interface)
+ #undef xx
+ };
+--- kernel-source-2.4.26-2.4.26/drivers/md/dm.h	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/dm.h	2004-08-12 13:41:02.000000000 +0900
+@@ -123,6 +123,8 @@
+ void dm_target_exit(void);
+ struct target_type *dm_get_target_type(const char *name);
+ void dm_put_target_type(struct target_type *t);
++int dm_target_iterate(void (*iter_func)(struct target_type *tt,
++					void *param), void *param);
+ 
+ 
+ /*-----------------------------------------------------------------
+@@ -169,4 +171,7 @@
+ int dm_stripe_init(void);
+ void dm_stripe_exit(void);
+ 
++int dm_snapshot_init(void);
++void dm_snapshot_exit(void);
++
+ #endif
+--- kernel-source-2.4.26-2.4.26/drivers/md/lvm.c	2004-02-18 22:36:31.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/drivers/md/lvm.c	2004-08-12 13:41:02.000000000 +0900
+@@ -236,9 +236,6 @@
+ #define DEVICE_OFF(device)
+ #define LOCAL_END_REQUEST
+ 
+-/* lvm_do_lv_create calls fsync_dev_lockfs()/unlockfs() */
+-/* #define	LVM_VFS_ENHANCEMENT */
+-
+ #include <linux/config.h>
+ #include <linux/module.h>
+ #include <linux/kernel.h>
+@@ -2250,12 +2247,8 @@
+ 	if (lv_ptr->lv_access & LV_SNAPSHOT) {
+ 		lv_t *org = lv_ptr->lv_snapshot_org, *last;
+ 
+-		/* sync the original logical volume */
+-		fsync_dev(org->lv_dev);
+-#ifdef	LVM_VFS_ENHANCEMENT
+ 		/* VFS function call to sync and lock the filesystem */
+ 		fsync_dev_lockfs(org->lv_dev);
+-#endif
+ 
+ 		down_write(&org->lv_lock);
+ 		org->lv_access |= LV_SNAPSHOT_ORG;
+@@ -2281,11 +2274,9 @@
+ 	else
+ 		set_device_ro(lv_ptr->lv_dev, 1);
+ 
+-#ifdef	LVM_VFS_ENHANCEMENT
+ /* VFS function call to unlock the filesystem */
+ 	if (lv_ptr->lv_access & LV_SNAPSHOT)
+ 		unlockfs(lv_ptr->lv_snapshot_org->lv_dev);
+-#endif
+ 
+ 	lvm_gendisk.part[MINOR(lv_ptr->lv_dev)].de =
+ 	    lvm_fs_create_lv(vg_ptr, lv_ptr);
+--- kernel-source-2.4.26-2.4.26/fs/buffer.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/fs/buffer.c	2004-08-12 13:41:02.000000000 +0900
+@@ -419,6 +419,34 @@
+ 	fsync_dev(dev);
+ }
+ 
++int fsync_dev_lockfs(kdev_t dev)
++{
++	/* you are not allowed to try locking all the filesystems
++	** on the system, your chances of getting through without
++	** total deadlock are slim to none.
++	*/
++	if (!dev)
++		return fsync_dev(dev) ;
++
++	sync_buffers(dev, 0);
++
++	lock_kernel();
++	/* note, the FS might need to start transactions to 
++	** sync the inodes, or the quota, no locking until
++	** after these are done
++	*/
++	sync_inodes(dev);
++	DQUOT_SYNC_DEV(dev);
++	/* if inodes or quotas could be dirtied during the
++	** sync_supers_lockfs call, the FS is responsible for getting
++	** them on disk, without deadlocking against the lock
++	*/
++	sync_supers_lockfs(dev) ;
++	unlock_kernel();
++
++	return sync_buffers(dev, 1) ;
++}
++
+ asmlinkage long sys_sync(void)
+ {
+ 	fsync_dev(0);
+--- kernel-source-2.4.26-2.4.26/fs/reiserfs/super.c	2003-08-25 20:44:43.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/fs/reiserfs/super.c	2004-08-12 13:41:02.000000000 +0900
+@@ -73,7 +73,7 @@
+     reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1);
+     journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB (s));
+     reiserfs_block_writes(&th) ;
+-    journal_end(&th, s, 1) ;
++    journal_end_sync(&th, s, 1) ;
+   }
+   s->s_dirt = dirty;
+   unlock_kernel() ;
+--- kernel-source-2.4.26-2.4.26/fs/super.c	2003-08-25 20:44:43.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/fs/super.c	2004-08-12 13:41:02.000000000 +0900
+@@ -39,6 +39,12 @@
+ spinlock_t sb_lock = SPIN_LOCK_UNLOCKED;
+ 
+ /*
++ * stub of a filesystem used to make sure an FS isn't mounted
++ * in the middle of a lockfs call
++ */
++static DECLARE_FSTYPE_DEV(lockfs_fs_type, "lockfs", NULL);
++
++/*
+  * Handling of filesystem drivers list.
+  * Rules:
+  *	Inclusion to/removals from/scanning of list are protected by spinlock.
+@@ -436,6 +442,25 @@
+ 	put_super(sb);
+ }
+ 
++static void write_super_lockfs(struct super_block *sb)
++{
++	lock_super(sb);
++	if (sb->s_root && sb->s_op) {
++		if (sb->s_dirt && sb->s_op->write_super)
++			sb->s_op->write_super(sb);
++		if (sb->s_op->write_super_lockfs)
++			sb->s_op->write_super_lockfs(sb);
++	}
++	unlock_super(sb);
++
++	/* 
++	 * if no lockfs call is provided, use the sync_fs call instead.
++	 * this must be done without the super lock held
++	 */
++	if (!sb->s_op->write_super_lockfs && sb->s_op->sync_fs)
++		sb->s_op->sync_fs(sb);
++}
++
+ static inline void write_super(struct super_block *sb)
+ {
+ 	lock_super(sb);
+@@ -483,6 +508,119 @@
+ 	spin_unlock(&sb_lock);
+ }
+ 
++static struct super_block *find_super_for_lockfs(kdev_t dev)
++{
++	struct super_block *lockfs_sb = alloc_super();
++	struct super_block * s;
++
++	if (!dev)
++		return NULL;
++restart:
++	spin_lock(&sb_lock);
++	s = find_super(dev);
++	if (s) {
++		spin_unlock(&sb_lock);
++		down_read(&s->s_umount);
++		if (s->s_root) {
++			destroy_super(lockfs_sb);
++			return s;
++		}
++		drop_super(s);
++		goto restart;
++	}
++	/* if (s) we either return or goto, so we know s == NULL here.
++	 * At this point, there are no mounted filesystems on this device,
++	 * so we pretend to mount one.
++	 */
++	if (!lockfs_sb) {
++		spin_unlock(&sb_lock);
++		return NULL;
++	}
++	s = lockfs_sb;
++	s->s_dev = dev;
++	if (lockfs_fs_type.fs_supers.prev == NULL)
++		INIT_LIST_HEAD(&lockfs_fs_type.fs_supers);
++	insert_super(s, &lockfs_fs_type);
++	s->s_root = (struct dentry *)1;
++	/* alloc_super gives us a write lock on s_umount, this
++	 * way we know there are no concurrent lockfs holders for this dev.  
++	 * It allows us to remove the temp super from the list of supers 
++	 * immediately when unlockfs is called
++	 */
++	return s;
++}
++/*
++ * Note: don't check the dirty flag before waiting, we want the lock
++ * to happen every time this is called.  dev must be non-zero
++ */
++void sync_supers_lockfs(kdev_t dev)
++{
++	struct super_block *sb;
++	sb = find_super_for_lockfs(dev);
++	if (sb) {
++		write_super_lockfs(sb);
++		/* the drop_super is done by unlockfs */
++	}
++}
++
++static void drop_super_lockfs(struct super_block *s)
++{
++	if (s->s_type == &lockfs_fs_type) {
++		struct file_system_type *fs = s->s_type;
++
++		/* 
++		 * nobody else is allowed to grab_super() on our temp
++		 */
++		if (!deactivate_super(s))
++			BUG();
++
++		spin_lock(&sb_lock);
++		s->s_root = NULL;
++		list_del(&s->s_list);
++		list_del(&s->s_instances);
++		spin_unlock(&sb_lock);
++
++		up_write(&s->s_umount);
++		put_super(s);
++		put_filesystem(fs);
++	} else
++		drop_super(s);
++}
++
++void unlockfs(kdev_t dev)
++{
++	struct super_block *s;
++	if (!dev)
++		return;
++
++	spin_lock(&sb_lock);
++	s = find_super(dev);
++	if (s) {
++		/* 
++		 * find_super and the original lockfs call both incremented
++		 * the reference count.  drop one of them
++		 */
++		s->s_count--;
++		spin_unlock(&sb_lock);
++		if (s->s_root) {
++			if (s->s_op->unlockfs)
++				s->s_op->unlockfs(s);
++			drop_super_lockfs(s);
++			goto out;
++		} else {
++			printk("unlockfs: no s_root, dev %s\n", kdevname(dev));
++			BUG();
++		}
++	} else {
++		printk("unlockfs: no super found, dev %s\n", kdevname(dev));
++		BUG();
++	}
++
++	spin_unlock(&sb_lock);
++out:
++	return;
++}
++
+ /**
+  *	get_super	-	get the superblock of a device
+  *	@dev: device to get the superblock for
+--- kernel-source-2.4.26-2.4.26/include/linux/device-mapper.h	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/include/linux/device-mapper.h	2004-08-12 13:41:02.000000000 +0900
+@@ -74,6 +74,7 @@
+ struct target_type {
+ 	const char *name;
+ 	struct module *module;
++	unsigned version[3];
+ 	dm_ctr_fn ctr;
+ 	dm_dtr_fn dtr;
+ 	dm_map_fn map;
+--- kernel-source-2.4.26-2.4.26/include/linux/dm-ioctl.h	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/include/linux/dm-ioctl.h	2004-08-12 13:41:02.000000000 +0900
+@@ -163,6 +163,16 @@
+ };
+ 
+ /*
++ * Used to retrieve the target versions
++ */
++struct dm_target_versions {
++	uint32_t next;
++	uint32_t version[3];
++
++	char name[0];
++};
++
++/*
+  * If you change this make sure you make the corresponding change
+  * to dm-ioctl.c:lookup_ioctl()
+  */
+@@ -185,6 +195,9 @@
+ 	DM_TABLE_CLEAR_CMD,
+ 	DM_TABLE_DEPS_CMD,
+ 	DM_TABLE_STATUS_CMD,
++
++	/* Added later */
++	DM_LIST_VERSIONS_CMD,
+ };
+ 
+ #define DM_IOCTL 0xfd
+@@ -205,10 +218,12 @@
+ #define DM_TABLE_DEPS    _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
+ #define DM_TABLE_STATUS  _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
+ 
++#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
++
+ #define DM_VERSION_MAJOR	4
+-#define DM_VERSION_MINOR	0
+-#define DM_VERSION_PATCHLEVEL	5
+-#define DM_VERSION_EXTRA	"-ioctl (2003-11-18)"
++#define DM_VERSION_MINOR	1
++#define DM_VERSION_PATCHLEVEL	1
++#define DM_VERSION_EXTRA	"-ioctl (2004-04-07)"
+ 
+ /* Status bits */
+ #define DM_READONLY_FLAG	(1 << 0) /* In/Out */
+--- kernel-source-2.4.26-2.4.26/include/linux/fs.h	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/include/linux/fs.h	2004-08-12 13:41:02.000000000 +0900
+@@ -1279,6 +1279,7 @@
+ extern int sync_buffers(kdev_t, int);
+ extern void sync_dev(kdev_t);
+ extern int fsync_dev(kdev_t);
++extern int fsync_dev_lockfs(kdev_t);
+ extern int fsync_super(struct super_block *);
+ extern int fsync_no_super(kdev_t);
+ extern void sync_inodes_sb(struct super_block *);
+@@ -1297,6 +1298,8 @@
+ extern int filemap_fdatasync(struct address_space *);
+ extern int filemap_fdatawait(struct address_space *);
+ extern void sync_supers(kdev_t dev, int wait);
++extern void sync_supers_lockfs(kdev_t);
++extern void unlockfs(kdev_t);
+ extern int bmap(struct inode *, int);
+ extern int notify_change(struct dentry *, struct iattr *);
+ extern int permission(struct inode *, int);
+--- kernel-source-2.4.26-2.4.26/kernel/ksyms.c	2004-08-12 14:04:28.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/kernel/ksyms.c	2004-08-12 13:41:02.000000000 +0900
+@@ -207,6 +207,8 @@
+ EXPORT_SYMBOL(invalidate_inode_pages);
+ EXPORT_SYMBOL(truncate_inode_pages);
+ EXPORT_SYMBOL(fsync_dev);
++EXPORT_SYMBOL(fsync_dev_lockfs);
++EXPORT_SYMBOL(unlockfs);
+ EXPORT_SYMBOL(fsync_no_super);
+ EXPORT_SYMBOL(permission);
+ EXPORT_SYMBOL(vfs_permission);
+--- kernel-source-2.4.26-2.4.26/mm/filemap.c	2004-04-14 22:05:41.000000000 +0900
++++ kernel-source-2.4.26-2.4.26.devmap/mm/filemap.c	2004-08-12 13:41:02.000000000 +0900
+@@ -1809,7 +1809,8 @@
+ 			retval = do_generic_direct_read(filp, buf, count, ppos);
+ 		up(&inode->i_sem);
+ 		up_read(&inode->i_alloc_sem);
+-		UPDATE_ATIME(filp->f_dentry->d_inode);
++		if (!S_ISBLK(inode->i_mode))
++			UPDATE_ATIME(filp->f_dentry->d_inode);
+ 		goto out;
+ 	}
+ }
+@@ -3187,8 +3188,12 @@
+ 		goto out;
+ 
+ 	remove_suid(inode);
+-	inode->i_ctime = inode->i_mtime = CURRENT_TIME;
+-	mark_inode_dirty_sync(inode);
++
++	/* Don't update times for block devices using O_DIRECT */
++	if (!(file->f_flags & O_DIRECT) || !S_ISBLK(inode->i_mode)) {
++		inode->i_ctime = inode->i_mtime = CURRENT_TIME;
++		mark_inode_dirty_sync(inode);
++	}
+ 
+ 	do {
+ 		unsigned long index, offset;