summaryrefslogtreecommitdiffstats
path: root/include/linux/backing-dev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/backing-dev.h')
-rw-r--r--include/linux/backing-dev.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index e6cbb915ee56..09da0f124699 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -329,7 +329,7 @@ static inline bool inode_to_wb_is_valid(struct inode *inode)
329 * @inode: inode of interest 329 * @inode: inode of interest
330 * 330 *
331 * Returns the wb @inode is currently associated with. The caller must be 331 * Returns the wb @inode is currently associated with. The caller must be
332 * holding either @inode->i_lock, @inode->i_mapping->tree_lock, or the 332 * holding either @inode->i_lock, the i_pages lock, or the
333 * associated wb's list_lock. 333 * associated wb's list_lock.
334 */ 334 */
335static inline struct bdi_writeback *inode_to_wb(const struct inode *inode) 335static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
@@ -337,7 +337,7 @@ static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
337#ifdef CONFIG_LOCKDEP 337#ifdef CONFIG_LOCKDEP
338 WARN_ON_ONCE(debug_locks && 338 WARN_ON_ONCE(debug_locks &&
339 (!lockdep_is_held(&inode->i_lock) && 339 (!lockdep_is_held(&inode->i_lock) &&
340 !lockdep_is_held(&inode->i_mapping->tree_lock) && 340 !lockdep_is_held(&inode->i_mapping->i_pages.xa_lock) &&
341 !lockdep_is_held(&inode->i_wb->list_lock))); 341 !lockdep_is_held(&inode->i_wb->list_lock)));
342#endif 342#endif
343 return inode->i_wb; 343 return inode->i_wb;
@@ -349,7 +349,7 @@ static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
349 * @lockedp: temp bool output param, to be passed to the end function 349 * @lockedp: temp bool output param, to be passed to the end function
350 * 350 *
351 * The caller wants to access the wb associated with @inode but isn't 351 * The caller wants to access the wb associated with @inode but isn't
352 * holding inode->i_lock, mapping->tree_lock or wb->list_lock. This 352 * holding inode->i_lock, the i_pages lock or wb->list_lock. This
353 * function determines the wb associated with @inode and ensures that the 353 * function determines the wb associated with @inode and ensures that the
354 * association doesn't change until the transaction is finished with 354 * association doesn't change until the transaction is finished with
355 * unlocked_inode_to_wb_end(). 355 * unlocked_inode_to_wb_end().
@@ -370,11 +370,11 @@ unlocked_inode_to_wb_begin(struct inode *inode, bool *lockedp)
370 *lockedp = smp_load_acquire(&inode->i_state) & I_WB_SWITCH; 370 *lockedp = smp_load_acquire(&inode->i_state) & I_WB_SWITCH;
371 371
372 if (unlikely(*lockedp)) 372 if (unlikely(*lockedp))
373 spin_lock_irq(&inode->i_mapping->tree_lock); 373 xa_lock_irq(&inode->i_mapping->i_pages);
374 374
375 /* 375 /*
376 * Protected by either !I_WB_SWITCH + rcu_read_lock() or tree_lock. 376 * Protected by either !I_WB_SWITCH + rcu_read_lock() or the i_pages
377 * inode_to_wb() will bark. Deref directly. 377 * lock. inode_to_wb() will bark. Deref directly.
378 */ 378 */
379 return inode->i_wb; 379 return inode->i_wb;
380} 380}
@@ -387,7 +387,7 @@ unlocked_inode_to_wb_begin(struct inode *inode, bool *lockedp)
387static inline void unlocked_inode_to_wb_end(struct inode *inode, bool locked) 387static inline void unlocked_inode_to_wb_end(struct inode *inode, bool locked)
388{ 388{
389 if (unlikely(locked)) 389 if (unlikely(locked))
390 spin_unlock_irq(&inode->i_mapping->tree_lock); 390 xa_unlock_irq(&inode->i_mapping->i_pages);
391 391
392 rcu_read_unlock(); 392 rcu_read_unlock();
393} 393}