Commit 9c6c723f authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David Sterba

btrfs: fix gcc-4.8 build warning for struct initializer

Some older compilers like gcc-4.8 warn about mismatched curly braces in
a initializer:

fs/btrfs/backref.c: In function 'is_shared_data_backref':
fs/btrfs/backref.c:394:9: error: missing braces around
initializer [-Werror=missing-braces]
  struct prelim_ref target = {0};
         ^
fs/btrfs/backref.c:394:9: error: (near initialization for
'target.rbnode') [-Werror=missing-braces]

Use the GNU empty initializer extension to avoid this.

Fixes: ed58f2e6 ("btrfs: backref, don't add refs from shared block when resolving normal backref")
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent fcc99734
...@@ -391,7 +391,7 @@ static int is_shared_data_backref(struct preftrees *preftrees, u64 bytenr) ...@@ -391,7 +391,7 @@ static int is_shared_data_backref(struct preftrees *preftrees, u64 bytenr)
struct rb_node **p = &preftrees->direct.root.rb_root.rb_node; struct rb_node **p = &preftrees->direct.root.rb_root.rb_node;
struct rb_node *parent = NULL; struct rb_node *parent = NULL;
struct prelim_ref *ref = NULL; struct prelim_ref *ref = NULL;
struct prelim_ref target = {0}; struct prelim_ref target = {};
int result; int result;
target.parent = bytenr; target.parent = bytenr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment