summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2007-05-30 03:03:06 +0000
committerkan <kan@FreeBSD.org>2007-05-30 03:03:06 +0000
commitc5946ebbbc9405578f16560b3f958ac574d6bc90 (patch)
treee47528f51b9a15d03bab8c81b629bd6db21bf480 /sys
parent7bbae8657509409d1d19409f0b95aa50c7c288e3 (diff)
downloadFreeBSD-src-c5946ebbbc9405578f16560b3f958ac574d6bc90.zip
FreeBSD-src-c5946ebbbc9405578f16560b3f958ac574d6bc90.tar.gz
Bow to incomplete GCC 4. constant propagation optimizations and
initialize some of the local variables GCC claims are being used uninitialized.
Diffstat (limited to 'sys')
-rw-r--r--sys/gnu/fs/xfs/FreeBSD/support/spin.h4
-rw-r--r--sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c2
-rw-r--r--sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c2
-rw-r--r--sys/gnu/fs/xfs/xfs_bit.c2
-rw-r--r--sys/gnu/fs/xfs/xfs_bmap.c2
-rw-r--r--sys/gnu/fs/xfs/xfs_bmap_btree.c1
-rw-r--r--sys/gnu/fs/xfs/xfs_dir.c1
-rw-r--r--sys/gnu/fs/xfs/xfs_ialloc.c2
-rw-r--r--sys/gnu/fs/xfs/xfs_inode.c4
-rw-r--r--sys/gnu/fs/xfs/xfs_log.c4
-rw-r--r--sys/gnu/fs/xfs/xfs_log_recover.c2
-rw-r--r--sys/gnu/fs/xfs/xfs_rtalloc.h2
-rw-r--r--sys/gnu/fs/xfs/xfs_vnodeops.c2
13 files changed, 17 insertions, 13 deletions
diff --git a/sys/gnu/fs/xfs/FreeBSD/support/spin.h b/sys/gnu/fs/xfs/FreeBSD/support/spin.h
index 2b09be4..e337e32 100644
--- a/sys/gnu/fs/xfs/FreeBSD/support/spin.h
+++ b/sys/gnu/fs/xfs/FreeBSD/support/spin.h
@@ -33,10 +33,10 @@ static __inline register_t
mutex_spinlock(lock_t *lock) { mtx_lock(lock); return 0; }
#endif
-#define mutex_spinunlock(lock,s) \
+#define mutex_spinunlock(lock, s) \
do { \
spin_unlock(lock); \
- if (&s) {} \
+ if (s != 0) {} \
} while (0)
#endif /* __XFS_SUPPORT_SPIN_H__ */
diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c b/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c
index e668dc1..65a48e4 100644
--- a/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c
+++ b/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c
@@ -391,7 +391,7 @@ xfs_readlink_by_handle(
struct uio auio;
struct inode *inode;
xfs_fsop_handlereq_t hreq;
- xfs_vnode_t *vp;
+ xfs_vnode_t *vp = NULL;
__u32 olen;
if (!capable(CAP_SYS_ADMIN))
diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c b/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c
index 683024a..758cdef 100644
--- a/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c
+++ b/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c
@@ -361,7 +361,7 @@ _xfs_vget(mp, ino, flags, vpp)
int flags;
struct vnode **vpp;
{
- xfs_vnode_t *vp;
+ xfs_vnode_t *vp = NULL;
int error;
printf("XVFS_GET_VNODE(MNTTOVFS(mp), &vp, ino, error);\n");
diff --git a/sys/gnu/fs/xfs/xfs_bit.c b/sys/gnu/fs/xfs/xfs_bit.c
index 43be6a7..8b2d8f5 100644
--- a/sys/gnu/fs/xfs/xfs_bit.c
+++ b/sys/gnu/fs/xfs/xfs_bit.c
@@ -106,7 +106,7 @@ static const char xfs_countbit[256] = {
/*
* xfs_highbit32: get high bit set out of 32-bit argument, -1 if none set.
*/
-inline int
+int
xfs_highbit32(
__uint32_t v)
{
diff --git a/sys/gnu/fs/xfs/xfs_bmap.c b/sys/gnu/fs/xfs/xfs_bmap.c
index 7b03d2e..5c7ab96 100644
--- a/sys/gnu/fs/xfs/xfs_bmap.c
+++ b/sys/gnu/fs/xfs/xfs_bmap.c
@@ -4992,7 +4992,7 @@ xfs_bmapi(
bma.firstblock = *firstblock;
bma.alen = alen;
bma.off = aoff;
- bma.conv = (flags & XFS_BMAPI_CONVERT);
+ bma.conv = (flags & XFS_BMAPI_CONVERT) != 0;
bma.wasdel = wasdelay;
bma.minlen = minlen;
bma.low = flist->xbf_low;
diff --git a/sys/gnu/fs/xfs/xfs_bmap_btree.c b/sys/gnu/fs/xfs/xfs_bmap_btree.c
index bea4470..725123f 100644
--- a/sys/gnu/fs/xfs/xfs_bmap_btree.c
+++ b/sys/gnu/fs/xfs/xfs_bmap_btree.c
@@ -773,6 +773,7 @@ xfs_bmbt_insrec(
XFS_STATS_INC(xs_bmbt_insrec);
block = xfs_bmbt_get_block(cur, level, &bp);
numrecs = be16_to_cpu(block->bb_numrecs);
+ nkey.br_startoff = 0;
#ifdef DEBUG
if ((error = xfs_btree_check_lblock(cur, block, level, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
diff --git a/sys/gnu/fs/xfs/xfs_dir.c b/sys/gnu/fs/xfs/xfs_dir.c
index 9cc702a..7df722e 100644
--- a/sys/gnu/fs/xfs/xfs_dir.c
+++ b/sys/gnu/fs/xfs/xfs_dir.c
@@ -385,6 +385,7 @@ xfs_dir_removename(xfs_trans_t *trans, xfs_inode_t *dp, char *name,
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) {
retval = xfs_dir_shortform_removename(&args);
} else if (xfs_bmap_one_block(dp, XFS_DATA_FORK)) {
+ count = totallen = 0;
retval = xfs_dir_leaf_removename(&args, &count, &totallen);
if (retval == 0) {
newsize = XFS_DIR_SF_ALLFIT(count, totallen);
diff --git a/sys/gnu/fs/xfs/xfs_ialloc.c b/sys/gnu/fs/xfs/xfs_ialloc.c
index 0af33a8..af1a240 100644
--- a/sys/gnu/fs/xfs/xfs_ialloc.c
+++ b/sys/gnu/fs/xfs/xfs_ialloc.c
@@ -522,7 +522,7 @@ xfs_dialloc(
xfs_btree_cur_t *cur; /* inode allocation btree cursor */
int error; /* error return value */
int i; /* result code */
- int ialloced; /* inode allocation status */
+ int ialloced = 0; /* inode allocation status */
int noroom = 0; /* no space for inode blk allocation */
xfs_ino_t ino; /* fs-relative inode to be returned */
/* REFERENCED */
diff --git a/sys/gnu/fs/xfs/xfs_inode.c b/sys/gnu/fs/xfs/xfs_inode.c
index 16f1d78..b0e3ca6 100644
--- a/sys/gnu/fs/xfs/xfs_inode.c
+++ b/sys/gnu/fs/xfs/xfs_inode.c
@@ -1960,9 +1960,9 @@ xfs_iunlink_remove(
xfs_agino_t agino;
xfs_agino_t next_agino;
xfs_buf_t *last_ibp;
- xfs_dinode_t *last_dip;
+ xfs_dinode_t *last_dip = NULL;
short bucket_index;
- int offset, last_offset;
+ int offset, last_offset = 0;
int error;
int agi_ok;
diff --git a/sys/gnu/fs/xfs/xfs_log.c b/sys/gnu/fs/xfs/xfs_log.c
index 27d7b34..46c0d3d 100644
--- a/sys/gnu/fs/xfs/xfs_log.c
+++ b/sys/gnu/fs/xfs/xfs_log.c
@@ -1754,11 +1754,11 @@ xlog_write(xfs_mount_t * mp,
xlog_t *log = mp->m_log;
xlog_ticket_t *ticket = (xlog_ticket_t *)tic;
xlog_op_header_t *logop_head; /* ptr to log operation header */
- xlog_in_core_t *iclog; /* ptr to current in-core log */
+ xlog_in_core_t *iclog = NULL; /* ptr to current in-core log */
__psint_t ptr; /* copy address into data region */
int len; /* # xlog_write() bytes 2 still copy */
int index; /* region index currently copying */
- int log_offset; /* offset (from 0) into data region */
+ int log_offset = 0; /* offset (from 0) into data region */
int start_rec_copy; /* # bytes to copy for start record */
int partial_copy; /* did we split a region? */
int partial_copy_len;/* # bytes copied if split region */
diff --git a/sys/gnu/fs/xfs/xfs_log_recover.c b/sys/gnu/fs/xfs/xfs_log_recover.c
index 10d7cc9..c0e035b 100644
--- a/sys/gnu/fs/xfs/xfs_log_recover.c
+++ b/sys/gnu/fs/xfs/xfs_log_recover.c
@@ -520,7 +520,7 @@ xlog_find_head(
{
xfs_buf_t *bp;
xfs_caddr_t offset;
- xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk;
+ xfs_daddr_t new_blk, first_blk = 0, start_blk, last_blk, head_blk;
int num_scan_bblks;
uint first_half_cycle, last_half_cycle;
uint stop_on_cycle;
diff --git a/sys/gnu/fs/xfs/xfs_rtalloc.h b/sys/gnu/fs/xfs/xfs_rtalloc.h
index 0e0b4d2..89297a0 100644
--- a/sys/gnu/fs/xfs/xfs_rtalloc.h
+++ b/sys/gnu/fs/xfs/xfs_rtalloc.h
@@ -162,7 +162,7 @@ xfs_growfs_rt(
#else
# define xfs_rtallocate_extent(t,b,min,max,l,a,f,p,rb) (ENOSYS)
# define xfs_rtfree_extent(t,b,l) (ENOSYS)
-# define xfs_rtpick_extent(m,t,l,rb) (ENOSYS)
+# define xfs_rtpick_extent(m,t,l,rb) ((*rb = 0), ENOSYS)
# define xfs_growfs_rt(mp,in) (ENOSYS)
# define xfs_rtmount_init(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))
# define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))
diff --git a/sys/gnu/fs/xfs/xfs_vnodeops.c b/sys/gnu/fs/xfs/xfs_vnodeops.c
index 41442ee..32a6370 100644
--- a/sys/gnu/fs/xfs/xfs_vnodeops.c
+++ b/sys/gnu/fs/xfs/xfs_vnodeops.c
@@ -381,6 +381,8 @@ xfs_setattr(
/* boolean: are we the file owner? */
#if 0
file_owner = (current_fsuid(credp) == ip->i_d.di_uid);
+#else
+ file_owner = (credp->cr_uid == ip->i_d.di_uid);
#endif
/*
OpenPOWER on IntegriCloud