patch-2.4.0-test3 linux/fs/file.c
Next file: linux/fs/file_table.c
Previous file: linux/fs/fifo.c
Back to the patch index
Back to the overall index
- Lines: 50
- Date:
Fri Jul 7 12:20:04 2000
- Orig file:
v2.4.0-test2/linux/fs/file.c
- Orig date:
Sun Nov 7 16:37:34 1999
diff -u --recursive --new-file v2.4.0-test2/linux/fs/file.c linux/fs/file.c
@@ -24,11 +24,9 @@
struct file **new_fds;
int size = num * sizeof(struct file *);
- if (size < PAGE_SIZE)
+ if (size <= PAGE_SIZE)
new_fds = (struct file **) kmalloc(size, GFP_KERNEL);
- else if (size == PAGE_SIZE)
- new_fds = (struct file **) __get_free_page(GFP_KERNEL);
- else
+ else
new_fds = (struct file **) vmalloc(size);
return new_fds;
}
@@ -44,10 +42,8 @@
if (num <= NR_OPEN_DEFAULT) /* Don't free the embedded fd array! */
return;
- else if (size < PAGE_SIZE)
+ else if (size <= PAGE_SIZE)
kfree(array);
- else if (size == PAGE_SIZE)
- free_page((unsigned long) array);
else
vfree(array);
}
@@ -137,10 +133,8 @@
fd_set *new_fdset;
int size = num / 8;
- if (size < PAGE_SIZE)
+ if (size <= PAGE_SIZE)
new_fdset = (fd_set *) kmalloc(size, GFP_KERNEL);
- else if (size == PAGE_SIZE)
- new_fdset = (fd_set *) __get_free_page(GFP_KERNEL);
else
new_fdset = (fd_set *) vmalloc(size);
return new_fdset;
@@ -157,10 +151,8 @@
if (num <= __FD_SETSIZE) /* Don't free an embedded fdset */
return;
- else if (size < PAGE_SIZE)
+ else if (size <= PAGE_SIZE)
kfree(array);
- else if (size == PAGE_SIZE)
- free_page((unsigned long) array);
else
vfree(array);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)