Commit 8f7f6cae authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: use alloc_metapage for consistency

We defind alloc_metapage, but instead of using it, the potential callers
are calling mempool_alloc directly.  Since we have and use the function,
free_metapage, we should be consistent and use alloc_metapage.

This patch also changes the argument to alloc_metapage so that the
caller passes gfp_mask directly, rather than a less descriptive flag.
Signed-off-by: default avatarDave Kleikamp <shaggy@austin.ibm.com>
parent 89d31cc9
...@@ -108,9 +108,9 @@ static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags) ...@@ -108,9 +108,9 @@ static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
} }
} }
static inline struct metapage *alloc_metapage(int no_wait) static inline struct metapage *alloc_metapage(int gfp_mask)
{ {
return mempool_alloc(metapage_mempool, no_wait ? GFP_ATOMIC : GFP_NOFS); return mempool_alloc(metapage_mempool, gfp_mask);
} }
static inline void free_metapage(struct metapage *mp) static inline void free_metapage(struct metapage *mp)
...@@ -289,7 +289,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, ...@@ -289,7 +289,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
*/ */
mp = NULL; mp = NULL;
if (JFS_IP(inode)->fileset == AGGREGATE_I) { if (JFS_IP(inode)->fileset == AGGREGATE_I) {
mp = mempool_alloc(metapage_mempool, GFP_ATOMIC); mp = alloc_metapage(GFP_ATOMIC);
if (!mp) { if (!mp) {
/* /*
* mempool is supposed to protect us from * mempool is supposed to protect us from
...@@ -306,7 +306,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, ...@@ -306,7 +306,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
struct metapage *mp2; struct metapage *mp2;
spin_unlock(&meta_lock); spin_unlock(&meta_lock);
mp = mempool_alloc(metapage_mempool, GFP_NOFS); mp = alloc_metapage(GFP_NOFS);
spin_lock(&meta_lock); spin_lock(&meta_lock);
/* we dropped the meta_lock, we need to search the /* we dropped the meta_lock, we need to search the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment