Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id g2MIwti28176 for linux-xfs-outgoing; Fri, 22 Mar 2002 10:58:55 -0800 Received: from zok.sgi.com (zok.sgi.com [204.94.215.101]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id g2MIweq28148 for ; Fri, 22 Mar 2002 10:58:40 -0800 Received: from zeus-e8.americas.sgi.com (zeus-e8.americas.sgi.com [128.162.8.103]) by zok.sgi.com (8.12.2/8.12.2/linux-outbound_gateway-1.2) with ESMTP id g2MK0xBA027849 for ; Fri, 22 Mar 2002 12:00:59 -0800 Received: from poppy-e185.americas.sgi.com (poppy-e185.americas.sgi.com [128.162.185.207]) by zeus-e8.americas.sgi.com (SGI-SGI-8.9.3/americas-smart-nospam1.1) with ESMTP id MAA88198 for ; Fri, 22 Mar 2002 12:59:43 -0600 (CST) Received: from stout.americas.sgi.com (stout.americas.sgi.com [128.162.187.5]) by poppy-e185.americas.sgi.com (980427.SGI.8.8.8/SGI-server-1.7) with ESMTP id MAA02838 for ; Fri, 22 Mar 2002 12:59:43 -0600 (CST) Subject: LVM patch for XFS 1.1-PR2 release From: Eric Sandeen To: linux-xfs@oss.sgi.com Content-Type: multipart/mixed; boundary="=-mxa6L/kxZVtKE9e3Cat7" X-Mailer: Evolution/1.0.2 Date: 22 Mar 2002 12:59:43 -0600 Message-Id: <1016823583.6022.18.camel@stout.americas.sgi.com> Mime-Version: 1.0 Sender: owner-linux-xfs@oss.sgi.com Precedence: bulk --=-mxa6L/kxZVtKE9e3Cat7 Content-Type: text/plain Content-Transfer-Encoding: 7bit Whoops, I patched the 2.4.9-31 kernels for LVM 1.0.3, but then forgot to enable LVM in the configs. And it turns out that as it is, it won't compile. Well... that's why we issue test releases I guess. Thanks for finding it, Seth! :) If anyone wants to use LVM with this release, here's a patch to get it building again; we'll get it turned on in the next spin. -Eric -- Eric Sandeen XFS for Linux http://oss.sgi.com/projects/xfs sandeen@sgi.com SGI, Inc. --=-mxa6L/kxZVtKE9e3Cat7 Content-Disposition: attachment; filename=lvm_fix_2.4.9.patch Content-Transfer-Encoding: quoted-printable Content-Type: text/x-patch; charset=ISO-8859-1 diff -urp linux-2.4.9-31-RH-xfs-1.1-newdelalloc/drivers/md/lvm-snap.c linux= -2.4.9-31-RH-xfs-1.1/drivers/md/lvm-snap.c --- linux-2.4.9-31-RH-xfs-1.1-newdelalloc/drivers/md/lvm-snap.c Tue Mar 19 = 11:59:48 2002 +++ linux-2.4.9-31-RH-xfs-1.1/drivers/md/lvm-snap.c Fri Mar 22 10:15:22 2002 @@ -540,9 +540,10 @@ out: int lvm_snapshot_alloc(lv_t * lv_snap) { int ret, max_sectors; + int nbhs =3D KIO_MAX_SECTORS; =20 /* allocate kiovec to do chunk io */ - ret =3D alloc_kiovec(1, &lv_snap->lv_iobuf); + ret =3D alloc_kiovec_sz(1, &lv_snap->lv_iobuf, &nbhs); if (ret) goto out; =20 max_sectors =3D KIO_MAX_SECTORS << (PAGE_SHIFT-9); @@ -551,7 +552,7 @@ int lvm_snapshot_alloc(lv_t * lv_snap) if (ret) goto out_free_kiovec; =20 /* allocate kiovec to do exception table io */ - ret =3D alloc_kiovec(1, &lv_snap->lv_COW_table_iobuf); + ret =3D alloc_kiovec_sz(1, &lv_snap->lv_COW_table_iobuf, &nbhs); if (ret) goto out_free_kiovec; =20 ret =3D lvm_snapshot_alloc_iobuf_pages(lv_snap->lv_COW_table_iobuf, @@ -566,12 +567,12 @@ out: =20 out_free_both_kiovecs: unmap_kiobuf(lv_snap->lv_COW_table_iobuf); - free_kiovec(1, &lv_snap->lv_COW_table_iobuf); + free_kiovec_sz(1, &lv_snap->lv_COW_table_iobuf, &nbhs); lv_snap->lv_COW_table_iobuf =3D NULL; =20 out_free_kiovec: unmap_kiobuf(lv_snap->lv_iobuf); - free_kiovec(1, &lv_snap->lv_iobuf); + free_kiovec_sz(1, &lv_snap->lv_iobuf, &nbhs); lv_snap->lv_iobuf =3D NULL; vfree(lv_snap->lv_snapshot_hash_table); lv_snap->lv_snapshot_hash_table =3D NULL; @@ -580,6 +581,8 @@ out_free_kiovec: =20 void lvm_snapshot_release(lv_t * lv) { + int nbhs =3D KIO_MAX_SECTORS; + if (lv->lv_block_exception) { vfree(lv->lv_block_exception); @@ -595,14 +598,14 @@ void lvm_snapshot_release(lv_t * lv) { kiobuf_wait_for_io(lv->lv_iobuf); unmap_kiobuf(lv->lv_iobuf); - free_kiovec(1, &lv->lv_iobuf); + free_kiovec_sz(1, &lv->lv_iobuf, &nbhs); lv->lv_iobuf =3D NULL; } if (lv->lv_COW_table_iobuf) { kiobuf_wait_for_io(lv->lv_COW_table_iobuf); unmap_kiobuf(lv->lv_COW_table_iobuf); - free_kiovec(1, &lv->lv_COW_table_iobuf); + free_kiovec_sz(1, &lv->lv_COW_table_iobuf, &nbhs); lv->lv_COW_table_iobuf =3D NULL; } } diff -urp linux-2.4.9-31-RH-xfs-1.1-newdelalloc/drivers/md/lvm.c linux-2.4.= 9-31-RH-xfs-1.1/drivers/md/lvm.c --- linux-2.4.9-31-RH-xfs-1.1-newdelalloc/drivers/md/lvm.c Tue Mar 19 11:59= :48 2002 +++ linux-2.4.9-31-RH-xfs-1.1/drivers/md/lvm.c Fri Mar 22 10:25:22 2002 @@ -401,7 +400,6 @@ struct file_operations lvm_chr_fops =3D { /* block device operations structure needed for 2.3.38? and above */ struct block_device_operations lvm_blk_dops =3D { - owner: THIS_MODULE, open: lvm_blk_open, release: lvm_blk_close, ioctl: lvm_blk_ioctl, --- linux-2.4.9-31-RH-xfs-1.1-newdelalloc/include/linux/lvm.h Tue Mar 19 13= :47:47 2002 +++ linux-2.4.9-31-RH-xfs-1.1/include/linux/lvm.h Fri Mar 22 10:25:13 2002 @@ -92,6 +92,9 @@ /* if you like emergency reset code in the driver */ #define LVM_TOTAL_RESET =20 +#define min(a, b) ((a) < (b) ? (a) : (b)) +#define max(a, b) ((a) > (b) ? (a) : (b)) + #ifdef __KERNEL__ #undef LVM_HD_NAME /* display nice names in /proc/partitions */ =20 --=-mxa6L/kxZVtKE9e3Cat7--