lkml.org 
[lkml]   [2020]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[RFC PATCH 75/76] afs: Make afs_write_begin() return the THP subpage
    From
    Date
    generic_perform_write() can't handle a THP, so we have to return the
    subpage of that THP from afs_write_begin() and then convert it back into
    the head on entry to afs_write_end().

    Signed-off-by: David Howells <dhowells@redhat.com>
    ---

    fs/afs/write.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/fs/afs/write.c b/fs/afs/write.c
    index bab110c00abd..a88c6ae71868 100644
    --- a/fs/afs/write.c
    +++ b/fs/afs/write.c
    @@ -81,7 +81,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
    goto flush_conflicting_write;
    }

    - *_page = page;
    + *_page = find_subpage(page, pos / PAGE_SIZE);
    _leave(" = 0");
    return 0;

    @@ -110,9 +110,10 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
    */
    int afs_write_end(struct file *file, struct address_space *mapping,
    loff_t pos, unsigned len, unsigned copied,
    - struct page *page, void *fsdata)
    + struct page *subpage, void *fsdata)
    {
    struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
    + struct page *page = thp_head(subpage);
    unsigned long priv;
    unsigned int f, from = pos & (thp_size(page) - 1);
    unsigned int t, to = from + copied;

    \
     
     \ /
      Last update: 2020-11-20 16:21    [W:4.458 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site