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

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

Advertisement

Kernel v2.1.132 /fs/buffer.c

Filename:/fs/buffer.c
Lines Added:6
Lines Deleted:8
Also changed in: (Previous) 2.1.129  2.1.126  2.1.118  2.1.107  2.1.104  2.1.102 
(Following)

Location
[  2.1.132
  [  fs
     o  buffer.c

Patch

diff -u --recursive --new-file v2.1.131/linux/fs/buffer.c linux/fs/buffer.c
--- v2.1.131/linux/fs/buffer.c   Thu Nov 19 09:56:28 1998
+++ linux/fs/buffer.c   Mon Dec 21 15:27:41 1998
@@ -691,12 +691,12 @@
       goto no_candidate;
 
    for (; (*list_len) > 0; bh = bh->b_next_free, (*list_len)--) {
-      if (size != bh->b_size) {
+      if (size != bh->b_size && !buffer_touched(bh)) {
          /* This provides a mechanism for freeing blocks
           * of other sizes, this is necessary now that we
           * no longer have the lav code.
           */
-         try_to_free_buffer(bh,&bh,1);
+         try_to_free_buffer(bh,&bh);
          if (!bh)
             break;
          continue;
@@ -920,7 +920,6 @@
              put_last_lru(bh);
          bh->b_flushtime = 0;
       }
-      set_bit(BH_Touched, &bh->b_state);
       return bh;
    }
 
@@ -936,7 +935,7 @@
     */
    init_buffer(bh, dev, block, end_buffer_io_sync, NULL);
    bh->b_lru_time   = jiffies;
-   bh->b_state=(1<<BH_Touched);
+   bh->b_state=0;
    insert_into_queues(bh);
    return bh;
 
@@ -1063,6 +1062,7 @@
    struct buffer_head * bh = getblk(dev, block, size);
 
    if (bh) {
+      touch_buffer(bh);
       if (buffer_uptodate(bh))
          return bh;
       ll_rw_block(READ, 1, &bh);
@@ -1101,6 +1101,7 @@
 
    index = BUFSIZE_INDEX(bh->b_size);
 
+   touch_buffer(bh);
    if (buffer_uptodate(bh))
       return(bh);   
    else ll_rw_block(READ, 1, &bh);
@@ -1638,8 +1639,7 @@
  * try_to_free_buffer() checks if all the buffers on this particular page
  * are unused, and free's the page if so.
  */
-int try_to_free_buffer(struct buffer_head * bh, struct buffer_head ** bhp,
-             int priority)
+int try_to_free_buffer(struct buffer_head * bh, struct buffer_head ** bhp)
 {
    unsigned long page;
    struct buffer_head * tmp, * p;
@@ -1654,8 +1654,6 @@
       if (tmp->b_count || buffer_protected(tmp) ||
           buffer_dirty(tmp) || buffer_locked(tmp) ||
           buffer_waiting(tmp))
-         return 0;
-      if (priority && buffer_touched(tmp))
          return 0;
       tmp = tmp->b_this_page;
    } while (tmp != bh);


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