From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@infradead.org>,
mfasheh@versity.com, xfs <linux-xfs@vger.kernel.org>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] duperemove: test presence of dedupe ioctl
Date: Wed, 14 Dec 2016 11:26:07 -0800 [thread overview]
Message-ID: <20161214192607.GA2280@infradead.org> (raw)
In-Reply-To: <20161214183845.GA5357@birch.djwong.org>
On Wed, Dec 14, 2016 at 10:38:45AM -0800, Darrick J. Wong wrote:
> > > +struct fake_btrfs_ioctl_same_args {
> > > + struct btrfs_ioctl_same_args args;
> > > + struct btrfs_ioctl_same_extent_info info;
> > > +};
> >
> > Why does this need a fake structure here?
>
> In order to test the ioctl we have to fill out at least one
> btrfs_ioctl_same_extent_info so that we get far enough into the fs-specific
> dedupe_range handler that we've verified that the fs is capable of dedupe and
> that the fs is willing to try to satisfy the request.
Oh, got it, it's just the fake that tripped me up.
> We could just malloc sizeof(_same_args) + sizeof(_same_extent_info)...
Either that, or more simply just don't give the structure a name
by just declaring it locally on the stack:
struct {
struct btrfs_ioctl_same_args args;
struct btrfs_ioctl_same_extent_info info;
} sa = { 0 };
next prev parent reply other threads:[~2016-12-14 19:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-09 17:56 [PATCH] duperemove: test presence of dedupe ioctl Darrick J. Wong
2016-12-14 10:44 ` Christoph Hellwig
2016-12-14 18:38 ` Darrick J. Wong
2016-12-14 19:26 ` Christoph Hellwig [this message]
2016-12-16 1:20 ` Darrick J. Wong
2016-12-16 7:53 ` Christoph Hellwig
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=20161214192607.GA2280@infradead.org \
--to=hch@infradead.org \
--cc=darrick.wong@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mfasheh@versity.com \
/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).