From 546db14ee74118296f425f3b91634fb767d67290 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 27 Jan 2000 01:05:20 +0000 Subject: Merge with Linux 2.3.23. The new bootmem stuff has broken various platforms. At this time I've only verified that IP22 support compiles and IP27 actually works. --- fs/iobuf.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'fs/iobuf.c') diff --git a/fs/iobuf.c b/fs/iobuf.c index b46a13bfd..eaabf2f7c 100644 --- a/fs/iobuf.c +++ b/fs/iobuf.c @@ -50,7 +50,6 @@ int alloc_kiovec(int nr, struct kiobuf **bufp) init_waitqueue_head(&iobuf->wait_queue); iobuf->end_io = simple_wakeup_kiobuf; iobuf->array_len = KIO_STATIC_PAGES; - iobuf->pagelist = iobuf->page_array; iobuf->maplist = iobuf->map_array; *bufp++ = iobuf; } @@ -65,50 +64,35 @@ void free_kiovec(int nr, struct kiobuf **bufp) for (i = 0; i < nr; i++) { iobuf = bufp[i]; - if (iobuf->array_len > KIO_STATIC_PAGES) { - kfree (iobuf->pagelist); + if (iobuf->array_len > KIO_STATIC_PAGES) kfree (iobuf->maplist); - } kmem_cache_free(kiobuf_cachep, bufp[i]); } } int expand_kiobuf(struct kiobuf *iobuf, int wanted) { - unsigned long * pagelist; struct page ** maplist; if (iobuf->array_len >= wanted) return 0; - pagelist = (unsigned long *) - kmalloc(wanted * sizeof(unsigned long), GFP_KERNEL); - if (!pagelist) - return -ENOMEM; - maplist = (struct page **) kmalloc(wanted * sizeof(struct page **), GFP_KERNEL); - if (!maplist) { - kfree(pagelist); + if (!maplist) return -ENOMEM; - } /* Did it grow while we waited? */ if (iobuf->array_len >= wanted) { - kfree(pagelist); kfree(maplist); return 0; } - memcpy (pagelist, iobuf->pagelist, wanted * sizeof(unsigned long)); memcpy (maplist, iobuf->maplist, wanted * sizeof(struct page **)); - if (iobuf->array_len > KIO_STATIC_PAGES) { - kfree (iobuf->pagelist); + if (iobuf->array_len > KIO_STATIC_PAGES) kfree (iobuf->maplist); - } - iobuf->pagelist = pagelist; iobuf->maplist = maplist; iobuf->array_len = wanted; return 0; -- cgit v1.2.3