btrfs: tree_search: eliminate redundant nr_items check
authorGerhard Heift <gerhard@heift.name>
Thu, 30 Jan 2014 15:23:57 +0000 (16:23 +0100)
committerChris Mason <clm@fb.com>
Fri, 13 Jun 2014 01:20:39 +0000 (18:20 -0700)
commit25c9bc2e2bc9d67de7fc49ff2784cae5de755192
treefe51f95796bd4e6126c70bcc48e01ed08add3f57
parentc7548af69d9ef71512eb52d8009521eba3e768fd
btrfs: tree_search: eliminate redundant nr_items check

If the amount of items reached the given limit of nr_items, we can leave
copy_to_sk without updating the key. Also by returning 1 we leave the loop in
search_ioctl without rechecking if we reached the given limit.

Signed-off-by: Gerhard Heift <Gerhard@Heift.Name>
Signed-off-by: Chris Mason <clm@fb.com>
Acked-by: David Sterba <dsterba@suse.cz>
fs/btrfs/ioctl.c