xfs
[Top] [All Lists]

Re: [PATCH 3/4] xfsprogs: rename dont_obfuscate in xfs_metadump

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH 3/4] xfsprogs: rename dont_obfuscate in xfs_metadump
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Wed, 3 Jun 2015 13:11:28 -0400
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <5568BA54.3060302@xxxxxxxxxxx>
References: <5568B7CE.9030709@xxxxxxxxxx> <5568BA54.3060302@xxxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Fri, May 29, 2015 at 02:13:24PM -0500, Eric Sandeen wrote:
> Seeing "if (!dont_obfuscate)" hurts my brain; rename it to
> "obfuscate" and invert the logic.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---

We could have gone with dont_not_obfuscate, but this works too. ;)

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

>  db/metadump.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/db/metadump.c b/db/metadump.c
> index b227a6d..57b53d9 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -74,7 +74,7 @@ static xfs_ino_t    cur_ino;
>  static int           show_progress = 0;
>  static int           stop_on_read_error = 0;
>  static int           max_extent_size = DEFAULT_MAX_EXT_SIZE;
> -static int           dont_obfuscate = 0;
> +static int           obfuscate = 1;
>  static int           show_warnings = 0;
>  static int           progress_since_warning = 0;
>  
> @@ -1368,7 +1368,7 @@ process_single_fsb_objects(
>  
>               }
>  
> -             if (dont_obfuscate)
> +             if (!obfuscate)
>                       goto write;
>  
>               dp = iocur_top->data;
> @@ -1460,7 +1460,7 @@ process_multi_fsb_objects(
>  
>                       }
>  
> -                     if (dont_obfuscate || o >= mp->m_dir_geo->leafblk) {
> +                     if (!obfuscate || o >= mp->m_dir_geo->leafblk) {
>                               ret = write_buf(iocur_top);
>                               goto out_pop;
>                       }
> @@ -1725,7 +1725,7 @@ process_inode_data(
>  {
>       switch (dip->di_format) {
>               case XFS_DINODE_FMT_LOCAL:
> -                     if (!dont_obfuscate)
> +                     if (obfuscate)
>                               switch (itype) {
>                                       case TYP_DIR2:
>                                               obfuscate_sf_dir(dip);
> @@ -1769,7 +1769,7 @@ process_inode(
>       cur_ino = XFS_AGINO_TO_INO(mp, agno, agino);
>  
>       /* we only care about crc recalculation if we are obfuscating names. */
> -     if (!dont_obfuscate) {
> +     if (obfuscate) {
>               crc_was_ok = xfs_verify_cksum((char *)dip,
>                                       mp->m_sb.sb_inodesize,
>                                       offsetof(struct xfs_dinode, di_crc));
> @@ -1801,7 +1801,7 @@ process_inode(
>               switch (dip->di_aformat) {
>                       case XFS_DINODE_FMT_LOCAL:
>                               need_new_crc = 1;
> -                             if (!dont_obfuscate)
> +                             if (obfuscate)
>                                       obfuscate_sf_attr(dip);
>                               break;
>  
> @@ -2247,7 +2247,7 @@ metadump_f(
>                               }
>                               break;
>                       case 'o':
> -                             dont_obfuscate = 1;
> +                             obfuscate = 0;
>                               break;
>                       case 'w':
>                               show_warnings = 1;
> -- 1.7.1
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 3/4] xfsprogs: rename dont_obfuscate in xfs_metadump, Brian Foster <=