All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/4] xfs: merge xfs_reflink_remap_range and xfs_file_share_range
Date: Tue, 18 Oct 2016 07:17:58 +0200	[thread overview]
Message-ID: <20161018051758.GA2184@lst.de> (raw)
In-Reply-To: <20161017212933.GE26485@birch.djwong.org>

On Mon, Oct 17, 2016 at 02:29:33PM -0700, Darrick J. Wong wrote:
> > +	bs = inode->i_sb->s_blocksize;
> > +	inode_dio_wait(inode);
> > +
> > +	rounding = max_t(xfs_off_t, bs, PAGE_SIZE);
> > +	ioffset = round_down(offset, rounding);
> > +	iendoffset = round_up(offset + len, rounding) - 1;
> > +	ret = filemap_write_and_wait_range(inode->i_mapping, ioffset,
> > +					   iendoffset);
> > +	return ret;
> > +}
> 
> This seems like a file action not specific to reflink.

But it's only used by the reflink code :)

That being said given that filemap_write_and_wait_range operates
on pages there is no need for the rounding anyway, and we could
just replace it with open coded calls to inode_dio_wait and
filemap_write_and_wait_range.  Maybe I should do that before
this patch so we don't have to bother moving it.

> > +xfs_file_share_range(
> 
> xfs_reflink_share_file_range() ?
> 
> I'd like to maintain the convention that all reflink functions
> start with xfs_reflink_*, particularly since the xfs_file_* functions
> largely live in xfs_file.c.

Ok, fine.

> > +	if (is_dedupe) {
> > +		bool		is_same = false;
> > +
> > +		ret = xfs_compare_extents(inode_in, pos_in, inode_out, pos_out,
> > +				len, &is_same);
> > +		if (ret)
> > +			goto out_unlock;;
> 
> Double-semicolon here.

I'll fix it.

  reply	other threads:[~2016-10-18  5:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 12:05 fix locking for the reflink operation Christoph Hellwig
2016-10-17 12:05 ` [PATCH 1/4] xfs: remove the same fs check from xfs_file_share_range Christoph Hellwig
2016-10-17 21:11   ` Darrick J. Wong
2016-10-17 12:05 ` [PATCH 2/4] xfs: fix the same_inode check in xfs_file_share_range Christoph Hellwig
2016-10-17 21:12   ` Darrick J. Wong
2016-10-17 12:05 ` [PATCH 3/4] xfs: move inode locking from xfs_reflink_remap_range to xfs_file_share_range Christoph Hellwig
2016-10-17 21:16   ` Darrick J. Wong
2016-10-17 12:05 ` [PATCH 4/4] xfs: merge xfs_reflink_remap_range and xfs_file_share_range Christoph Hellwig
2016-10-17 21:29   ` Darrick J. Wong
2016-10-18  5:17     ` Christoph Hellwig [this message]
2016-10-17 21:35 ` fix locking for the reflink operation 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=20161018051758.GA2184@lst.de \
    --to=hch@lst.de \
    --cc=darrick.wong@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.