提交 ab199013 编写于 作者: J Josef Bacik 提交者: David Sterba

btrfs: fix uninitialized variable warning in get_inode_gen

Anybody that calls get_inode_gen() can have an uninitialized gen if
there's an error.  This isn't a big deal because all the users just exit
if they get an error, however it makes -Wmaybe-uninitialized complain,
so fix this up to always initialize the passed in gen, this quiets all
of the uninitialized warnings in send.c.
Reviewed-by: NQu Wenruo <wqu@suse.com>
Reviewed-by: NQu Wenruo <wqu@suse.com>
Signed-off-by: NJosef Bacik <josef@toxicpanda.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 0e47b25c
......@@ -956,14 +956,12 @@ static int get_inode_info(struct btrfs_root *root, u64 ino,
static int get_inode_gen(struct btrfs_root *root, u64 ino, u64 *gen)
{
int ret;
struct btrfs_inode_info info;
struct btrfs_inode_info info = { 0 };
if (!gen)
return -EPERM;
ASSERT(gen);
ret = get_inode_info(root, ino, &info);
if (!ret)
*gen = info.gen;
*gen = info.gen;
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册