btrfs-progs: remove unnecessary judgment for fd in scrub
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>
Thu, 17 Jul 2014 02:40:37 +0000 (10:40 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 22 Aug 2014 13:07:01 +0000 (15:07 +0200)
The scrub_read_file function is always on a branch,
which has (fd >= 0), so there is not need to judgment
the pasted in arg.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-scrub.c

index f9e2b40..a604b25 100644 (file)
@@ -474,9 +474,6 @@ static struct scrub_file_record **scrub_read_file(int fd, int report_errors)
        char empty_uuid[BTRFS_FSID_SIZE] = {0};
        struct scrub_file_record **p = NULL;
 
-       if (fd < 0)
-               return ERR_PTR(-EINVAL);
-
 again:
        old_avail = avail - i;
        BUG_ON(old_avail < 0);