patch-2.3.23 linux/fs/iobuf.c
Next file: linux/fs/minix/truncate.c
Previous file: linux/fs/inode.c
Back to the patch index
Back to the overall index
- Lines: 62
- Date:
Tue Oct 19 10:22:19 1999
- Orig file:
v2.3.22/linux/fs/iobuf.c
- Orig date:
Tue Aug 31 17:29:14 1999
diff -u --recursive --new-file v2.3.22/linux/fs/iobuf.c linux/fs/iobuf.c
@@ -50,7 +50,6 @@
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 @@
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;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)