Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69612
b: refs/heads/master
c: 68671f3
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Monakhov authored and Linus Torvalds committed Oct 16, 2007
1 parent d4ce3c2 commit 51d4a09
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef8b4520bd9f8294ffce9abd6158085bde5dc902
refs/heads/master: 68671f35fe8d785277118a333c88768a4f894917
32 changes: 17 additions & 15 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ static void buffer_io_error(struct buffer_head *bh)
}

/*
* Default synchronous end-of-IO handler.. Just mark it up-to-date and
* unlock the buffer. This is what ll_rw_block uses too.
* End-of-IO handler helper function which does not touch the bh after
* unlocking it.
* Note: unlock_buffer() sort-of does touch the bh after unlocking it, but
* a race there is benign: unlock_buffer() only use the bh's address for
* hashing after unlocking the buffer, so it doesn't actually touch the bh
* itself.
*/
void end_buffer_read_sync(struct buffer_head *bh, int uptodate)
static void __end_buffer_read_notouch(struct buffer_head *bh, int uptodate)
{
if (uptodate) {
set_buffer_uptodate(bh);
Expand All @@ -122,6 +126,15 @@ void end_buffer_read_sync(struct buffer_head *bh, int uptodate)
clear_buffer_uptodate(bh);
}
unlock_buffer(bh);
}

/*
* Default synchronous end-of-IO handler.. Just mark it up-to-date and
* unlock the buffer. This is what ll_rw_block uses too.
*/
void end_buffer_read_sync(struct buffer_head *bh, int uptodate)
{
__end_buffer_read_notouch(bh, uptodate);
put_bh(bh);
}

Expand Down Expand Up @@ -2245,21 +2258,10 @@ block_page_mkwrite(struct vm_area_struct *vma, struct page *page,
* nobh_prepare_write()'s prereads are special: the buffer_heads are freed
* immediately, while under the page lock. So it needs a special end_io
* handler which does not touch the bh after unlocking it.
*
* Note: unlock_buffer() sort-of does touch the bh after unlocking it, but
* a race there is benign: unlock_buffer() only use the bh's address for
* hashing after unlocking the buffer, so it doesn't actually touch the bh
* itself.
*/
static void end_buffer_read_nobh(struct buffer_head *bh, int uptodate)
{
if (uptodate) {
set_buffer_uptodate(bh);
} else {
/* This happens, due to failed READA attempts. */
clear_buffer_uptodate(bh);
}
unlock_buffer(bh);
__end_buffer_read_notouch(bh, uptodate);
}

/*
Expand Down

0 comments on commit 51d4a09

Please sign in to comment.