Skip to content

Commit cc15967

Browse files
committed
btrfs: sink gfp_t parameter to alloc_scrub_sector
All callers pas GFP_KERNEL as parameter so we can use it directly in alloc_scrub_sector. Reviewed-by: Anand Jain <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 593908b commit cc15967

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/btrfs/scrub.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,23 +297,23 @@ static struct scrub_block *alloc_scrub_block(struct scrub_ctx *sctx,
297297
* Will also allocate new pages for @sblock if needed.
298298
*/
299299
static struct scrub_sector *alloc_scrub_sector(struct scrub_block *sblock,
300-
u64 logical, gfp_t gfp)
300+
u64 logical)
301301
{
302302
const pgoff_t page_index = (logical - sblock->logical) >> PAGE_SHIFT;
303303
struct scrub_sector *ssector;
304304

305305
/* We must never have scrub_block exceed U32_MAX in size. */
306306
ASSERT(logical - sblock->logical < U32_MAX);
307307

308-
ssector = kzalloc(sizeof(*ssector), gfp);
308+
ssector = kzalloc(sizeof(*ssector), GFP_KERNEL);
309309
if (!ssector)
310310
return NULL;
311311

312312
/* Allocate a new page if the slot is not allocated */
313313
if (!sblock->pages[page_index]) {
314314
int ret;
315315

316-
sblock->pages[page_index] = alloc_page(gfp);
316+
sblock->pages[page_index] = alloc_page(GFP_KERNEL);
317317
if (!sblock->pages[page_index]) {
318318
kfree(ssector);
319319
return NULL;
@@ -1516,7 +1516,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,
15161516
sblock = sblocks_for_recheck[mirror_index];
15171517
sblock->sctx = sctx;
15181518

1519-
sector = alloc_scrub_sector(sblock, logical, GFP_KERNEL);
1519+
sector = alloc_scrub_sector(sblock, logical);
15201520
if (!sector) {
15211521
spin_lock(&sctx->stat_lock);
15221522
sctx->stat.malloc_errors++;
@@ -2438,7 +2438,7 @@ static int scrub_sectors(struct scrub_ctx *sctx, u64 logical, u32 len,
24382438
*/
24392439
u32 l = min(sectorsize, len);
24402440

2441-
sector = alloc_scrub_sector(sblock, logical, GFP_KERNEL);
2441+
sector = alloc_scrub_sector(sblock, logical);
24422442
if (!sector) {
24432443
spin_lock(&sctx->stat_lock);
24442444
sctx->stat.malloc_errors++;
@@ -2775,7 +2775,7 @@ static int scrub_sectors_for_parity(struct scrub_parity *sparity,
27752775
for (index = 0; len > 0; index++) {
27762776
struct scrub_sector *sector;
27772777

2778-
sector = alloc_scrub_sector(sblock, logical, GFP_KERNEL);
2778+
sector = alloc_scrub_sector(sblock, logical);
27792779
if (!sector) {
27802780
spin_lock(&sctx->stat_lock);
27812781
sctx->stat.malloc_errors++;

0 commit comments

Comments
 (0)