mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 08:02:56 +00:00
kill BH_Ordered flag
Instead of abusing a buffer_head flag just add a variant of sync_dirty_buffer which allows passing the exact type of write flag required. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
dad5eb6daa
commit
87e99511ea
5 changed files with 63 additions and 73 deletions
17
fs/buffer.c
17
fs/buffer.c
|
@ -2911,13 +2911,6 @@ int submit_bh(int rw, struct buffer_head * bh)
|
|||
BUG_ON(buffer_delay(bh));
|
||||
BUG_ON(buffer_unwritten(bh));
|
||||
|
||||
/*
|
||||
* Mask in barrier bit for a write (could be either a WRITE or a
|
||||
* WRITE_SYNC
|
||||
*/
|
||||
if (buffer_ordered(bh) && (rw & WRITE))
|
||||
rw |= WRITE_BARRIER;
|
||||
|
||||
/*
|
||||
* Only clear out a write error when rewriting
|
||||
*/
|
||||
|
@ -3021,7 +3014,7 @@ EXPORT_SYMBOL(ll_rw_block);
|
|||
* and then start new I/O and then wait upon it. The caller must have a ref on
|
||||
* the buffer_head.
|
||||
*/
|
||||
int sync_dirty_buffer(struct buffer_head *bh)
|
||||
int __sync_dirty_buffer(struct buffer_head *bh, int rw)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
|
@ -3030,7 +3023,7 @@ int sync_dirty_buffer(struct buffer_head *bh)
|
|||
if (test_clear_buffer_dirty(bh)) {
|
||||
get_bh(bh);
|
||||
bh->b_end_io = end_buffer_write_sync;
|
||||
ret = submit_bh(WRITE_SYNC, bh);
|
||||
ret = submit_bh(rw, bh);
|
||||
wait_on_buffer(bh);
|
||||
if (buffer_eopnotsupp(bh)) {
|
||||
clear_buffer_eopnotsupp(bh);
|
||||
|
@ -3043,6 +3036,12 @@ int sync_dirty_buffer(struct buffer_head *bh)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(__sync_dirty_buffer);
|
||||
|
||||
int sync_dirty_buffer(struct buffer_head *bh)
|
||||
{
|
||||
return __sync_dirty_buffer(bh, WRITE_SYNC);
|
||||
}
|
||||
EXPORT_SYMBOL(sync_dirty_buffer);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue