diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
commit | 546db14ee74118296f425f3b91634fb767d67290 (patch) | |
tree | 22b613a3da8d4bf663eec5e155af01b87fdf9094 /fs/iobuf.c | |
parent | 1e25e41c4f5474e14452094492dbc169b800e4c8 (diff) |
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.
Diffstat (limited to 'fs/iobuf.c')
-rw-r--r-- | fs/iobuf.c | 22 |
1 files changed, 3 insertions, 19 deletions
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; |