mkfs.f2fs: trim all the devices except the first one

We need to check the first disk only, and trim the other disks.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim 2023-02-08 11:24:41 -08:00 committed by sunshenshen
parent 6d50a75823
commit ca912d6446

View File

@ -129,6 +129,10 @@ static bool is_wiped_device(int i)
int nblocks = 4096; /* 16MB size */ int nblocks = 4096; /* 16MB size */
int j; int j;
/* let's trim the other devices except the first device */
if (i > 0)
return false;
buf = malloc(F2FS_BLKSIZE); buf = malloc(F2FS_BLKSIZE);
if (buf == NULL) { if (buf == NULL) {
MSG(1, "\tError: Malloc Failed for buf!!!\n"); MSG(1, "\tError: Malloc Failed for buf!!!\n");