Re: [PATCH 15/21] iomap: Convert iomap_write_begin and iomap_write_end to folios

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

 



On Tue, Nov 02, 2021 at 04:22:15PM -0700, Darrick J. Wong wrote:
> > +	page = folio_file_page(folio, pos >> PAGE_SHIFT);
> 
> Isn't this only needed in the BUFFER_HEAD case?

Good catch.  Want me to fold this in?

+++ b/fs/iomap/buffered-io.c
@@ -608,7 +608,6 @@ static int iomap_write_begin(const struct iomap_iter *iter,
loff_t pos,
        const struct iomap_page_ops *page_ops = iter->iomap.page_ops;
        const struct iomap *srcmap = iomap_iter_srcmap(iter);
        struct folio *folio;
-       struct page *page;
        unsigned fgp = FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE | FGP_NOFS;
        int status = 0;

@@ -632,12 +631,12 @@ static int iomap_write_begin(const struct iomap_iter *iter, loff_t pos,
                goto out_no_page;
        }
 
-       page = folio_file_page(folio, pos >> PAGE_SHIFT);
        if (srcmap->type == IOMAP_INLINE)
                status = iomap_write_begin_inline(iter, folio);
-       else if (srcmap->flags & IOMAP_F_BUFFER_HEAD)
+       else if (srcmap->flags & IOMAP_F_BUFFER_HEAD) {
+               struct page *page = folio_file_page(folio, pos >> PAGE_SHIFT);
                status = __block_write_begin_int(page, pos, len, NULL, srcmap);
-       else
+       } else
                status = __iomap_write_begin(iter, pos, len, folio);
 
        if (unlikely(status))




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

  Powered by Linux