Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'vfs-6.15-rc8.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull vfs fixes from Christian Brauner:
"This contains a small set of fixes for the blocking buffer lookup
conversion done earlier this cycle.

It adds a missing conversion in the getblk slowpath and a few minor
optimizations and cleanups"

* tag 'vfs-6.15-rc8.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
fs/buffer: optimize discard_buffer()
fs/buffer: remove superfluous statements
fs/buffer: avoid redundant lookup in getblk slowpath
fs/buffer: use sleeping lookup in __getblk_slowpath()

+11 -9
+11 -9
fs/buffer.c
··· 297 297 298 298 still_busy: 299 299 spin_unlock_irqrestore(&first->b_uptodate_lock, flags); 300 - return; 301 300 } 302 301 303 302 struct postprocess_bh_ctx { ··· 421 422 422 423 still_busy: 423 424 spin_unlock_irqrestore(&first->b_uptodate_lock, flags); 424 - return; 425 425 } 426 426 427 427 /* ··· 1120 1122 __getblk_slow(struct block_device *bdev, sector_t block, 1121 1123 unsigned size, gfp_t gfp) 1122 1124 { 1125 + bool blocking = gfpflags_allow_blocking(gfp); 1126 + 1123 1127 /* Size must be multiple of hard sectorsize */ 1124 1128 if (unlikely(size & (bdev_logical_block_size(bdev)-1) || 1125 1129 (size < 512 || size > PAGE_SIZE))) { ··· 1137 1137 for (;;) { 1138 1138 struct buffer_head *bh; 1139 1139 1140 - bh = __find_get_block(bdev, block, size); 1141 - if (bh) 1142 - return bh; 1143 - 1144 1140 if (!grow_buffers(bdev, block, size, gfp)) 1145 1141 return NULL; 1142 + 1143 + if (blocking) 1144 + bh = __find_get_block_nonatomic(bdev, block, size); 1145 + else 1146 + bh = __find_get_block(bdev, block, size); 1147 + if (bh) 1148 + return bh; 1146 1149 } 1147 1150 } 1148 1151 ··· 1614 1611 bh->b_bdev = NULL; 1615 1612 b_state = READ_ONCE(bh->b_state); 1616 1613 do { 1617 - } while (!try_cmpxchg(&bh->b_state, &b_state, 1618 - b_state & ~BUFFER_FLAGS_DISCARD)); 1614 + } while (!try_cmpxchg_relaxed(&bh->b_state, &b_state, 1615 + b_state & ~BUFFER_FLAGS_DISCARD)); 1619 1616 unlock_buffer(bh); 1620 1617 } 1621 1618 ··· 1680 1677 filemap_release_folio(folio, 0); 1681 1678 out: 1682 1679 folio_clear_mappedtodisk(folio); 1683 - return; 1684 1680 } 1685 1681 EXPORT_SYMBOL(block_invalidate_folio); 1686 1682