Skip to contentSkip to conversation

swap-clean-up-ifdef-in-page_mapping.patch removed from -mm tree

merged [email protected] 1 participant 1 message Sep 12, 2013

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] swap-clean-up-ifdef-in-page_mapping.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 12 Sep 2013 12:43:27 -0700

The patch titled
Subject: swap: clean-up #ifdef in page_mapping()
has been removed from the -mm tree. Its filename was
swap-clean-up-ifdef-in-page_mapping.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Joonsoo Kim <[email protected]>
Subject: swap: clean-up #ifdef in page_mapping()

PageSwapCache() is always false when !CONFIG_SWAP, so compiler properly discard related code. Therefore, we don't need #ifdef explicitly.

---

 include/linux/swap.h |    1 +
 mm/util.c            |    5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)
include/linux/swap.h renamed from include/linux/swap.h~swap-clean-up-ifdef-in-page_mapping +1 -0
diff -puN include/linux/swap.h~swap-clean-up-ifdef-in-page_mapping include/linux/swap.h
@@ -447,6 +447,7 @@ mem_cgroup_uncharge_swapcache(struct pag
 
 #else /* CONFIG_SWAP */
 
+#define swap_address_space(entry)		(NULL)
 #define get_nr_swap_pages()			0L
 #define total_swap_pages			0L
 #define total_swapcache_pages()			0UL
mm/util.c renamed from mm/util.c~swap-clean-up-ifdef-in-page_mapping +1 -4
diff -puN mm/util.c~swap-clean-up-ifdef-in-page_mapping mm/util.c
@@ -388,15 +388,12 @@ struct address_space *page_mapping(struc
 	struct address_space *mapping = page->mapping;
 
 	VM_BUG_ON(PageSlab(page));
-#ifdef CONFIG_SWAP
 	if (unlikely(PageSwapCache(page))) {
 		swp_entry_t entry;
 
 		entry.val = page_private(page);
 		mapping = swap_address_space(entry);
-	} else
-#endif
-	if ((unsigned long)mapping & PAGE_MAPPING_ANON)
+	} else if ((unsigned long)mapping & PAGE_MAPPING_ANON)
 		mapping = NULL;
 	return mapping;
 }

_

Patches currently in -mm which might be from [email protected] are

origin.patch