mm/zbud: use list_last_entry in zbud_reclaim_page() directly
PATCH 1/1 mm/zbud: use list_last_entry in zbud_reclaim_page() directly
From: Jie Liu <[email protected]>
Get rid of the self defined list_tail_entry() helper and use list_last_entry() in zbud_reclaim_page() directly.
Signed-off-by Jie Liu <[email protected]>
--- mm/zbud.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
mm/zbud.c +1 -4
@@ -360,9 +360,6 @@ void zbud_free(struct zbud_pool *pool, unsigned long handle)spin_unlock (&pool->lock); } -#define list_tail_entry (ptr, type, member) \ - list_entry((ptr)->prev, type, member) -/** * zbud_reclaim_page() - evicts allocations from a pool page and frees it * @pool: pool from which a page will attempt to be evicted
@@ -411,7 +408,7 @@ int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries)return -EINVAL ; }for (i =0 ; i < retries; i++) { - zhdr = list_tail_entry(&pool->lru, struct zbud_header, lru); + zhdr = list_last_entry(&pool->lru, struct zbud_header, lru);list_del (&zhdr->lru);list_del (&zhdr->buddy);/* Protect zbud page against free */
Signature · 7 lines
1.8.3.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 6 lines · Jeff Liu
From: Jie Liu <[email protected]>
Get rid of the self defined
list_tail_entry()helper and uselist_last_entry()inzbud_reclaim_page()directly.Signed-off-by Jie Liu <[email protected]>
Good find :)
Acked-by Seth Jennings <[email protected]>
Quoted 35 lines
--- mm/zbud.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)mm/zbud.c +1
-4@@ -360,9 +360,6 @@ void zbud_free(struct zbud_pool *pool, unsigned long handle)spin_unlock (&pool->lock); } -#define list_tail_entry (ptr, type, member) \ - list_entry((ptr)->prev, type, member) -/** * zbud_reclaim_page() - evicts allocations from a pool page and frees it * @pool: pool from which a page will attempt to be evicted @@ -411,7 +408,7 @@ int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries)return -EINVAL ; }for (i =0 ; i < retries; i++) { - zhdr = list_tail_entry(&pool->lru, struct zbud_header, lru); + zhdr = list_last_entry(&pool->lru, struct zbud_header, lru);list_del (&zhdr->lru);list_del (&zhdr->buddy);/* Protect zbud page against free */ Signature · 7 lines
1.8.3.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>