Skip to content

Commit 81af57b

Browse files
Sebastian Andrzej Siewiorjnettlet
authored andcommitted
fs: convert two more BH_Uptodate_Lock related bitspinlocks
We convert all BH_Uptodate_Lock based bit-spinlocks to use bh_uptodate_lock_irqsave() instead. Those two were introduced after the initial change in -RT and were not noticed before. Cc: [email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent df5b5bd commit 81af57b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

fs/ext4/page-io.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ static void ext4_finish_bio(struct bio *bio)
9595
* We check all buffers in the page under BH_Uptodate_Lock
9696
* to avoid races with other end io clearing async_write flags
9797
*/
98-
local_irq_save(flags);
99-
bit_spin_lock(BH_Uptodate_Lock, &head->b_state);
98+
flags = bh_uptodate_lock_irqsave(head);
10099
do {
101100
if (bh_offset(bh) < bio_start ||
102101
bh_offset(bh) + bh->b_size > bio_end) {
@@ -108,8 +107,7 @@ static void ext4_finish_bio(struct bio *bio)
108107
if (bio->bi_error)
109108
buffer_io_error(bh);
110109
} while ((bh = bh->b_this_page) != head);
111-
bit_spin_unlock(BH_Uptodate_Lock, &head->b_state);
112-
local_irq_restore(flags);
110+
bh_uptodate_unlock_irqrestore(head, flags);
113111
if (!under_io) {
114112
#ifdef CONFIG_EXT4_FS_ENCRYPTION
115113
if (data_page)

fs/xfs/xfs_aops.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ xfs_finish_page_writeback(
112112
ASSERT(bvec->bv_offset + bvec->bv_len <= PAGE_SIZE);
113113
ASSERT((bvec->bv_len & (i_blocksize(inode) - 1)) == 0);
114114

115-
local_irq_save(flags);
116-
bit_spin_lock(BH_Uptodate_Lock, &head->b_state);
115+
flags = bh_uptodate_lock_irqsave(head);
117116
do {
118117
if (off >= bvec->bv_offset &&
119118
off < bvec->bv_offset + bvec->bv_len) {
@@ -136,8 +135,7 @@ xfs_finish_page_writeback(
136135
}
137136
off += bh->b_size;
138137
} while ((bh = bh->b_this_page) != head);
139-
bit_spin_unlock(BH_Uptodate_Lock, &head->b_state);
140-
local_irq_restore(flags);
138+
bh_uptodate_unlock_irqrestore(head, flags);
141139

142140
if (!busy)
143141
end_page_writeback(bvec->bv_page);

0 commit comments

Comments
 (0)