From 2fedf879e59d69403c79ad9d61e6d6edbe9ff97e Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 4 Mar 2002 17:24:21 +0000 Subject: [PATCH] o b_bdev_private patch for ext3 o makefiles include snapshot code etc. --- kernel/Makefile.in | 1 + kernel/common/dm.c.in | 10 +++++----- patches/ioctl/linux-2.4.16-b_bdev_private.patch | 15 +++++++++++++++ patches/ioctl/linux-2.4.16-makefile.patch | 9 +++++---- patches/ioctl/linux-2.4.17-b_bdev_private.patch | 15 +++++++++++++++ patches/ioctl/linux-2.4.17-makefile.patch | 9 +++++---- 6 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 patches/ioctl/linux-2.4.16-b_bdev_private.patch create mode 100644 patches/ioctl/linux-2.4.17-b_bdev_private.patch diff --git a/kernel/Makefile.in b/kernel/Makefile.in index d7eeacc..d62aa9f 100644 --- a/kernel/Makefile.in +++ b/kernel/Makefile.in @@ -32,6 +32,7 @@ FS=dmfs-error.c dmfs-lv.c dmfs-root.c dmfs-status.c \ dmfs-super.c dmfs-suspend.c dmfs-table.c dmfs.h COMMON=device-mapper.h dm-linear.c dm-stripe.c \ + dm-mirror.c dm-origin.c dm-snapshot.c kcopyd.c \ dm-table.c dm-target.c dm.c dm.h IOCTL=dm-ioctl.c diff --git a/kernel/common/dm.c.in b/kernel/common/dm.c.in index 045095b..02b5a90 100644 --- a/kernel/common/dm.c.in +++ b/kernel/common/dm.c.in @@ -440,7 +440,7 @@ static inline int call_err_fn(struct io_hook *ih, struct buffer_head *bh) */ static void dec_pending(struct buffer_head *bh, int uptodate) { - struct io_hook *ih = bh->b_private; + struct io_hook *ih = bh->b_bdev_private; if (!uptodate && call_err_fn(ih, bh)) return; @@ -450,7 +450,7 @@ static void dec_pending(struct buffer_head *bh, int uptodate) wake_up(&ih->md->wait); bh->b_end_io = ih->end_io; - bh->b_private = ih->context; + bh->b_bdev_private = ih->context; free_io_hook(ih); bh->b_end_io(bh, uptodate); @@ -514,7 +514,7 @@ static inline int __map_buffer(struct mapped_device *md, ih->rw = rw; ih->target = ti; ih->end_io = bh->b_end_io; - ih->context = bh->b_private; + ih->context = bh->b_bdev_private; r = fn(bh, rw, context); @@ -522,7 +522,7 @@ static inline int __map_buffer(struct mapped_device *md, /* hook the end io request fn */ atomic_inc(&md->pending); bh->b_end_io = dec_pending; - bh->b_private = ih; + bh->b_bdev_private = ih; } else if (r == 0) /* we don't need to hook */ @@ -681,7 +681,7 @@ static int dm_user_bmap(struct inode *inode, struct lv_bmap *lvb) return r; if (put_user(kdev_t_to_nr(r_dev), &lvb->lv_dev) || - put_user(r_block, &lvb->lv_block)) + put_user(r_block, &lvb->lv_block)) return -EFAULT; return 0; diff --git a/patches/ioctl/linux-2.4.16-b_bdev_private.patch b/patches/ioctl/linux-2.4.16-b_bdev_private.patch new file mode 100644 index 0000000..10ff6cd --- /dev/null +++ b/patches/ioctl/linux-2.4.16-b_bdev_private.patch @@ -0,0 +1,15 @@ +diff -ruN linux-2.4.16/include/linux/fs.h linux/include/linux/fs.h +--- linux-2.4.16/include/linux/fs.h Tue Feb 19 15:24:57 2002 ++++ linux/include/linux/fs.h Thu Feb 21 12:34:42 2002 +@@ -257,7 +257,10 @@ + char * b_data; /* pointer to data block */ + struct page *b_page; /* the page this bh is mapped to */ + void (*b_end_io)(struct buffer_head *bh, int uptodate); /* I/O completion */ +- void *b_private; /* reserved for b_end_io */ ++ void *b_private; /* reserved for b_end_io, also used by ext3 */ ++ void *b_bdev_private; /* a hack to get around ext3 using b_private ++ * after handing the buffer_head to the ++ * block layer */ + + unsigned long b_rsector; /* Real buffer location on disk */ + wait_queue_head_t b_wait; diff --git a/patches/ioctl/linux-2.4.16-makefile.patch b/patches/ioctl/linux-2.4.16-makefile.patch index 055ff73..a93d0cb 100644 --- a/patches/ioctl/linux-2.4.16-makefile.patch +++ b/patches/ioctl/linux-2.4.16-makefile.patch @@ -1,20 +1,21 @@ diff -ruN -X /home/thornber/packages/2.4/dontdiff linux/drivers/md/Makefile linux-dm/drivers/md/Makefile --- linux/drivers/md/Makefile Fri Sep 14 22:22:18 2001 +++ linux-dm/drivers/md/Makefile Wed Oct 31 18:09:02 2001 -@@ -4,9 +4,11 @@ +@@ -4,9 +4,12 @@ O_TARGET := mddev.o -export-objs := md.o xor.o -+export-objs := md.o xor.o dm-table.o dm-target.o ++export-objs := md.o xor.o dm-table.o dm-target.o kcopyd.o list-multi := lvm-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-origin.o dm-mirror.o kcopyd.o # Note: link order is important. All raid personalities # and xor.o must come before md.o, as they each initialise -@@ -20,8 +22,12 @@ +@@ -20,8 +23,12 @@ obj-$(CONFIG_MD_MULTIPATH) += multipath.o obj-$(CONFIG_BLK_DEV_MD) += md.o obj-$(CONFIG_BLK_DEV_LVM) += lvm-mod.o diff --git a/patches/ioctl/linux-2.4.17-b_bdev_private.patch b/patches/ioctl/linux-2.4.17-b_bdev_private.patch new file mode 100644 index 0000000..cedecf9 --- /dev/null +++ b/patches/ioctl/linux-2.4.17-b_bdev_private.patch @@ -0,0 +1,15 @@ +diff -ruN linux-2.4.17/include/linux/fs.h linux/include/linux/fs.h +--- linux-2.4.17/include/linux/fs.h Tue Feb 19 15:24:57 2002 ++++ linux/include/linux/fs.h Thu Feb 21 12:34:42 2002 +@@ -257,7 +257,10 @@ + char * b_data; /* pointer to data block */ + struct page *b_page; /* the page this bh is mapped to */ + void (*b_end_io)(struct buffer_head *bh, int uptodate); /* I/O completion */ +- void *b_private; /* reserved for b_end_io */ ++ void *b_private; /* reserved for b_end_io, also used by ext3 */ ++ void *b_bdev_private; /* a hack to get around ext3 using b_private ++ * after handing the buffer_head to the ++ * block layer */ + + unsigned long b_rsector; /* Real buffer location on disk */ + wait_queue_head_t b_wait; diff --git a/patches/ioctl/linux-2.4.17-makefile.patch b/patches/ioctl/linux-2.4.17-makefile.patch index 8a475f3..d15bf6c 100644 --- a/patches/ioctl/linux-2.4.17-makefile.patch +++ b/patches/ioctl/linux-2.4.17-makefile.patch @@ -1,20 +1,21 @@ diff -ruN linux-2.4.17/drivers/md/Makefile linux/drivers/md/Makefile --- linux-2.4.17/drivers/md/Makefile Thu Dec 6 15:57:55 2001 +++ linux/drivers/md/Makefile Wed Jan 2 19:25:16 2002 -@@ -4,9 +4,11 @@ +@@ -4,9 +4,12 @@ O_TARGET := mddev.o -export-objs := md.o xor.o -+export-objs := md.o xor.o dm-table.o dm-target.o ++export-objs := md.o xor.o dm-table.o dm-target.o kcopyd.o list-multi := lvm-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-origin.o dm-mirror.o kcopyd.o # Note: link order is important. All raid personalities # and xor.o must come before md.o, as they each initialise -@@ -20,8 +22,12 @@ +@@ -20,8 +23,12 @@ obj-$(CONFIG_MD_MULTIPATH) += multipath.o obj-$(CONFIG_BLK_DEV_MD) += md.o obj-$(CONFIG_BLK_DEV_LVM) += lvm-mod.o -- 2.43.5