aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorRyusuke Konishi2010-07-13 23:33:51 +0900
committerRyusuke Konishi2010-07-23 10:02:14 +0900
commit364ec2d700223b965620ff4d5031a3665d195873 (patch)
tree2cf23dbf1ce4de2125c62f6804f4c672a4127096 /fs
parent05d0e94b66dbdf9d90371b39dc7a6b390ba74d41 (diff)
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: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs')
-rw-r--r--fs/nilfs2/btree.c6
-rw-r--r--fs/nilfs2/direct.c3
2 files changed, 2 insertions, 7 deletions
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
index 0543bf9f80ba..18bb965c66b5 100644
--- a/fs/nilfs2/btree.c
+++ b/fs/nilfs2/btree.c
@@ -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);
diff --git a/fs/nilfs2/direct.c b/fs/nilfs2/direct.c
index 318613010106..324d80c57518 100644
--- a/fs/nilfs2/direct.c
+++ b/fs/nilfs2/direct.c
@@ -56,8 +56,7 @@ static int nilfs_direct_lookup(const struct nilfs_bmap *direct,
if (ptr == NILFS_BMAP_INVALID_PTR)
return -ENOENT;
- if (ptrp != NULL)
- *ptrp = ptr;
+ *ptrp = ptr;
return 0;
}