Linux-kernel mailing list archive 1999-34,: [patch] buffer.c -> flushtime == 0 make no sense

# [patch] buffer.c -> flushtime == 0 make no sense

Andrea Arcangeli (andrea@suse.de)
Mon, 23 Aug 1999 19:00:52 +0200 (CEST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: tytso@mit.edu: "Problems with Linux 2.3.1[1-4] on a Sony VAIO laptop"
- Previous message: kuznet@ms2.inr.ac.ru: "Re: proxy_arp bug? [was Re: autorouting problem]"

The flushtime field make sense only if the buffer is dirty and the only
place that should touch flushtime is mark_buffer_dirty to set the timeout
properly _if_ the buffer was not previously dirty. And the only place that
should read flushtime is sync_old_buffers _only_ if the buffer is dirty
(and if the buffer is dirty it means that flushtime is been set properly
in the past).

Setting flushtime to zero make no sense and if it would make sense it
would be a jiffy-wrap bug.

This patch cleanup the flushtime handling in 2.3.15-pre2.

--- 2.3.15-pre2-flushtime/fs/buffer.c.~1~ Thu Aug 12 02:53:23 1999
+++ 2.3.15-pre2-flushtime/fs/buffer.c Mon Aug 23 18:49:16 1999
@@ -227,7 +227,6 @@
continue;
atomic_inc(&bh->b_count);
- bh->b_flushtime = 0;
spin_unlock(&lru_list_lock);
ll_rw_block(WRITE, 1, &bh);
atomic_dec(&bh->b_count);
@@ -437,7 +436,6 @@
}
if (atomic_read(&bh->b_count))
continue;
- bh->b_flushtime = 0;
clear_bit(BH_Protected, &bh->b_state);
clear_bit(BH_Uptodate, &bh->b_state);
clear_bit(BH_Dirty, &bh->b_state);
@@ -652,7 +650,6 @@
clear_bit(BH_Dirty, &bh->b_state);
clear_bit(BH_Uptodate, &bh->b_state);
clear_bit(BH_Req, &bh->b_state);
- bh->b_flushtime = 0;
}
if (atomic_read(&bh->b_count) == 0) {
__remove_from_queues(bh);
@@ -678,7 +675,6 @@
void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *dev_id)
{
bh->b_list = BUF_CLEAN;
- bh->b_flushtime = 0;
bh->b_end_io = handler;
bh->b_dev_id = dev_id;
}
@@ -792,12 +788,8 @@
repeat:
bh = get_hash_table(dev, block, size);
- if (bh) {
- if (!buffer_dirty(bh)) {
- bh->b_flushtime = 0;
- }
+ if (bh)
goto out;
- }
isize = BUFSIZE_INDEX(size);
spin_lock(&free_list[isize].lock);
@@ -1132,7 +1124,6 @@
bh->b_data = (char *) (page+offset);
bh->b_list = BUF_CLEAN;
- bh->b_flushtime = 0;
bh->b_end_io = end_buffer_io_bad;
}
return head;
@@ -2324,7 +2315,6 @@
continue;
/* OK, now we are committed to write it out. */
- bh->b_flushtime = 0;
atomic_inc(&bh->b_count);
spin_unlock(&lru_list_lock);
ll_rw_block(WRITE, 1, &bh);
@@ -2448,7 +2438,6 @@
major = MAJOR(bh->b_dev);
written++;
- bh->b_flushtime = 0;
/*
* For the loop major we can try to do asynchronous writes,

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: tytso@mit.edu: "Problems with Linux 2.3.1[1-4] on a Sony VAIO laptop"
- Previous message: kuznet@ms2.inr.ac.ru: "Re: proxy_arp bug? [was Re: autorouting problem]"