- set_buffer_dirty(SB_JOURNAL(p_s_sb)->j_header_bh) ;
- sync_dirty_buffer(SB_JOURNAL(p_s_sb)->j_header_bh) ;
+
+ if (reiserfs_barrier_flush(p_s_sb)) {
+ int ret;
+ lock_buffer(SB_JOURNAL(p_s_sb)->j_header_bh);
+ ret = submit_barrier_buffer(SB_JOURNAL(p_s_sb)->j_header_bh);
+ if (ret == -EOPNOTSUPP) {
+ set_buffer_uptodate(SB_JOURNAL(p_s_sb)->j_header_bh);
+ disable_barrier(p_s_sb);
+ goto sync;
+ }
+ wait_on_buffer(SB_JOURNAL(p_s_sb)->j_header_bh);
+ check_barrier_completion(p_s_sb, SB_JOURNAL(p_s_sb)->j_header_bh);
+ } else {
+sync:
+ set_buffer_dirty(SB_JOURNAL(p_s_sb)->j_header_bh) ;
+ sync_dirty_buffer(SB_JOURNAL(p_s_sb)->j_header_bh) ;
+ }