mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	mm: shmem: change the return value of shmem_find_swap_entries()
The shmem_find_swap_entries() originally returned the index corresponding to the swap entry, but no callers used this return value. It should return the number of entries that were found like other functions, which can be used by the callers. No functional changes. Link: https://lkml.kernel.org/r/070489b5946b8379b2a2d25f78115cef167cd145.1738918357.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: David Hildenbrand <david@redhat.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									d5e4e147c0
								
							
						
					
					
						commit
						cd81c424b5
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		
							
								
								
									
										12
									
								
								mm/shmem.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								mm/shmem.c
									
									
									
									
									
								
							| 
						 | 
					@ -1379,9 +1379,9 @@ static void shmem_evict_inode(struct inode *inode)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int shmem_find_swap_entries(struct address_space *mapping,
 | 
					static unsigned int shmem_find_swap_entries(struct address_space *mapping,
 | 
				
			||||||
				   pgoff_t start, struct folio_batch *fbatch,
 | 
									pgoff_t start, struct folio_batch *fbatch,
 | 
				
			||||||
				   pgoff_t *indices, unsigned int type)
 | 
									pgoff_t *indices, unsigned int type)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	XA_STATE(xas, &mapping->i_pages, start);
 | 
						XA_STATE(xas, &mapping->i_pages, start);
 | 
				
			||||||
	struct folio *folio;
 | 
						struct folio *folio;
 | 
				
			||||||
| 
						 | 
					@ -1414,7 +1414,7 @@ static int shmem_find_swap_entries(struct address_space *mapping,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	rcu_read_unlock();
 | 
						rcu_read_unlock();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return xas.xa_index;
 | 
						return folio_batch_count(fbatch);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					@ -1461,8 +1461,8 @@ static int shmem_unuse_inode(struct inode *inode, unsigned int type)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
		folio_batch_init(&fbatch);
 | 
							folio_batch_init(&fbatch);
 | 
				
			||||||
		shmem_find_swap_entries(mapping, start, &fbatch, indices, type);
 | 
							if (!shmem_find_swap_entries(mapping, start, &fbatch,
 | 
				
			||||||
		if (folio_batch_count(&fbatch) == 0) {
 | 
										     indices, type)) {
 | 
				
			||||||
			ret = 0;
 | 
								ret = 0;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue