linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allison Henderson <allison.henderson@oracle.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>, guaneryu@gmail.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 05/12] fsx: use an enum to define the operation commands
Date: Sat, 24 Nov 2018 11:23:27 -0700	[thread overview]
Message-ID: <2e0fba51-4fdf-4f17-1373-d305f7a01c4e@oracle.com> (raw)
In-Reply-To: <154290953980.1218.7605730679708903723.stgit@magnolia>

Looks ok to me

Reviewed-By: Allison Henderson <allison.henderson@oracle.com>

On 11/22/18 10:58 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Use an enum to define operation codes and the boundaries between
> operation classes so that we can add new commands without having to
> change a bunch of unrelated #defines.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>   ltp/fsx.c |   40 +++++++++++++++++++++-------------------
>   1 file changed, 21 insertions(+), 19 deletions(-)
> 
> 
> diff --git a/ltp/fsx.c b/ltp/fsx.c
> index 7fb8b3ab..dabad302 100644
> --- a/ltp/fsx.c
> +++ b/ltp/fsx.c
> @@ -88,25 +88,27 @@ int			logcount = 0;	/* total ops */
>    * mode being run.
>    */
>   
> -/* common operations */
> -#define	OP_READ		0
> -#define OP_WRITE	1
> -#define OP_MAPREAD	2
> -#define OP_MAPWRITE	3
> -#define OP_MAX_LITE	4
> -
> -/* !lite operations */
> -#define OP_TRUNCATE		4
> -#define OP_FALLOCATE		5
> -#define OP_PUNCH_HOLE		6
> -#define OP_ZERO_RANGE		7
> -#define OP_COLLAPSE_RANGE	8
> -#define OP_INSERT_RANGE	9
> -#define OP_MAX_FULL		10
> -
> -/* integrity operations */
> -#define OP_FSYNC		10
> -#define OP_MAX_INTEGRITY	11
> +enum {
> +	/* common operations */
> +	OP_READ = 0,
> +	OP_WRITE,
> +	OP_MAPREAD,
> +	OP_MAPWRITE,
> +	OP_MAX_LITE,
> +
> +	/* !lite operations */
> +	OP_TRUNCATE = OP_MAX_LITE,
> +	OP_FALLOCATE,
> +	OP_PUNCH_HOLE,
> +	OP_ZERO_RANGE,
> +	OP_COLLAPSE_RANGE,
> +	OP_INSERT_RANGE,
> +	OP_MAX_FULL,
> +
> +	/* integrity operations */
> +	OP_FSYNC = OP_MAX_FULL,
> +	OP_MAX_INTEGRITY,
> +};
>   
>   #undef PAGE_SIZE
>   #define PAGE_SIZE       getpagesize()
> 

  reply	other threads:[~2018-11-25  5:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 17:58 [PATCH v3 00/12] xfstests: add copy/dedupe/clone to fsx/fsstress Darrick J. Wong
2018-11-22 17:58 ` [PATCH 01/12] fsstress: fix compiler warnings Darrick J. Wong
2018-11-24 18:22   ` Allison Henderson
2018-11-22 17:58 ` [PATCH 02/12] fsstress: check system call return values Darrick J. Wong
2018-11-24 18:22   ` Allison Henderson
2018-11-22 17:58 ` [PATCH 03/12] fsx: shut up compiler warnings Darrick J. Wong
2018-11-24 18:23   ` Allison Henderson
2018-11-22 17:58 ` [PATCH 04/12] fsx: always check buffer after each operation Darrick J. Wong
2018-11-24 18:24   ` Allison Henderson
2018-11-22 17:58 ` [PATCH 05/12] fsx: use an enum to define the operation commands Darrick J. Wong
2018-11-24 18:23   ` Allison Henderson [this message]
2018-11-22 17:59 ` [PATCH 06/12] fsx: add five-argument logging function Darrick J. Wong
2018-11-24 18:23   ` Allison Henderson
2018-11-22 17:59 ` [PATCH 07/12] fsx: add FICLONERANGE support Darrick J. Wong
2018-11-22 17:59 ` [PATCH 08/12] fsx: add FIDEDUPERANGE support Darrick J. Wong
2018-11-22 17:59 ` [PATCH 09/12] fsstress: add copy_file_range support Darrick J. Wong
2018-11-22 17:59 ` [PATCH 10/12] fsx: " Darrick J. Wong
2018-11-22 17:59 ` [PATCH 11/12] common/dump: disable copyrange Darrick J. Wong
2018-11-22 17:59 ` [PATCH 12/12] generic: long fsx soak tests Darrick J. Wong
2018-11-25 16:27   ` Eryu Guan
2018-11-26 20:50     ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2018-12-07  6:23 [PATCH v4 00/12] xfstests: add copy/dedupe/clone to fsx/fsstress Darrick J. Wong
2018-12-07  6:23 ` [PATCH 05/12] fsx: use an enum to define the operation commands Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e0fba51-4fdf-4f17-1373-d305f7a01c4e@oracle.com \
    --to=allison.henderson@oracle.com \
    --cc=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).