xfs
[Top] [All Lists]

Re: [PATCH 2/2] xfs: tidy up xfs_set_inode32

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH 2/2] xfs: tidy up xfs_set_inode32
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Mon, 7 Jul 2014 14:21:17 -0400
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <53B4E2C5.1000303@xxxxxxxxxxx>
References: <53B4E1EE.40702@xxxxxxxxxx> <53B4E2C5.1000303@xxxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Wed, Jul 02, 2014 at 11:57:41PM -0500, Eric Sandeen wrote:
> xfs_set_inode32() caught my eye because it had
> weird spacing around the "-1's".  In cleaning that
> up, I realized that the assignment in the declaration
> of "ino" is never used; it's rewritten before it gets
> read.
> 
> Drop the ino initializer from its declaration since it's
> not used, and move the agino initialization into the body
> of the function, mostly so that we can have pretty
> whitespace and not exceed 80 columns.  :)
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

> 
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index e71c0f8..39c9315 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -609,8 +609,8 @@ xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t 
> agcount)
>       xfs_agnumber_t  maxagi = 0;
>       xfs_sb_t        *sbp = &mp->m_sb;
>       xfs_agnumber_t  max_metadata;
> -     xfs_agino_t     agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks -1, 0);
> -     xfs_ino_t       ino = XFS_AGINO_TO_INO(mp, sbp->sb_agcount -1, agino);
> +     xfs_agino_t     agino;
> +     xfs_ino_t       ino;
>       xfs_perag_t     *pag;
>  
>       /* Calculate how much should be reserved for inodes to meet
> @@ -628,6 +628,8 @@ xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t 
> agcount)
>               max_metadata = agcount;
>       }
>  
> +     agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0);
> +
>       for (index = 0; index < agcount; index++) {
>               ino = XFS_AGINO_TO_INO(mp, index, agino);
>  
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>