[XFS] silence gcc4 warnings. the directory ones are wrong because of
information gcc could not find out (that a directory always has a ..
entry), the others are outright gcc bugs.
SGI-PV: 943511
SGI-Modid: xfs-linux:xfs-kern:200055a
Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
diff --git a/fs/xfs/xfs_alloc_btree.c b/fs/xfs/xfs_alloc_btree.c
index 1a34b7d..7ecc8c0 100644
--- a/fs/xfs/xfs_alloc_btree.c
+++ b/fs/xfs/xfs_alloc_btree.c
@@ -614,6 +614,14 @@
xfs_alloc_rec_t *rp; /* pointer to btree records */
ASSERT(INT_GET(recp->ar_blockcount, ARCH_CONVERT) > 0);
+
+ /*
+ * GCC doesn't understand the (arguably complex) control flow in
+ * this function and complains about uninitialized structure fields
+ * without this.
+ */
+ memset(&nrec, 0, sizeof(nrec));
+
/*
* If we made it to the root level, allocate a new root block
* and we're done.