From 7bb85ef3608bf740e285b4436776526b7afd4903 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 12 Aug 2013 20:49:34 +1000 Subject: xfs: move unrelated definitions out of xfs_inode.h Signed-off-by: Dave Chinner Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- fs/xfs/xfs_ialloc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/xfs/xfs_ialloc.c') diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index 7a0c17d7ec09..bd4e2a7b0928 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c @@ -39,6 +39,7 @@ #include "xfs_cksum.h" #include "xfs_buf_item.h" #include "xfs_icreate_item.h" +#include "xfs_icache.h" /* -- cgit v1.2.3-59-g8ed1b From 836a94ad59bf6c1bcea0fdbe945540926fa3ca8b Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 12 Aug 2013 20:49:44 +1000 Subject: xfs: fix issues that cause userspace warnings 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 Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- fs/xfs/xfs_attr_remote.c | 8 ++++---- fs/xfs/xfs_bmap.c | 3 --- fs/xfs/xfs_da_btree.c | 6 +++--- fs/xfs/xfs_dir2_node.c | 2 ++ fs/xfs/xfs_ialloc.c | 2 +- fs/xfs/xfs_rtalloc.c | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) (limited to 'fs/xfs/xfs_ialloc.c') diff --git a/fs/xfs/xfs_attr_remote.c b/fs/xfs/xfs_attr_remote.c index b42926a5400d..712a502de619 100644 --- a/fs/xfs/xfs_attr_remote.c +++ b/fs/xfs/xfs_attr_remote.c @@ -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; diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 1f09fafa07fa..a9331a6b36fb 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c @@ -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. diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index 8bbd7ef66ea8..d4e59a4ff59f 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c @@ -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; diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c index b4bd9b6e93f9..18e287deee66 100644 --- a/fs/xfs/xfs_dir2_node.c +++ b/fs/xfs/xfs_dir2_node.c @@ -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); } diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index bd4e2a7b0928..266024b3668c 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c @@ -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); diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 084caa81bf1c..7a445e68c35b 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -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; /* -- cgit v1.2.3-59-g8ed1b From 2f21ff1cca79e1d7805416bac5356508e7e652d5 Mon Sep 17 00:00:00 2001 From: Zhi Yong Wu Date: Mon, 12 Aug 2013 03:14:58 +0000 Subject: xfs: fix the comment of xfs_ialloc_ag_select() Signed-off-by: Zhi Yong Wu Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- fs/xfs/xfs_ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/xfs/xfs_ialloc.c') diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index 266024b3668c..6bee95d8a73e 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c @@ -507,7 +507,7 @@ xfs_ialloc_next_ag( /* * Select an allocation group to look for a free inode in, based on the parent - * inode and then mode. Return the allocation group buffer. + * inode and the mode. Return the allocation group buffer. */ STATIC xfs_agnumber_t xfs_ialloc_ag_select( -- cgit v1.2.3-59-g8ed1b From b121099d84b0311a26ca04d33961febb33580fe4 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Tue, 27 Aug 2013 17:15:45 -0400 Subject: xfs: check correct status variable for xfs_inobt_get_rec() call The call to xfs_inobt_get_rec() in xfs_dialloc_ag() passes 'j' as the output status variable. The immediately following XFS_WANT_CORRUPTED_GOTO() checks the value of 'i,' which is from the previous lookup call and has already been checked. Fix the corruption check to use 'j.' Signed-off-by: Brian Foster Reviewed-by: Eric Sandeen Reviewed-by: Dave Chinner Signed-off-by: Ben Myers --- fs/xfs/xfs_ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/xfs/xfs_ialloc.c') diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index 6bee95d8a73e..ccf2fb143962 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c @@ -729,7 +729,7 @@ xfs_dialloc_ag( error = xfs_inobt_get_rec(cur, &rec, &j); if (error) goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + XFS_WANT_CORRUPTED_GOTO(j == 1, error0); if (rec.ir_freecount > 0) { /* -- cgit v1.2.3-59-g8ed1b