lkml.org 
[lkml]   [2021]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 07/10] iomap: Introduce iomap_apply2() for operations on two files
Date
> 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@fujitsu.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
>
\
 
 \ /
  Last update: 2021-02-26 09:22    [W:0.099 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site