Re: [PATCH v2 07/10] iomap: Introduce iomap_apply2() for operations on two files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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@xxxxxxxxxxx>
> > ---
> >  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
> 




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux