Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp523832pxf; Wed, 10 Mar 2021 10:57:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWLY/bd+bBDkqcE5DN5/RCXaVhg60d7TwPfSlrdqVqYSy4Ey4HcuircB3XGrrQ38iklctn X-Received: by 2002:a05:6402:3047:: with SMTP id bu7mr4890820edb.227.1615402658174; Wed, 10 Mar 2021 10:57:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615402658; cv=none; d=google.com; s=arc-20160816; b=aWyb2hCR1k7+pj64SYBt+O+nLZgLBKqVQz6gClpq0LeV3qS/bsKk75jNQdO0TD5/ru 7iiUv/JD5eTiAvQK+prp9sOn3M+LoJbkWD5QsPnAKjPxCrK+bWuy3FpaNC+hiihEHVV3 UDbrU3Gk44kEqod1WvoeW2IBvbxyjk120DTWjtUQccooipFGjcKLiVx+kQKARbROltJF rAIqyhCU4U+yx7UzrkxNP8OdW/AQoSO67WBpiQgAZ1p9flUfnz0wL/bOMNkD1+jDnw9r j1lM/uVe6E6jRHlwu7kOyhACUACUzDoZOdQH2/8fdkFSNlyNbcUP21hDrhaZbCb1TQiG m5jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xPa0e9GY36MTdUnU4Us/o0bHjoJTlPS3WAbT34ElMIs=; b=cvza4dpvdHlAL8Ar/BH1ClrnGPayDjSJ7Z1KtkuZjJIPkzAzoEfc1SnHi69bG+gOTq jCSn2WolIGdR6dByVNFvDfDvAuecdFrPD6TQUX/ixzxQbrKT6D+DmvGeL5q0LHugQBwu 8QAZizfzqmnTH4WTeE2bZuUSiGMZDepKbBVNBmx0Axef7smZmTdWatO2t7PG2Q/ZgC8u bwuyAw4Jk4KU0i0OUeD3T4nCbwAbdHegO3o7RBPMLsuFdnWKEDXHdgmxpV4td2jkpP58 g0j36t1fAEhYlEShgY+1MpkJgltMcYQ3GiVhE47TNh1f6ZF9DXUWhqkMEpMByFF5rcGS bSsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IJmYRV4h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si129926ejy.135.2021.03.10.10.57.15; Wed, 10 Mar 2021 10:57:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IJmYRV4h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233643AbhCJSzn (ORCPT + 99 others); Wed, 10 Mar 2021 13:55:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233532AbhCJSzi (ORCPT ); Wed, 10 Mar 2021 13:55:38 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C31BDC061760; Wed, 10 Mar 2021 10:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=xPa0e9GY36MTdUnU4Us/o0bHjoJTlPS3WAbT34ElMIs=; b=IJmYRV4hZ3EEw0NVPp8cuKjNph RppQyGXpVETCuFn+gF9WObaqrL0avriNNB7MqxPayCpLStu3oKdyxypqQUIYVqzuiSUzz4EepXd2V +nh0a+RgbHK/rQuwlYvoe++yt7qkY/kyltg9MTGpfUmBHDlN/VWPVYA532UhHeFtsncYqjO6U9V4o 8X/uSUFjh5IHf8PcBV8ld1L7z9WswWS7jyAigLv4+z2NxZI5EExPrE1auakhoruBj/W4uibXdv9Yi lVuJtGPWNLHqGnhlao9L9ROybrWXETuKs6brYE9PNEQuddzZYNIaa+GanlRS6SYmD5SrVHzISv4Yt c8E4LuYA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lK3zX-004Q1q-Qh; Wed, 10 Mar 2021 18:55:33 +0000 From: "Matthew Wilcox (Oracle)" To: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, Daniel Vetter , Ian Campbell , Jaya Kumar , Jani Nikula , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , William Kucharski Subject: [PATCH v2] fb_defio: Remove custom address_space_operations Date: Wed, 10 Mar 2021 18:55:30 +0000 Message-Id: <20210310185530.1053320-1-willy@infradead.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There's no need to give the page an address_space. Leaving the page->mapping as NULL will cause the VM to handle set_page_dirty() the same way that it's handled now, and that was the only reason to set the address_space in the first place. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- v2: Delete local variable definitions drivers/video/fbdev/core/fb_defio.c | 35 ----------------------------- drivers/video/fbdev/core/fbmem.c | 4 ---- include/linux/fb.h | 3 --- 3 files changed, 42 deletions(-) diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c index a591d291b231..b292887a2481 100644 --- a/drivers/video/fbdev/core/fb_defio.c +++ b/drivers/video/fbdev/core/fb_defio.c @@ -52,13 +52,6 @@ static vm_fault_t fb_deferred_io_fault(struct vm_fault *vmf) return VM_FAULT_SIGBUS; get_page(page); - - if (vmf->vma->vm_file) - page->mapping = vmf->vma->vm_file->f_mapping; - else - printk(KERN_ERR "no mapping available\n"); - - BUG_ON(!page->mapping); page->index = vmf->pgoff; vmf->page = page; @@ -151,17 +144,6 @@ static const struct vm_operations_struct fb_deferred_io_vm_ops = { .page_mkwrite = fb_deferred_io_mkwrite, }; -static int fb_deferred_io_set_page_dirty(struct page *page) -{ - if (!PageDirty(page)) - SetPageDirty(page); - return 0; -} - -static const struct address_space_operations fb_deferred_io_aops = { - .set_page_dirty = fb_deferred_io_set_page_dirty, -}; - int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) { vma->vm_ops = &fb_deferred_io_vm_ops; @@ -212,29 +194,12 @@ void fb_deferred_io_init(struct fb_info *info) } EXPORT_SYMBOL_GPL(fb_deferred_io_init); -void fb_deferred_io_open(struct fb_info *info, - struct inode *inode, - struct file *file) -{ - file->f_mapping->a_ops = &fb_deferred_io_aops; -} -EXPORT_SYMBOL_GPL(fb_deferred_io_open); - void fb_deferred_io_cleanup(struct fb_info *info) { struct fb_deferred_io *fbdefio = info->fbdefio; - struct page *page; - int i; BUG_ON(!fbdefio); cancel_delayed_work_sync(&info->deferred_work); - - /* clear out the mapping that we setup */ - for (i = 0 ; i < info->fix.smem_len; i += PAGE_SIZE) { - page = fb_deferred_io_page(info, i); - page->mapping = NULL; - } - mutex_destroy(&fbdefio->lock); } EXPORT_SYMBOL_GPL(fb_deferred_io_cleanup); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 06f5805de2de..372b52a2befa 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1415,10 +1415,6 @@ __releases(&info->lock) if (res) module_put(info->fbops->owner); } -#ifdef CONFIG_FB_DEFERRED_IO - if (info->fbdefio) - fb_deferred_io_open(info, inode, file); -#endif out: unlock_fb_info(info); if (res) diff --git a/include/linux/fb.h b/include/linux/fb.h index ecfbcc0553a5..a8dccd23c249 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -659,9 +659,6 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, /* drivers/video/fb_defio.c */ int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma); extern void fb_deferred_io_init(struct fb_info *info); -extern void fb_deferred_io_open(struct fb_info *info, - struct inode *inode, - struct file *file); extern void fb_deferred_io_cleanup(struct fb_info *info); extern int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync); -- 2.30.0