]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: rename page struct field helpers
authorMel Gorman <mgorman@suse.de>
Wed, 20 Feb 2013 02:14:48 +0000 (13:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:51 +0000 (16:52 +1100)
The function names page_xchg_last_nid(), page_last_nid() and
reset_page_last_nid() were judged to be inconsistent so rename them to a
struct_field_op style pattern.  As it looked jarring to have
reset_page_mapcount() and page_nid_reset_last() beside each other in
memmap_init_zone(), this patch also renames reset_page_mapcount() to
page_mapcount_reset().  There are others like init_page_count() but as it
is used throughout the arch code a rename would likely cause more
conflicts than it is worth.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/staging/zsmalloc/zsmalloc-main.c
include/linux/mm.h
mm/huge_memory.c
mm/mempolicy.c
mm/migrate.c
mm/mmzone.c
mm/page_alloc.c
mm/slob.c
mm/slub.c

index 06f73a93a44d2a5481f34c2b26c833c748a1a07d..e78d262c5249887415b4b5a628ee684a47408f87 100644 (file)
@@ -472,7 +472,7 @@ static void reset_page(struct page *page)
        set_page_private(page, 0);
        page->mapping = NULL;
        page->freelist = NULL;
-       reset_page_mapcount(page);
+       page_mapcount_reset(page);
 }
 
 static void free_zspage(struct page *first_page)
index 0b5e2a5f366b60b43b8c64df8052c174b5502d2a..72ba295ff0a8a99069eafb59dc5ddac5cffb547a 100644 (file)
@@ -369,7 +369,7 @@ static inline struct page *compound_head(struct page *page)
  * both from it and to it can be tracked, using atomic_inc_and_test
  * and atomic_add_negative(-1).
  */
-static inline void reset_page_mapcount(struct page *page)
+static inline void page_mapcount_reset(struct page *page)
 {
        atomic_set(&(page)->_mapcount, -1);
 }
@@ -660,28 +660,28 @@ static inline int page_to_nid(const struct page *page)
 
 #ifdef CONFIG_NUMA_BALANCING
 #ifdef LAST_NID_NOT_IN_PAGE_FLAGS
-static inline int page_xchg_last_nid(struct page *page, int nid)
+static inline int page_nid_xchg_last(struct page *page, int nid)
 {
        return xchg(&page->_last_nid, nid);
 }
 
-static inline int page_last_nid(struct page *page)
+static inline int page_nid_last(struct page *page)
 {
        return page->_last_nid;
 }
-static inline void reset_page_last_nid(struct page *page)
+static inline void page_nid_reset_last(struct page *page)
 {
        page->_last_nid = -1;
 }
 #else
-static inline int page_last_nid(struct page *page)
+static inline int page_nid_last(struct page *page)
 {
        return (page->flags >> LAST_NID_PGSHIFT) & LAST_NID_MASK;
 }
 
-extern int page_xchg_last_nid(struct page *page, int nid);
+extern int page_nid_xchg_last(struct page *page, int nid);
 
-static inline void reset_page_last_nid(struct page *page)
+static inline void page_nid_reset_last(struct page *page)
 {
        int nid = (1 << LAST_NID_SHIFT) - 1;
 
@@ -690,17 +690,17 @@ static inline void reset_page_last_nid(struct page *page)
 }
 #endif /* LAST_NID_NOT_IN_PAGE_FLAGS */
 #else
-static inline int page_xchg_last_nid(struct page *page, int nid)
+static inline int page_nid_xchg_last(struct page *page, int nid)
 {
        return page_to_nid(page);
 }
 
-static inline int page_last_nid(struct page *page)
+static inline int page_nid_last(struct page *page)
 {
        return page_to_nid(page);
 }
 
-static inline void reset_page_last_nid(struct page *page)
+static inline void page_nid_reset_last(struct page *page)
 {
 }
 #endif
index c63a21d0e9916ee979a0ba44a9ed946043ae43ad..6049376c7226caa47ee1b983157f07d05c76172a 100644 (file)
@@ -1639,7 +1639,7 @@ static void __split_huge_page_refcount(struct page *page)
                page_tail->mapping = page->mapping;
 
                page_tail->index = page->index + i;
-               page_xchg_last_nid(page_tail, page_last_nid(page));
+               page_nid_xchg_last(page_tail, page_nid_last(page));
 
                BUG_ON(!PageAnon(page_tail));
                BUG_ON(!PageUptodate(page_tail));
index 6f7979c566d97c6314898fe8375f49ccdfd122aa..2ae78e255e080fa02492a2cc06a677174ee339ca 100644 (file)
@@ -2316,7 +2316,7 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
                 * it less likely we act on an unlikely task<->page
                 * relation.
                 */
-               last_nid = page_xchg_last_nid(page, polnid);
+               last_nid = page_nid_xchg_last(page, polnid);
                if (last_nid != polnid)
                        goto out;
        }
index f560071e89c50e6c9caeae7e4f0bec63a0de705c..de5c371a79690e7c496fa6c257d8fbf59df7cc43 100644 (file)
@@ -1497,7 +1497,7 @@ static struct page *alloc_misplaced_dst_page(struct page *page,
                                          __GFP_NOWARN) &
                                         ~GFP_IOFS, 0);
        if (newpage)
-               page_xchg_last_nid(newpage, page_last_nid(page));
+               page_nid_xchg_last(newpage, page_nid_last(page));
 
        return newpage;
 }
@@ -1681,7 +1681,7 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
        if (!new_page)
                goto out_fail;
 
-       page_xchg_last_nid(new_page, page_last_nid(page));
+       page_nid_xchg_last(new_page, page_nid_last(page));
 
        isolated = numamigrate_isolate_page(pgdat, page);
        if (!isolated) {
index bce796e8487f35a4e8f806e3fa942a20abcfb263..2ac0afbd68f356cfaaa3bf47b33703df6b475785 100644 (file)
@@ -98,14 +98,14 @@ void lruvec_init(struct lruvec *lruvec)
 }
 
 #if defined(CONFIG_NUMA_BALANCING) && !defined(LAST_NID_NOT_IN_PAGE_FLAGS)
-int page_xchg_last_nid(struct page *page, int nid)
+int page_nid_xchg_last(struct page *page, int nid)
 {
        unsigned long old_flags, flags;
        int last_nid;
 
        do {
                old_flags = flags = page->flags;
-               last_nid = page_last_nid(page);
+               last_nid = page_nid_last(page);
 
                flags &= ~(LAST_NID_MASK << LAST_NID_PGSHIFT);
                flags |= (nid & LAST_NID_MASK) << LAST_NID_PGSHIFT;
index 0ee32847dc57060f4e721b9c7c5fb13a694245c1..71f4cebd6c54f78db21c5728618165c745046ff2 100644 (file)
@@ -295,7 +295,7 @@ static void bad_page(struct page *page)
 
        /* Don't complain about poisoned pages */
        if (PageHWPoison(page)) {
-               reset_page_mapcount(page); /* remove PageBuddy */
+               page_mapcount_reset(page); /* remove PageBuddy */
                return;
        }
 
@@ -327,7 +327,7 @@ static void bad_page(struct page *page)
        dump_stack();
 out:
        /* Leave bad fields for debug, except PageBuddy could make trouble */
-       reset_page_mapcount(page); /* remove PageBuddy */
+       page_mapcount_reset(page); /* remove PageBuddy */
        add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
 }
 
@@ -613,7 +613,7 @@ static inline int free_pages_check(struct page *page)
                bad_page(page);
                return 1;
        }
-       reset_page_last_nid(page);
+       page_nid_reset_last(page);
        if (page->flags & PAGE_FLAGS_CHECK_AT_PREP)
                page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
        return 0;
@@ -3897,8 +3897,8 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
                set_page_links(page, zone, nid, pfn);
                mminit_verify_page_links(page, zone, nid, pfn);
                init_page_count(page);
-               reset_page_mapcount(page);
-               reset_page_last_nid(page);
+               page_mapcount_reset(page);
+               page_nid_reset_last(page);
                SetPageReserved(page);
                /*
                 * Mark the block movable so that blocks are reserved for
index a99fdf7a0907db8f0f12909435e7da714f917d9a..eeed4a05a2ef2ffa3f7fc1b3ff1ccada895f3e77 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -360,7 +360,7 @@ static void slob_free(void *block, int size)
                        clear_slob_page_free(sp);
                spin_unlock_irqrestore(&slob_lock, flags);
                __ClearPageSlab(sp);
-               reset_page_mapcount(sp);
+               page_mapcount_reset(sp);
                slob_free_pages(b, 0);
                return;
        }
index 36ead8f2d2313b9d5bd383bd23fed60adb494edd..aa1a88c73627288efb1d278e719c59312801c7c2 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1408,7 +1408,7 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
        __ClearPageSlab(page);
 
        memcg_release_pages(s, order);
-       reset_page_mapcount(page);
+       page_mapcount_reset(page);
        if (current->reclaim_state)
                current->reclaim_state->reclaimed_slab += pages;
        __free_memcg_kmem_pages(page, order);