From: Jan Kara We need to be sure that current data are sent to disk. Hence we call ll_rw_block() with SWRITE. Signed-off-by: Jan Kara Signed-off-by: Andrew Morton --- fs/ufs/balloc.c | 12 ++++-------- fs/ufs/ialloc.c | 6 ++---- fs/ufs/truncate.c | 9 +++------ 3 files changed, 9 insertions(+), 18 deletions(-) diff -puN fs/ufs/balloc.c~change-ll_rw_block-calls-in-ufs fs/ufs/balloc.c --- 25/fs/ufs/balloc.c~change-ll_rw_block-calls-in-ufs Mon Jul 11 16:31:56 2005 +++ 25-akpm/fs/ufs/balloc.c Mon Jul 11 16:31:56 2005 @@ -114,8 +114,7 @@ void ufs_free_fragments (struct inode * ubh_mark_buffer_dirty (USPI_UBH); ubh_mark_buffer_dirty (UCPI_UBH); if (sb->s_flags & MS_SYNCHRONOUS) { - ubh_wait_on_buffer (UCPI_UBH); - ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **)&ucpi); + ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **)&ucpi); ubh_wait_on_buffer (UCPI_UBH); } sb->s_dirt = 1; @@ -200,8 +199,7 @@ do_more: ubh_mark_buffer_dirty (USPI_UBH); ubh_mark_buffer_dirty (UCPI_UBH); if (sb->s_flags & MS_SYNCHRONOUS) { - ubh_wait_on_buffer (UCPI_UBH); - ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **)&ucpi); + ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **)&ucpi); ubh_wait_on_buffer (UCPI_UBH); } @@ -459,8 +457,7 @@ ufs_add_fragments (struct inode * inode, ubh_mark_buffer_dirty (USPI_UBH); ubh_mark_buffer_dirty (UCPI_UBH); if (sb->s_flags & MS_SYNCHRONOUS) { - ubh_wait_on_buffer (UCPI_UBH); - ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **)&ucpi); + ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **)&ucpi); ubh_wait_on_buffer (UCPI_UBH); } sb->s_dirt = 1; @@ -585,8 +582,7 @@ succed: ubh_mark_buffer_dirty (USPI_UBH); ubh_mark_buffer_dirty (UCPI_UBH); if (sb->s_flags & MS_SYNCHRONOUS) { - ubh_wait_on_buffer (UCPI_UBH); - ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **)&ucpi); + ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **)&ucpi); ubh_wait_on_buffer (UCPI_UBH); } sb->s_dirt = 1; diff -puN fs/ufs/ialloc.c~change-ll_rw_block-calls-in-ufs fs/ufs/ialloc.c --- 25/fs/ufs/ialloc.c~change-ll_rw_block-calls-in-ufs Mon Jul 11 16:31:56 2005 +++ 25-akpm/fs/ufs/ialloc.c Mon Jul 11 16:31:56 2005 @@ -124,8 +124,7 @@ void ufs_free_inode (struct inode * inod ubh_mark_buffer_dirty (USPI_UBH); ubh_mark_buffer_dirty (UCPI_UBH); if (sb->s_flags & MS_SYNCHRONOUS) { - ubh_wait_on_buffer (UCPI_UBH); - ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **) &ucpi); + ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **) &ucpi); ubh_wait_on_buffer (UCPI_UBH); } @@ -249,8 +248,7 @@ cg_found: ubh_mark_buffer_dirty (USPI_UBH); ubh_mark_buffer_dirty (UCPI_UBH); if (sb->s_flags & MS_SYNCHRONOUS) { - ubh_wait_on_buffer (UCPI_UBH); - ubh_ll_rw_block (WRITE, 1, (struct ufs_buffer_head **) &ucpi); + ubh_ll_rw_block (SWRITE, 1, (struct ufs_buffer_head **) &ucpi); ubh_wait_on_buffer (UCPI_UBH); } sb->s_dirt = 1; diff -puN fs/ufs/truncate.c~change-ll_rw_block-calls-in-ufs fs/ufs/truncate.c --- 25/fs/ufs/truncate.c~change-ll_rw_block-calls-in-ufs Mon Jul 11 16:31:56 2005 +++ 25-akpm/fs/ufs/truncate.c Mon Jul 11 16:31:56 2005 @@ -285,8 +285,7 @@ next:; } } if (IS_SYNC(inode) && ind_ubh && ubh_buffer_dirty(ind_ubh)) { - ubh_wait_on_buffer (ind_ubh); - ubh_ll_rw_block (WRITE, 1, &ind_ubh); + ubh_ll_rw_block (SWRITE, 1, &ind_ubh); ubh_wait_on_buffer (ind_ubh); } ubh_brelse (ind_ubh); @@ -353,8 +352,7 @@ static int ufs_trunc_dindirect (struct i } } if (IS_SYNC(inode) && dind_bh && ubh_buffer_dirty(dind_bh)) { - ubh_wait_on_buffer (dind_bh); - ubh_ll_rw_block (WRITE, 1, &dind_bh); + ubh_ll_rw_block (SWRITE, 1, &dind_bh); ubh_wait_on_buffer (dind_bh); } ubh_brelse (dind_bh); @@ -418,8 +416,7 @@ static int ufs_trunc_tindirect (struct i } } if (IS_SYNC(inode) && tind_bh && ubh_buffer_dirty(tind_bh)) { - ubh_wait_on_buffer (tind_bh); - ubh_ll_rw_block (WRITE, 1, &tind_bh); + ubh_ll_rw_block (SWRITE, 1, &tind_bh); ubh_wait_on_buffer (tind_bh); } ubh_brelse (tind_bh); _