NTFS: Improve scalability by changing the driver global spin lock in
fs/ntfs/aops.c::ntfs_end_buffer_async_read() to a bit spin lock
in the first buffer head of a page.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
···8686 - Fix fs/ntfs/aops.c::ntfs_{read,write}_block() to handle the case8787 where a concurrent truncate has truncated the runlist under our feet.8888 - Fix page_has_buffers()/page_buffers() handling in fs/ntfs/aops.c.8989+ - In fs/ntfs/aops.c::ntfs_end_buffer_async_read(), use a bit spin lock9090+ in the first buffer head instead of a driver global spin lock to9191+ improve scalability.899290932.1.23 - Implement extension of resident files and make writing safe as well as9194 many bug fixes, cleanups, and enhancements...
+9-6
fs/ntfs/aops.c
···5555 */5656static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)5757{5858- static DEFINE_SPINLOCK(page_uptodate_lock);5958 unsigned long flags;6060- struct buffer_head *tmp;5959+ struct buffer_head *first, *tmp;6160 struct page *page;6261 ntfs_inode *ni;6362 int page_uptodate = 1;···8889 }8990 } else {9091 clear_buffer_uptodate(bh);9292+ SetPageError(page);9193 ntfs_error(ni->vol->sb, "Buffer I/O error, logical block %llu.",9294 (unsigned long long)bh->b_blocknr);9393- SetPageError(page);9495 }9595- spin_lock_irqsave(&page_uptodate_lock, flags);9696+ first = page_buffers(page);9797+ local_irq_save(flags);9898+ bit_spin_lock(BH_Uptodate_Lock, &first->b_state);9699 clear_buffer_async_read(bh);97100 unlock_buffer(bh);98101 tmp = bh;···109108 }110109 tmp = tmp->b_this_page;111110 } while (tmp != bh);112112- spin_unlock_irqrestore(&page_uptodate_lock, flags);111111+ bit_spin_unlock(BH_Uptodate_Lock, &first->b_state);112112+ local_irq_restore(flags);113113 /*114114 * If none of the buffers had errors then we can set the page uptodate,115115 * but we first have to perform the post read mst fixups, if the···143141 unlock_page(page);144142 return;145143still_busy:146146- spin_unlock_irqrestore(&page_uptodate_lock, flags);144144+ bit_spin_unlock(BH_Uptodate_Lock, &first->b_state);145145+ local_irq_restore(flags);147146 return;148147}149148