aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu/fs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/gnu/fs')
-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 2b09be477959..e337e32f8f6d 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 e668dc1c866e..65a48e465ffc 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 683024a6461f..758cdef01adf 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 43be6a7e47c6..8b2d8f5bd1f1 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 7b03d2e2ea61..5c7ab963539c 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 bea44709afbe..725123f07ff9 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 9cc702a839a3..7df722e60139 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 0af33a899afa..af1a240f0e04 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 16f1d78cc74c..b0e3ca60e7f4 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 27d7b349d524..46c0d3dede30 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 10d7cc95051e..c0e035ba9fc5 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 0e0b4d2ec202..89297a069c02 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 41442ee1f60f..32a6370e8be1 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
/*