Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.1.104 /fs/buffer.c

Filename:/fs/buffer.c
Lines Added:14
Lines Deleted:11
Also changed in: (Previous) 2.1.102  2.1.101  2.1.100  2.1.94  2.1.92  2.1.91 
(Following) 2.1.107  2.1.118  2.1.126  2.1.129  2.1.132 

Location
[  2.1.104
  [  fs
     o  buffer.c

Patch

diff -u --recursive --new-file v2.1.103/linux/fs/buffer.c linux/fs/buffer.c
--- v2.1.103/linux/fs/buffer.c   Thu May 14 19:47:43 1998
+++ linux/fs/buffer.c   Thu Jun  4 22:53:50 1998
@@ -10,7 +10,6 @@
  * data, of course), but instead letting the caller do it.
  */
 
-/* Some bdflush() changes for the dynamic ramdisk - Paul Gortmaker, 12/94 */
 /* Start bdflush() with kernel_thread not syscall - Paul Gortmaker, 12/95 */
 
 /* Removed a lot of unnecessary code and simplified things now that
@@ -21,6 +20,10 @@
  * hash table, use SLAB cache for buffer heads. -DaveM
  */
 
+/* Added 32k buffer block sizes - these are required older ARM systems.
+ * - RMK
+ */
+
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
@@ -46,9 +49,13 @@
 #include <asm/io.h>
 #include <asm/bitops.h>
 
-#define NR_SIZES 5
-static char buffersize_index[17] =
-{-1,  0,  1, -1,  2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 4};
+#define NR_SIZES 7
+static char buffersize_index[65] =
+{-1,  0,  1, -1,  2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1,
+  4, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1, -1, -1, -1, -1, -1,
+  5, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1, -1, -1, -1, -1, -1,
+  6};
 
 #define BUFSIZE_INDEX(X) ((int) buffersize_index[(X)>>9])
 #define MAX_BUF_PER_PAGE (PAGE_SIZE / 512)
@@ -637,13 +644,9 @@
    if (!blksize_size[MAJOR(dev)])
       return;
 
-   if (size > PAGE_SIZE)
-      size = 0;
-
-   switch (size) {
-      default: panic("Invalid blocksize passed to set_blocksize");
-      case 512: case 1024: case 2048: case 4096: case 8192: ;
-   }
+   /* Size must be a power of two, and between 512 and PAGE_SIZE */
+   if (size > PAGE_SIZE || size < 512 || (size & (size-1)))
+      panic("Invalid blocksize passed to set_blocksize");
 
    if (blksize_size[MAJOR(dev)][MINOR(dev)] == 0 && size == BLOCK_SIZE) {
       blksize_size[MAJOR(dev)][MINOR(dev)] = size;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.