]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xfs: fix issues that cause userspace warnings
authorDave Chinner <dchinner@redhat.com>
Mon, 12 Aug 2013 10:49:44 +0000 (20:49 +1000)
committerBen Myers <bpm@sgi.com>
Mon, 12 Aug 2013 21:52:54 +0000 (16:52 -0500)
Some of the code shared with userspace causes compilation warnings
from things turned off in the kernel code, such as differences in
variable signedness. Fix those issues.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_attr_remote.c
fs/xfs/xfs_bmap.c
fs/xfs/xfs_da_btree.c
fs/xfs/xfs_dir2_node.c
fs/xfs/xfs_ialloc.c
fs/xfs/xfs_rtalloc.c

index b42926a5400d0af71ca088fbc3ff4c510df89156..712a502de619b097df202f744ba481bd3471847d 100644 (file)
@@ -239,7 +239,7 @@ xfs_attr_rmtval_copyout(
        xfs_ino_t       ino,
        int             *offset,
        int             *valuelen,
-       char            **dst)
+       __uint8_t       **dst)
 {
        char            *src = bp->b_addr;
        xfs_daddr_t     bno = bp->b_bn;
@@ -286,7 +286,7 @@ xfs_attr_rmtval_copyin(
        xfs_ino_t       ino,
        int             *offset,
        int             *valuelen,
-       char            **src)
+       __uint8_t       **src)
 {
        char            *dst = bp->b_addr;
        xfs_daddr_t     bno = bp->b_bn;
@@ -339,7 +339,7 @@ xfs_attr_rmtval_get(
        struct xfs_mount        *mp = args->dp->i_mount;
        struct xfs_buf          *bp;
        xfs_dablk_t             lblkno = args->rmtblkno;
-       char                    *dst = args->value;
+       __uint8_t               *dst = args->value;
        int                     valuelen = args->valuelen;
        int                     nmap;
        int                     error;
@@ -403,7 +403,7 @@ xfs_attr_rmtval_set(
        struct xfs_bmbt_irec    map;
        xfs_dablk_t             lblkno;
        xfs_fileoff_t           lfileoff = 0;
-       char                    *src = args->value;
+       __uint8_t               *src = args->value;
        int                     blkcnt;
        int                     valuelen;
        int                     nmap;
index 1f09fafa07fa9e141f8e2a47726f584965d18654..a9331a6b36fb804cb6935423764637844e141118 100644 (file)
@@ -4258,12 +4258,9 @@ __xfs_bmapi_allocate(
        struct xfs_ifork        *ifp = XFS_IFORK_PTR(bma->ip, whichfork);
        int                     tmp_logflags = 0;
        int                     error;
-       int                     rt;
 
        ASSERT(bma->length > 0);
 
-       rt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(bma->ip);
-
        /*
         * For the wasdelay case, we could also just allocate the stuff asked
         * for in this bmap call but that wouldn't be as good.
index 8bbd7ef66ea84c98fae410b0157c21d8bd4225d5..d4e59a4ff59ff1600cf8c9a83ce4b36f47ddfcd0 100644 (file)
@@ -399,7 +399,7 @@ xfs_da3_split(
        struct xfs_da_intnode   *node;
        struct xfs_buf          *bp;
        int                     max;
-       int                     action;
+       int                     action = 0;
        int                     error;
        int                     i;
 
@@ -2454,9 +2454,9 @@ static int
 xfs_buf_map_from_irec(
        struct xfs_mount        *mp,
        struct xfs_buf_map      **mapp,
-       unsigned int            *nmaps,
+       int                     *nmaps,
        struct xfs_bmbt_irec    *irecs,
-       unsigned int            nirecs)
+       int                     nirecs)
 {
        struct xfs_buf_map      *map;
        int                     i;
index b4bd9b6e93f9ab41377d96944d77aa37e547873d..18e287deee667527b816453c1dfd7f58fb802198 100644 (file)
@@ -313,11 +313,13 @@ xfs_dir2_free_log_header(
        struct xfs_trans        *tp,
        struct xfs_buf          *bp)
 {
+#ifdef DEBUG
        xfs_dir2_free_t         *free;          /* freespace structure */
 
        free = bp->b_addr;
        ASSERT(free->hdr.magic == cpu_to_be32(XFS_DIR2_FREE_MAGIC) ||
               free->hdr.magic == cpu_to_be32(XFS_DIR3_FREE_MAGIC));
+#endif
        xfs_trans_log_buf(tp, bp, 0, xfs_dir3_free_hdr_size(tp->t_mountp) - 1);
 }
 
index bd4e2a7b09285a92651d87a7f674db5f2cae97a8..266024b3668cdf42951371eda03079a3bcb7eef9 100644 (file)
@@ -1342,7 +1342,7 @@ xfs_imap(
        xfs_agblock_t   cluster_agbno;  /* first block in inode cluster */
        int             error;  /* error code */
        int             offset; /* index of inode in its buffer */
-       int             offset_agbno;   /* blks from chunk start to inode */
+       xfs_agblock_t   offset_agbno;   /* blks from chunk start to inode */
 
        ASSERT(ino != NULLFSINO);
 
index 084caa81bf1cfc2333c26591ce2b7c99ac6d51ae..7a445e68c35be099c51b24e646f963e6e3b7b722 100644 (file)
@@ -736,8 +736,8 @@ xfs_rtallocate_range(
 {
        xfs_rtblock_t   end;            /* end of the allocated extent */
        int             error;          /* error value */
-       xfs_rtblock_t   postblock;      /* first block allocated > end */
-       xfs_rtblock_t   preblock;       /* first block allocated < start */
+       xfs_rtblock_t   postblock = 0;  /* first block allocated > end */
+       xfs_rtblock_t   preblock = 0;   /* first block allocated < start */
 
        end = start + len - 1;
        /*