Commit da29da14 authored by Ingo Molnar's avatar Ingo Molnar Committed by Thomas Gleixner

fs: replace bh_uptodate_lock for -rt

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent b97d6747
...@@ -324,8 +324,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) ...@@ -324,8 +324,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
* decide that the page is now completely done. * decide that the page is now completely done.
*/ */
first = page_buffers(page); first = page_buffers(page);
local_irq_save(flags); spin_lock_irqsave(&first->b_uptodate_lock, flags);
bit_spin_lock(BH_Uptodate_Lock, &first->b_state);
clear_buffer_async_read(bh); clear_buffer_async_read(bh);
unlock_buffer(bh); unlock_buffer(bh);
tmp = bh; tmp = bh;
...@@ -338,8 +337,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) ...@@ -338,8 +337,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
} }
tmp = tmp->b_this_page; tmp = tmp->b_this_page;
} while (tmp != bh); } while (tmp != bh);
bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
local_irq_restore(flags);
/* /*
* If none of the buffers had errors and they are all * If none of the buffers had errors and they are all
...@@ -351,8 +349,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) ...@@ -351,8 +349,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
return; return;
still_busy: still_busy:
bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
local_irq_restore(flags);
return; return;
} }
...@@ -387,8 +384,7 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) ...@@ -387,8 +384,7 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate)
} }
first = page_buffers(page); first = page_buffers(page);
local_irq_save(flags); spin_lock_irqsave(&first->b_uptodate_lock, flags);
bit_spin_lock(BH_Uptodate_Lock, &first->b_state);
clear_buffer_async_write(bh); clear_buffer_async_write(bh);
unlock_buffer(bh); unlock_buffer(bh);
...@@ -400,14 +396,12 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) ...@@ -400,14 +396,12 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate)
} }
tmp = tmp->b_this_page; tmp = tmp->b_this_page;
} }
bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
local_irq_restore(flags);
end_page_writeback(page); end_page_writeback(page);
return; return;
still_busy: still_busy:
bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
local_irq_restore(flags);
return; return;
} }
...@@ -3248,6 +3242,7 @@ struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) ...@@ -3248,6 +3242,7 @@ struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags);
if (ret) { if (ret) {
INIT_LIST_HEAD(&ret->b_assoc_buffers); INIT_LIST_HEAD(&ret->b_assoc_buffers);
spin_lock_init(&ret->b_uptodate_lock);
get_cpu_var(bh_accounting).nr++; get_cpu_var(bh_accounting).nr++;
recalc_bh_state(); recalc_bh_state();
put_cpu_var(bh_accounting); put_cpu_var(bh_accounting);
...@@ -3259,6 +3254,7 @@ EXPORT_SYMBOL(alloc_buffer_head); ...@@ -3259,6 +3254,7 @@ EXPORT_SYMBOL(alloc_buffer_head);
void free_buffer_head(struct buffer_head *bh) void free_buffer_head(struct buffer_head *bh)
{ {
BUG_ON(!list_empty(&bh->b_assoc_buffers)); BUG_ON(!list_empty(&bh->b_assoc_buffers));
BUG_ON(spin_is_locked(&bh->b_uptodate_lock));
kmem_cache_free(bh_cachep, bh); kmem_cache_free(bh_cachep, bh);
get_cpu_var(bh_accounting).nr--; get_cpu_var(bh_accounting).nr--;
recalc_bh_state(); recalc_bh_state();
......
...@@ -107,8 +107,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) ...@@ -107,8 +107,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
"0x%llx.", (unsigned long long)bh->b_blocknr); "0x%llx.", (unsigned long long)bh->b_blocknr);
} }
first = page_buffers(page); first = page_buffers(page);
local_irq_save(flags); spin_lock_irqsave(&first->b_uptodate_lock, flags);
bit_spin_lock(BH_Uptodate_Lock, &first->b_state);
clear_buffer_async_read(bh); clear_buffer_async_read(bh);
unlock_buffer(bh); unlock_buffer(bh);
tmp = bh; tmp = bh;
...@@ -123,8 +122,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) ...@@ -123,8 +122,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
} }
tmp = tmp->b_this_page; tmp = tmp->b_this_page;
} while (tmp != bh); } while (tmp != bh);
bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
local_irq_restore(flags);
/* /*
* If none of the buffers had errors then we can set the page uptodate, * If none of the buffers had errors then we can set the page uptodate,
* but we first have to perform the post read mst fixups, if the * but we first have to perform the post read mst fixups, if the
...@@ -159,8 +157,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) ...@@ -159,8 +157,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
unlock_page(page); unlock_page(page);
return; return;
still_busy: still_busy:
bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
local_irq_restore(flags);
return; return;
} }
......
...@@ -21,10 +21,6 @@ enum bh_state_bits { ...@@ -21,10 +21,6 @@ enum bh_state_bits {
BH_Dirty, /* Is dirty */ BH_Dirty, /* Is dirty */
BH_Lock, /* Is locked */ BH_Lock, /* Is locked */
BH_Req, /* Has been submitted for I/O */ BH_Req, /* Has been submitted for I/O */
BH_Uptodate_Lock,/* Used by the first bh in a page, to serialise
* IO completion of other buffers in the page
*/
BH_Mapped, /* Has a disk mapping */ BH_Mapped, /* Has a disk mapping */
BH_New, /* Disk mapping was newly created by get_block */ BH_New, /* Disk mapping was newly created by get_block */
BH_Async_Read, /* Is under end_buffer_async_read I/O */ BH_Async_Read, /* Is under end_buffer_async_read I/O */
...@@ -74,6 +70,7 @@ struct buffer_head { ...@@ -74,6 +70,7 @@ struct buffer_head {
struct address_space *b_assoc_map; /* mapping this buffer is struct address_space *b_assoc_map; /* mapping this buffer is
associated with */ associated with */
atomic_t b_count; /* users using this buffer_head */ atomic_t b_count; /* users using this buffer_head */
spinlock_t b_uptodate_lock;
}; };
/* /*
......
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