diff options
author | Nikolay Borisov <nborisov@suse.com> | 2019-08-27 07:46:28 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 08:59:16 -0400 |
commit | 9bb8407f54f63242d822d6c57f4edb7d1ae2b901 (patch) | |
tree | d30e8c575c2f2504646cfd768cfd32745214ce9a /fs/btrfs/tree-log.c | |
parent | 1dc990dfd31096176788312d39e1275645901fcb (diff) |
btrfs: Make btrfs_find_name_in_backref return btrfs_inode_ref struct
btrfs_find_name_in_backref returns either 0/1 depending on whether it
found a backref for the given name. If it returns true then the actual
inode_ref struct is returned in one of its parameters. That's pointless,
instead refactor the function such that it returns either a pointer
to the btrfs_inode_ref or NULL it it didn't find anything. This
streamlines the function calling convention.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 34d087008b72..7a7ae33bea51 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -1271,8 +1271,8 @@ again: | |||
1271 | parent_id, name, | 1271 | parent_id, name, |
1272 | namelen, NULL); | 1272 | namelen, NULL); |
1273 | else | 1273 | else |
1274 | ret = btrfs_find_name_in_backref(log_eb, log_slot, name, | 1274 | ret = !!btrfs_find_name_in_backref(log_eb, log_slot, |
1275 | namelen, NULL); | 1275 | name, namelen); |
1276 | 1276 | ||
1277 | if (!ret) { | 1277 | if (!ret) { |
1278 | struct inode *dir; | 1278 | struct inode *dir; |
@@ -1338,8 +1338,8 @@ static int btrfs_inode_ref_exists(struct inode *inode, struct inode *dir, | |||
1338 | path->slots[0], parent_id, | 1338 | path->slots[0], parent_id, |
1339 | name, namelen, NULL); | 1339 | name, namelen, NULL); |
1340 | else | 1340 | else |
1341 | ret = btrfs_find_name_in_backref(path->nodes[0], path->slots[0], | 1341 | ret = !!btrfs_find_name_in_backref(path->nodes[0], path->slots[0], |
1342 | name, namelen, NULL); | 1342 | name, namelen); |
1343 | 1343 | ||
1344 | out: | 1344 | out: |
1345 | btrfs_free_path(path); | 1345 | btrfs_free_path(path); |