Skip to contentSkip to conversation

fix brd allocation flags

PATCH In review Petr Tesarik 2 participants 2 messages Apr 17, 2008 – Apr 22, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix brd allocation flags

Hello,

while looking at the implementation of the Ram backed block device driver, I stumbled across a write-only local variable, which makes little sense, so I assume it should actually work like this:

drivers/block/brd.c +1 -1
index 8536480..7bd7663 100644
@@ -108,7 +108,7 @@ static struct page *brd_insert_page(struct brd_device *brd, sector_t sector)
 #ifndef CONFIG_BLK_DEV_XIP
 	gfp_flags |= __GFP_HIGHMEM;
 #endif
-	page = alloc_page(GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO);
+	page = alloc_page(gfp_flags);
 	if (!page)
 		return NULL;
 
#1 lore raw
Quoted 5 lines · Petr Tesarik

Hello,

while looking at the implementation of the Ram backed block device driver, I stumbled across a write-only local variable, which makes little sense, so I assume it should actually work like this:

Right you are. Good catch, thanks Petr.

Quoted 16 lines
drivers/block/brd.c +1 -1
index 8536480..7bd7663 100644
@@ -108,7 +108,7 @@ static struct page *brd_insert_page(struct brd_device *brd, sector_t sector)
 #ifndef CONFIG_BLK_DEV_XIP
 	gfp_flags |= __GFP_HIGHMEM;
 #endif
-	page = alloc_page(GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO);
+	page = alloc_page(gfp_flags);
 	if (!page)
 		return NULL;