linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Patch for lvm-1.0.1-rc4 to work under linux-2.4.10-ac4 (Re-edition)
@ 2001-10-03 22:40 Andre Margis
  2001-10-12  4:20 ` Mark van Walraven
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Margis @ 2001-10-03 22:40 UTC (permalink / raw)
  To: linux-lvm

Sorry, for last message i wrong the function alloc_kiovec, is to be 
alloc_kiovec_sz


I change two programs to run under linux.2.4.10-ac4


I don't if this is correct. I test on my machine I believe it's working


This is my corrections:

on lvm.c

line 457
     /* insert our gendisk at the corresponding major */
        /*
        if (gendisk_head != NULL) {
                gendisk_ptr = gendisk_head;
                while (gendisk_ptr->next != NULL &&
                       gendisk_ptr->major > lvm_gendisk.major) {
                        gendisk_ptr = gendisk_ptr->next;
                }
                lvm_gendisk.next = gendisk_ptr->next;
                gendisk_ptr->next = &lvm_gendisk;
        } else {
                gendisk_head = &lvm_gendisk;
                lvm_gendisk.next = NULL;
        }
        */

        add_gendisk(&lvm_gendisk);

line 515
        /*
        gendisk_ptr = gendisk_ptr_prev = gendisk_head;
        while (gendisk_ptr != NULL) {
                if (gendisk_ptr == &lvm_gendisk)
                        break;
                gendisk_ptr_prev = gendisk_ptr;
                gendisk_ptr = gendisk_ptr->next;
        }*/
        /* delete our gendisk from chain */
        /*
        if (gendisk_ptr == &lvm_gendisk)
                gendisk_ptr_prev->next = gendisk_ptr->next;*/

        del_gendisk(&lvm_gendisk);


on lvm-snap.c

add line 53
int kio_max_sectors = KIO_MAX_SECTORS;

change all functions alloc_kiovec(a,b) by 
alloc_kiovec_sz(a,b,&kio_max_sectors)
at lines 518 and 527.

change all functions  free_kiovec(a,b) by free_kiovec_sz(a,b,&kio_max_sectors)
at lines 543, 548, 573 and 580


My changes are correct?

Any help?



Thanks



Andre

_______________________________________________
linux-lvm mailing list
linux-lvm@sistina.com
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

-------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Patch for lvm-1.0.1-rc4 to work under linux-2.4.10-ac4 (Re-edition)
  2001-10-03 22:40 [linux-lvm] Patch for lvm-1.0.1-rc4 to work under linux-2.4.10-ac4 (Re-edition) Andre Margis
@ 2001-10-12  4:20 ` Mark van Walraven
  2001-10-12  7:49   ` Joe Thornber
  0 siblings, 1 reply; 3+ messages in thread
From: Mark van Walraven @ 2001-10-12  4:20 UTC (permalink / raw)
  To: linux-lvm

On Wed, Oct 03, 2001 at 07:40:00PM -0300, Andre Margis wrote:
> I change two programs to run under linux.2.4.10-ac4

The first set is functionally identical to the changes made to lvm.c
in Christoph Hellwig's gendisk clean-up.  By the looks of things, these
changes have been made in both the Linus and ac kernels.

The changes you made to lvm_snap.c are also similar to changes to the
LVM in the ac kernels, but do not appear in the Linus kernel.

For the convenience of the list and the developers, I've included unified
diffs below.

> My changes are correct?

I think so.  The danger is that other critical changes in the LVM code
in the ac kernels have not also been made in 1.0.1-rc4. I hope the
developers can have a look.

Developers, is there much progress in feeding LVM 1.0.x to Alan?

Regards,

Mark.

--- LVM/1.0.1-rc4/PATCHES/cleaned/lvm.c	Fri Oct 12 11:30:15 2001
+++ linux-2.4.10-ac11/drivers/md/lvm.c	Fri Oct 12 15:34:30 2001
@@ -432,8 +432,6 @@
  */
 int lvm_init(void)
 {
-	struct gendisk *gendisk_ptr = NULL;
-
 	if (devfs_register_chrdev(LVM_CHAR_MAJOR,
 				  lvm_name, &lvm_chr_fops) < 0) {
 		printk(KERN_ERR "%s -- devfs_register_chrdev failed\n",
@@ -453,20 +451,7 @@
 	lvm_init_fs();
 	lvm_init_vars();
 	lvm_geninit(&lvm_gendisk);
-
-	/* insert our gendisk@the corresponding major */
-	if (gendisk_head != NULL) {
-		gendisk_ptr = gendisk_head;
-		while (gendisk_ptr->next != NULL &&
-		       gendisk_ptr->major > lvm_gendisk.major) {
-			gendisk_ptr = gendisk_ptr->next;
-		}
-		lvm_gendisk.next = gendisk_ptr->next;
-		gendisk_ptr->next = &lvm_gendisk;
-	} else {
-		gendisk_head = &lvm_gendisk;
-		lvm_gendisk.next = NULL;
-	}
+	add_gendisk(&lvm_gendisk);
 
 #ifdef LVM_HD_NAME
 	/* reference from drivers/block/genhd.c */
@@ -499,8 +484,6 @@
 
 static void lvm_cleanup(void)
 {
-	struct gendisk *gendisk_ptr = NULL, *gendisk_ptr_prev = NULL;
-
 	if (devfs_unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
 		printk(KERN_ERR "%s -- devfs_unregister_chrdev failed\n",
 		       lvm_name);
@@ -508,18 +491,7 @@
 		printk(KERN_ERR "%s -- devfs_unregister_blkdev failed\n",
 		       lvm_name);
 
-
-
-	gendisk_ptr = gendisk_ptr_prev = gendisk_head;
-	while (gendisk_ptr != NULL) {
-		if (gendisk_ptr == &lvm_gendisk)
-			break;
-		gendisk_ptr_prev = gendisk_ptr;
-		gendisk_ptr = gendisk_ptr->next;
-	}
-	/* delete our gendisk from chain */
-	if (gendisk_ptr == &lvm_gendisk)
-		gendisk_ptr_prev->next = gendisk_ptr->next;
+	del_gendisk(&lvm_gendisk);
 
 	blk_size[MAJOR_NR] = NULL;
 	blksize_size[MAJOR_NR] = NULL;
--- LVM/1.0.1-rc4/PATCHES/cleaned/lvm-snap.c	Fri Oct 12 11:30:15 2001
+++ linux-2.4.10-ac11/drivers/md/lvm-snap.c	Fri Oct 12 17:09:56 2001
@@ -511,9 +511,10 @@
 int lvm_snapshot_alloc(lv_t * lv_snap)
 {
 	int ret, max_sectors;
+       int nbhs = KIO_MAX_SECTORS;
 
 	/* allocate kiovec to do chunk io */
-	ret = alloc_kiovec(1, &lv_snap->lv_iobuf);
+       ret = alloc_kiovec_sz(1, &lv_snap->lv_iobuf, &nbhs);
 	if (ret) goto out;
 
 	max_sectors = KIO_MAX_SECTORS << (PAGE_SHIFT-9);
@@ -522,7 +523,7 @@
 	if (ret) goto out_free_kiovec;
 
 	/* allocate kiovec to do exception table io */
-	ret = alloc_kiovec(1, &lv_snap->lv_COW_table_iobuf);
+       ret = alloc_kiovec_sz(1, &lv_snap->lv_COW_table_iobuf, &nbhs);
 	if (ret) goto out_free_kiovec;
 
 	ret = lvm_snapshot_alloc_iobuf_pages(lv_snap->lv_COW_table_iobuf,
@@ -538,12 +539,12 @@
 
 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 = NULL;
 
 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 = NULL;
 	if (lv_snap->lv_snapshot_hash_table != NULL)
 		vfree(lv_snap->lv_snapshot_hash_table);
@@ -553,6 +554,8 @@
 
 void lvm_snapshot_release(lv_t * lv)
 {
+	int 	nbhs = KIO_MAX_SECTORS;
+
 	if (lv->lv_block_exception)
 	{
 		vfree(lv->lv_block_exception);
@@ -568,14 +571,14 @@
 	{
 	        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 = 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 = NULL;
 	}
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Patch for lvm-1.0.1-rc4 to work under linux-2.4.10-ac4 (Re-edition)
  2001-10-12  4:20 ` Mark van Walraven
@ 2001-10-12  7:49   ` Joe Thornber
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Thornber @ 2001-10-12  7:49 UTC (permalink / raw)
  To: linux-lvm

On Fri, Oct 12, 2001 at 05:20:43PM +1300, Mark van Walraven wrote:
> Developers, is there much progress in feeding LVM 1.0.x to Alan?

Alan has all patches to bring him up to about -rc2.

- Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-12  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-03 22:40 [linux-lvm] Patch for lvm-1.0.1-rc4 to work under linux-2.4.10-ac4 (Re-edition) Andre Margis
2001-10-12  4:20 ` Mark van Walraven
2001-10-12  7:49   ` Joe Thornber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).