mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
f2fs: use finish zone command when closing a zone
Use the finish zone command first when a zone should be closed. Signed-off-by: Daeho Jeong <daehojeong@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
091a4dfbb1
commit
3b71661214
@ -4948,12 +4948,19 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
|
||||
GET_BLKOFF_FROM_SEG0(sbi, last_valid_block),
|
||||
wp_segno, wp_blkoff);
|
||||
|
||||
ret = blkdev_zone_mgmt(fdev->bdev, REQ_OP_ZONE_FINISH,
|
||||
zone->start, zone->len, GFP_NOFS);
|
||||
if (ret == -EOPNOTSUPP) {
|
||||
ret = blkdev_issue_zeroout(fdev->bdev, zone->wp,
|
||||
zone->len - (zone->wp - zone->start),
|
||||
GFP_NOFS, 0);
|
||||
if (ret)
|
||||
f2fs_err(sbi, "Fill up zone failed: %s (errno=%d)",
|
||||
fdev->path, ret);
|
||||
} else if (ret) {
|
||||
f2fs_err(sbi, "Finishing zone failed: %s (errno=%d)",
|
||||
fdev->path, ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user