mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-11-01 09:13:37 +00:00 
			
		
		
		
	xfs: reuse xfs_refcount_update_cancel_item
Reuse xfs_refcount_update_cancel_item to put the AG/RTG and free the item in a few places that currently open code the logic. Inspired-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
		
							parent
							
								
									0e9254861f
								
							
						
					
					
						commit
						8aef79928b
					
				
					 1 changed files with 12 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -335,6 +335,17 @@ xfs_refcount_update_put_group(
 | 
			
		|||
	xfs_perag_intent_put(ri->ri_pag);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Cancel a deferred refcount update. */
 | 
			
		||||
STATIC void
 | 
			
		||||
xfs_refcount_update_cancel_item(
 | 
			
		||||
	struct list_head		*item)
 | 
			
		||||
{
 | 
			
		||||
	struct xfs_refcount_intent	*ri = ci_entry(item);
 | 
			
		||||
 | 
			
		||||
	xfs_refcount_update_put_group(ri);
 | 
			
		||||
	kmem_cache_free(xfs_refcount_intent_cache, ri);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Process a deferred refcount update. */
 | 
			
		||||
STATIC int
 | 
			
		||||
xfs_refcount_update_finish_item(
 | 
			
		||||
| 
						 | 
				
			
			@ -354,8 +365,7 @@ xfs_refcount_update_finish_item(
 | 
			
		|||
		return -EAGAIN;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	xfs_refcount_update_put_group(ri);
 | 
			
		||||
	kmem_cache_free(xfs_refcount_intent_cache, ri);
 | 
			
		||||
	xfs_refcount_update_cancel_item(item);
 | 
			
		||||
	return error;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -367,17 +377,6 @@ xfs_refcount_update_abort_intent(
 | 
			
		|||
	xfs_cui_release(CUI_ITEM(intent));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Cancel a deferred refcount update. */
 | 
			
		||||
STATIC void
 | 
			
		||||
xfs_refcount_update_cancel_item(
 | 
			
		||||
	struct list_head		*item)
 | 
			
		||||
{
 | 
			
		||||
	struct xfs_refcount_intent	*ri = ci_entry(item);
 | 
			
		||||
 | 
			
		||||
	xfs_refcount_update_put_group(ri);
 | 
			
		||||
	kmem_cache_free(xfs_refcount_intent_cache, ri);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Is this recovered CUI ok? */
 | 
			
		||||
static inline bool
 | 
			
		||||
xfs_cui_validate_phys(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue