aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-02-25 09:47:32 -0500
committerDavid Sterba <dsterba@suse.cz>2015-03-03 11:23:59 -0500
commit3284da7b7b585e6e8e98f374a51d234d14c7a0a2 (patch)
tree64babc4e0036884b69bc61e7866cc2056e258124 /fs
parentf64c7b12f86c638f13e19de08eeb8cf888dff8f6 (diff)
btrfs: use explicit initializer for seq_elem
Using {} as initializer for struct seq_elem does not properly initialize the list_head member, but it currently works because it gets set through btrfs_get_tree_mod_seq if 'seq' is 0. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/backref.c4
-rw-r--r--fs/btrfs/ctree.h2
-rw-r--r--fs/btrfs/ioctl.c2
-rw-r--r--fs/btrfs/qgroup.c6
4 files changed, 8 insertions, 6 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index f55721ff9385..9de772ee0031 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1206,7 +1206,7 @@ int btrfs_check_shared(struct btrfs_trans_handle *trans,
1206 struct ulist *roots = NULL; 1206 struct ulist *roots = NULL;
1207 struct ulist_iterator uiter; 1207 struct ulist_iterator uiter;
1208 struct ulist_node *node; 1208 struct ulist_node *node;
1209 struct seq_list elem = {}; 1209 struct seq_list elem = SEQ_LIST_INIT(elem);
1210 int ret = 0; 1210 int ret = 0;
1211 1211
1212 tmp = ulist_alloc(GFP_NOFS); 1212 tmp = ulist_alloc(GFP_NOFS);
@@ -1610,7 +1610,7 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
1610 struct ulist *roots = NULL; 1610 struct ulist *roots = NULL;
1611 struct ulist_node *ref_node = NULL; 1611 struct ulist_node *ref_node = NULL;
1612 struct ulist_node *root_node = NULL; 1612 struct ulist_node *root_node = NULL;
1613 struct seq_list tree_mod_seq_elem = {}; 1613 struct seq_list tree_mod_seq_elem = SEQ_LIST_INIT(tree_mod_seq_elem);
1614 struct ulist_iterator ref_uiter; 1614 struct ulist_iterator ref_uiter;
1615 struct ulist_iterator root_uiter; 1615 struct ulist_iterator root_uiter;
1616 1616
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index b3dd55f52f71..36e009ebab47 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1328,6 +1328,8 @@ struct seq_list {
1328 u64 seq; 1328 u64 seq;
1329}; 1329};
1330 1330
1331#define SEQ_LIST_INIT(name) { .list = LIST_HEAD_INIT((name).list), .seq = 0 }
1332
1331enum btrfs_orphan_cleanup_state { 1333enum btrfs_orphan_cleanup_state {
1332 ORPHAN_CLEANUP_STARTED = 1, 1334 ORPHAN_CLEANUP_STARTED = 1,
1333 ORPHAN_CLEANUP_DONE = 2, 1335 ORPHAN_CLEANUP_DONE = 2,
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index d49fe8a0f6b5..0a9fe214deeb 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3039,7 +3039,7 @@ out:
3039static int check_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, 3039static int check_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
3040 u64 disko) 3040 u64 disko)
3041{ 3041{
3042 struct seq_list tree_mod_seq_elem = {}; 3042 struct seq_list tree_mod_seq_elem = SEQ_LIST_INIT(tree_mod_seq_elem);
3043 struct ulist *roots; 3043 struct ulist *roots;
3044 struct ulist_iterator uiter; 3044 struct ulist_iterator uiter;
3045 struct ulist_node *root_node = NULL; 3045 struct ulist_node *root_node = NULL;
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 97159a8e91d4..7f7eb399a347 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1845,7 +1845,7 @@ static int qgroup_shared_accounting(struct btrfs_trans_handle *trans,
1845 struct ulist *roots = NULL; 1845 struct ulist *roots = NULL;
1846 struct ulist *qgroups, *tmp; 1846 struct ulist *qgroups, *tmp;
1847 struct btrfs_qgroup *qgroup; 1847 struct btrfs_qgroup *qgroup;
1848 struct seq_list elem = {}; 1848 struct seq_list elem = SEQ_LIST_INIT(elem);
1849 u64 seq; 1849 u64 seq;
1850 int old_roots = 0; 1850 int old_roots = 0;
1851 int new_roots = 0; 1851 int new_roots = 0;
@@ -1967,7 +1967,7 @@ static int qgroup_subtree_accounting(struct btrfs_trans_handle *trans,
1967 int err; 1967 int err;
1968 struct btrfs_qgroup *qg; 1968 struct btrfs_qgroup *qg;
1969 u64 root_obj = 0; 1969 u64 root_obj = 0;
1970 struct seq_list elem = {}; 1970 struct seq_list elem = SEQ_LIST_INIT(elem);
1971 1971
1972 parents = ulist_alloc(GFP_NOFS); 1972 parents = ulist_alloc(GFP_NOFS);
1973 if (!parents) 1973 if (!parents)
@@ -2522,7 +2522,7 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
2522{ 2522{
2523 struct btrfs_key found; 2523 struct btrfs_key found;
2524 struct ulist *roots = NULL; 2524 struct ulist *roots = NULL;
2525 struct seq_list tree_mod_seq_elem = {}; 2525 struct seq_list tree_mod_seq_elem = SEQ_LIST_INIT(tree_mod_seq_elem);
2526 u64 num_bytes; 2526 u64 num_bytes;
2527 u64 seq; 2527 u64 seq;
2528 int new_roots; 2528 int new_roots;