Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 364ec2d7 authored by Ryusuke Konishi's avatar Ryusuke Konishi
Browse files

nilfs2: remove redundant pointer checks in bmap lookup functions



nilfs_bmap_lookup and its variants are supposed to take a valid
pointer argument to return a block address, thus pointer checks in
nilfs_btree_lookup and nilfs_direct_lookup are needless.

Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
parent 05d0e94b
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -555,17 +555,13 @@ static int nilfs_btree_lookup(const struct nilfs_bmap *btree,
			      __u64 key, int level, __u64 *ptrp)
{
	struct nilfs_btree_path *path;
	__u64 ptr;
	int ret;

	path = nilfs_btree_alloc_path();
	if (path == NULL)
		return -ENOMEM;

	ret = nilfs_btree_do_lookup(btree, path, key, &ptr, level);

	if (ptrp != NULL)
		*ptrp = ptr;
	ret = nilfs_btree_do_lookup(btree, path, key, ptrp, level);

	nilfs_btree_free_path(path);

+1 −2
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ static int nilfs_direct_lookup(const struct nilfs_bmap *direct,
	if (ptr == NILFS_BMAP_INVALID_PTR)
		return -ENOENT;

	if (ptrp != NULL)
	*ptrp = ptr;
	return 0;
}