Commit a88cff7f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] make sync_dirty_buffer() return something useful

Make sync_dirty_buffer() return the result of its syncing.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 681bf63d
......@@ -2868,20 +2868,26 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
/*
* For a data-integrity writeout, we need to wait upon any in-progress I/O
* and then start new I/O and then wait upon it.
* and then start new I/O and then wait upon it. The caller must have a ref on
* the buffer_head.
*/
void sync_dirty_buffer(struct buffer_head *bh)
int sync_dirty_buffer(struct buffer_head *bh)
{
int ret = 0;
WARN_ON(atomic_read(&bh->b_count) < 1);
lock_buffer(bh);
if (test_clear_buffer_dirty(bh)) {
get_bh(bh);
bh->b_end_io = end_buffer_write_sync;
submit_bh(WRITE, bh);
ret = submit_bh(WRITE, bh);
wait_on_buffer(bh);
if (!ret && !buffer_uptodate(bh))
ret = -EIO;
} else {
unlock_buffer(bh);
}
return ret;
}
/*
......
......@@ -174,7 +174,7 @@ void free_buffer_head(struct buffer_head * bh);
void FASTCALL(unlock_buffer(struct buffer_head *bh));
void FASTCALL(__lock_buffer(struct buffer_head *bh));
void ll_rw_block(int, int, struct buffer_head * bh[]);
void sync_dirty_buffer(struct buffer_head *bh);
int sync_dirty_buffer(struct buffer_head *bh);
int submit_bh(int, struct buffer_head *);
void write_boundary_block(struct block_device *bdev,
sector_t bblock, unsigned blocksize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment