bcachefs: Removes NULL pointer checks for __filemap_get_folio return values

__filemap_get_folio the return value cannot be NULL, so unnecessary checks
are removed.

Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Youling Tang 2024-09-24 10:53:50 +08:00 committed by Kent Overstreet
parent 797a14eb7d
commit 0fe251fd82
3 changed files with 3 additions and 3 deletions

View File

@ -686,7 +686,7 @@ int bch2_write_begin(struct file *file, struct address_space *mapping,
folio = __filemap_get_folio(mapping, pos >> PAGE_SHIFT,
FGP_WRITEBEGIN | fgf_set_order(len),
mapping_gfp_mask(mapping));
if (IS_ERR_OR_NULL(folio))
if (IS_ERR(folio))
goto err_unlock;
offset = pos - folio_pos(folio);

View File

@ -29,7 +29,7 @@ int bch2_filemap_get_contig_folios_d(struct address_space *mapping,
break;
f = __filemap_get_folio(mapping, pos >> PAGE_SHIFT, fgp_flags, gfp);
if (IS_ERR_OR_NULL(f))
if (IS_ERR(f))
break;
BUG_ON(fs->nr && folio_pos(f) != pos);

View File

@ -256,7 +256,7 @@ static int __bch2_truncate_folio(struct bch_inode_info *inode,
folio = __filemap_get_folio(mapping, index,
FGP_LOCK|FGP_CREAT, GFP_KERNEL);
if (IS_ERR_OR_NULL(folio)) {
if (IS_ERR(folio)) {
ret = -ENOMEM;
goto out;
}