summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2005-11-02 15:06:18 +1100
committerNathan Scott <nathans@sgi.com>2005-11-02 15:06:18 +1100
commit5bde1ba99c8243617277f37897189c799e398baf (patch)
treed41b5f972c3b7f07cd0ea3af7c3f2775208e4f40 /fs
parent9dac13e7ffddf40c7bf1bf8bf4f735af6c3d31ec (diff)
downloadlinux-3.10-5bde1ba99c8243617277f37897189c799e398baf.tar.gz
linux-3.10-5bde1ba99c8243617277f37897189c799e398baf.tar.bz2
linux-3.10-5bde1ba99c8243617277f37897189c799e398baf.zip
[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>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_acl.c1
-rw-r--r--fs/xfs/xfs_alloc_btree.c8
-rw-r--r--fs/xfs/xfs_dir2_sf.c6
-rw-r--r--fs/xfs/xfs_dir_leaf.c2
-rw-r--r--fs/xfs/xfs_ialloc_btree.c7
5 files changed, 20 insertions, 4 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 571bb3205d5..cc9c91b9e77 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -436,6 +436,7 @@ xfs_acl_access(
int seen_userobj = 0;
matched.ae_tag = 0; /* Invalid type */
+ matched.ae_perm = 0;
md >>= 6; /* Normalize the bits for comparison */
for (i = 0; i < fap->acl_cnt; i++) {
diff --git a/fs/xfs/xfs_alloc_btree.c b/fs/xfs/xfs_alloc_btree.c
index 1a34b7d99bc..7ecc8c0611d 100644
--- a/fs/xfs/xfs_alloc_btree.c
+++ b/fs/xfs/xfs_alloc_btree.c
@@ -614,6 +614,14 @@ xfs_alloc_insrec(
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.
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c
index 6504afc54a5..ec8e7476c8b 100644
--- a/fs/xfs/xfs_dir2_sf.c
+++ b/fs/xfs/xfs_dir2_sf.c
@@ -86,7 +86,7 @@ xfs_dir2_block_sfsize(
int isdotdot; /* entry is ".." */
xfs_mount_t *mp; /* mount structure pointer */
int namelen; /* total name bytes */
- xfs_ino_t parent; /* parent inode number */
+ xfs_ino_t parent = 0; /* parent inode number */
int size=0; /* total computed size */
mp = dp->i_mount;
@@ -277,11 +277,11 @@ xfs_dir2_sf_addname(
int incr_isize; /* total change in size */
int new_isize; /* di_size after adding name */
int objchange; /* changing to 8-byte inodes */
- xfs_dir2_data_aoff_t offset; /* offset for new entry */
+ xfs_dir2_data_aoff_t offset = 0; /* offset for new entry */
int old_isize; /* di_size before adding name */
int pick; /* which algorithm to use */
xfs_dir2_sf_t *sfp; /* shortform structure */
- xfs_dir2_sf_entry_t *sfep; /* shortform entry */
+ xfs_dir2_sf_entry_t *sfep = NULL; /* shortform entry */
xfs_dir2_trace_args("sf_addname", args);
ASSERT(xfs_dir2_sf_lookup(args) == ENOENT);
diff --git a/fs/xfs/xfs_dir_leaf.c b/fs/xfs/xfs_dir_leaf.c
index f0c603a78fc..950df31efc4 100644
--- a/fs/xfs/xfs_dir_leaf.c
+++ b/fs/xfs/xfs_dir_leaf.c
@@ -628,7 +628,7 @@ xfs_dir_leaf_to_shortform(xfs_da_args_t *iargs)
xfs_dir_leaf_name_t *namest;
xfs_da_args_t args;
xfs_inode_t *dp;
- xfs_ino_t parent;
+ xfs_ino_t parent = 0;
char *tmpbuffer;
int retval, i;
xfs_dabuf_t *bp;
diff --git a/fs/xfs/xfs_ialloc_btree.c b/fs/xfs/xfs_ialloc_btree.c
index e5c23445d38..6912143f6ff 100644
--- a/fs/xfs/xfs_ialloc_btree.c
+++ b/fs/xfs/xfs_ialloc_btree.c
@@ -551,6 +551,13 @@ xfs_inobt_insrec(
xfs_inobt_rec_t *rp=NULL; /* pointer to btree records */
/*
+ * 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.
*/