[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OSBPR01MB2920FA6E33A264133D7908FDF49D9@OSBPR01MB2920.jpnprd01.prod.outlook.com>
Date: Fri, 26 Feb 2021 08:11:08 +0000
From: "ruansy.fnst@...itsu.com" <ruansy.fnst@...itsu.com>
To: "Darrick J. Wong" <djwong@...nel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"darrick.wong@...cle.com" <darrick.wong@...cle.com>,
"willy@...radead.org" <willy@...radead.org>,
"jack@...e.cz" <jack@...e.cz>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
"ocfs2-devel@....oracle.com" <ocfs2-devel@....oracle.com>,
"david@...morbit.com" <david@...morbit.com>,
"hch@....de" <hch@....de>, "rgoldwyn@...e.de" <rgoldwyn@...e.de>
Subject: Re: [PATCH v2 07/10] iomap: Introduce iomap_apply2() for operations
on two files
> On Fri, Feb 26, 2021 at 08:20:27AM +0800, Shiyang Ruan wrote:
> > Some operations, such as comparing a range of data in two files under
> > fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus,
> > we introduce iomap_apply2() to accept arguments from two files and
> > iomap_actor2_t for actions on two files.
> >
> > Signed-off-by: Shiyang Ruan <ruansy.fnst@...itsu.com>
> > ---
> > fs/iomap/apply.c | 51 +++++++++++++++++++++++++++++++++++++++++++
> > include/linux/iomap.h | 7 +++++-
> > 2 files changed, 57 insertions(+), 1 deletion(-)
> >
...
> > + ret = ops->iomap_begin(ino2, pos2, length, 0, &dmap, NULL);
> > + if (ret)
> > + goto out_dest;
> > + if (WARN_ON(dmap.offset > pos2)) {
> > + written = -EIO;
> > + goto out_dest;
> > + }
> > + if (WARN_ON(dmap.length == 0)) {
> > + written = -EIO;
> > + goto out_dest;
> > + }
> > +
> > + /* make sure extent length of two file is equal */
> > + if (WARN_ON(smap.length != dmap.length)) {
>
> Why not set smap.length and dmap.length to min(smap.length, dmap.length) ?
>
You are right. I found that I understood it wrong. My bad.
I'll fix this patch and the next one which call this function.
--
Thanks,
Ruan Shiyang.
> --D
>
Powered by blists - more mailing lists