linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: dhowells@redhat.com, linux-xfs <linux-xfs@vger.kernel.org>,
	Andreas Dilger <adilger@dilger.ca>,
	Christoph Hellwig <hch@infradead.org>,
	fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] xfs_io: changes to statx interface [ver #3]
Date: Wed, 29 Mar 2017 17:40:15 +0100	[thread overview]
Message-ID: <9334.1490805615@warthog.procyon.org.uk> (raw)
In-Reply-To: <8127.1490802589@warthog.procyon.org.uk>

David Howells <dhowells@redhat.com> wrote:

> Here's my third attempt at changing Eric's statx patch.  I've got rid of the
> compare option to statx and added a raw output option to stat.  They're still
> not directly comparable since the stat output lacks some fields, but it will
> hopefully be possible to load them into associative arrays in bash and compare
> them that way.

Kind of like this:

function cmpstat () {
    file=$1
    declare -A st stx

    # Read the stat output
    coproc { xfs_io -c "open -P $file" -c "stat -r" | sed -e s/://; }
    while read tag val
    do
	st[$tag]=$val
    done <&${COPROC[0]}
    wait || exit $?

    # Read the statx output
    coproc { xfs_io -c "open -P $file" -c "statx" | sed -e s/://; }
    while read tag val
    do
	stx[$tag]=$val
    done <&${COPROC[0]}
    wait || exit $?

    # Compare them
    for key in ${!stx[*]}
    do
	if [ "${stx[$key]}" != "${st[$key]}" ]
	then
	    case $key in
		stat.mask|stat.attributes|stat.btime.tv_*)
		    # Not supported in stat
		    ;;
		*)
		    echo differ $key "${stx[$key]}" != "${st[$key]}"
		    ;;
	    esac
	fi
    done
}

cmpstat /

  parent reply	other threads:[~2017-03-29 16:40 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24  4:32 [PATCH 0/2 V2] xfs_io: hook up statx Eric Sandeen
2017-03-24  4:34 ` [PATCH 1/2 V2] xfs_io: move stat functions to new file Eric Sandeen
2017-03-27 15:52   ` Darrick J. Wong
2017-03-24  4:45 ` [PATCH 2/2 V2] xfs_io: hook up statx Eric Sandeen
2017-03-27 15:54   ` Darrick J. Wong
2017-03-27 20:58   ` Eric Biggers
2017-03-28 21:57     ` Eric Sandeen
2017-03-27 10:00 ` [PATCH 0/2 " David Howells
2017-03-27 17:47   ` Eric Sandeen
2017-03-27 18:05     ` Eric Sandeen
2017-03-27 21:58     ` Dave Chinner
2017-03-28  7:30   ` Amir Goldstein
2017-03-28  9:39   ` David Howells
2017-03-27 20:20 ` [PATCH 2/2 " David Howells
2017-03-27 20:26 ` [PATCH 1/2 V2] xfs_io: move stat functions to new file David Howells
2017-03-27 20:32   ` Darrick J. Wong
2017-03-28 10:22 ` [PATCH] xfs_io: changes to statx interface David Howells
2017-03-28 10:51   ` Amir Goldstein
2017-03-28 12:31   ` David Howells
2017-03-28 13:34     ` Amir Goldstein
2017-03-28 14:04     ` David Howells
2017-03-28 18:01       ` Amir Goldstein
2017-03-28 14:38 ` [PATCH] xfs_io: changes to statx interface [ver #2] David Howells
2017-03-28 18:40   ` Andreas Dilger
2017-03-28 19:07     ` Amir Goldstein
2017-03-28 22:12       ` Eric Sandeen
2017-03-28 23:18   ` Dave Chinner
2017-03-29 15:24   ` David Howells
2017-03-28 14:41 ` David Howells
2017-03-28 16:42   ` Eric Sandeen
2017-03-28 17:35     ` Amir Goldstein
2017-03-28 20:36       ` Eric Sandeen
2017-03-28 17:56     ` David Howells
2017-03-28 18:11       ` Amir Goldstein
2017-03-29 15:49 ` [PATCH] xfs_io: changes to statx interface [ver #3] David Howells
2017-03-29 21:32   ` Eric Sandeen
2017-03-29 16:40 ` David Howells [this message]
2017-03-29 21:55 ` [PATCH] xfs_io: changes to statx interface [ver #4] David Howells

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=9334.1490805615@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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).