From patchwork Wed Oct 7 01:05:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 11819515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62264139F for ; Wed, 7 Oct 2020 01:07:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0322C2078E for ; Wed, 7 Oct 2020 01:07:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="D3utdM2K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0322C2078E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C08246B0062; Tue, 6 Oct 2020 21:07:19 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B926D6B0068; Tue, 6 Oct 2020 21:07:19 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BB396B006C; Tue, 6 Oct 2020 21:07:19 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 6E7776B0062 for ; Tue, 6 Oct 2020 21:07:19 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 187A38249980 for ; Wed, 7 Oct 2020 01:07:19 +0000 (UTC) X-FDA: 77343340998.03.way18_350276a271cb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id E986728A4E8 for ; Wed, 7 Oct 2020 01:07:18 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,jglisse@redhat.com,,RULES_HIT:30054:30064:30070:30090,0,RBL:216.205.24.124:@redhat.com:.lbl8.mailshell.net-64.10.201.10 62.18.0.100;04y83poimtawwnuf6yiqp565zuokxocmkexfnr9nguf4o8dknzp3rxd3paputsq.p3gpoj5pcih4fe9xg74t3r515b9s9k4bzp9z4uz1aarfior7q1my3hgebgyh5fk.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:268,LUA_SUMMARY:none X-HE-Tag: way18_350276a271cb X-Filterd-Recvd-Size: 6568 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Wed, 7 Oct 2020 01:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602032837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X/41onueuJaBmlgLF2k54MrGEllrmeOjrbwZrRsLnD4=; b=D3utdM2Kemh+/VyFOGLYvQy2AOKIdq4idwdIWiGiViqYlIJrHs5A9BfE8IywKy+IG7XOZO +psDK2zOyCvf1RagIyIo1eRA2l3cROXpJyyXa3blZtIUA501MTFy4EMvJiWM69EGfxOjXE BQeTakfIpkWxWjzzV0sJPjodyLGtqdo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-GVpge7PTMHyeQWqL6v_Zgw-1; Tue, 06 Oct 2020 21:07:15 -0400 X-MC-Unique: GVpge7PTMHyeQWqL6v_Zgw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7D74310BBEC0; Wed, 7 Oct 2020 01:07:13 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-161.rdu2.redhat.com [10.10.119.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 645DC5D9D2; Wed, 7 Oct 2020 01:07:12 +0000 (UTC) From: jglisse@redhat.com To: linux-kernel@vger.kernel.org Cc: =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Alexander Viro , Tejun Heo , Jan Kara , Josef Bacik Subject: [PATCH 02/14] fs: define filler_t as a function pointer type Date: Tue, 6 Oct 2020 21:05:51 -0400 Message-Id: <20201007010603.3452458-3-jglisse@redhat.com> In-Reply-To: <20201007010603.3452458-1-jglisse@redhat.com> References: <20201007010603.3452458-1-jglisse@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Jérôme Glisse Coccinelle is confuse by filler_t not being a regular function pointer type. As they are no reason to define filler_t as a non pointer type redefine it as a function pointer type and update function prototype accordingly. Signed-off-by: Jérôme Glisse Cc: linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org Cc: Andrew Morton Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Cc: Tejun Heo Cc: Jan Kara Cc: Josef Bacik --- fs/nfs/dir.c | 2 +- fs/nfs/symlink.c | 4 ++-- include/linux/pagemap.h | 6 +++--- mm/filemap.c | 5 ++--- mm/readahead.c | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index cb52db9a0cfb7..da1fe71ae810d 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -740,7 +740,7 @@ static struct page *get_cache_page(nfs_readdir_descriptor_t *desc) { return read_cache_page(desc->file->f_mapping, desc->page_index, - nfs_readdir_filler, desc); + (filler_t)nfs_readdir_filler, desc); } /* diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c index 25ba299fdac2e..76691d94ae5f8 100644 --- a/fs/nfs/symlink.c +++ b/fs/nfs/symlink.c @@ -66,8 +66,8 @@ static const char *nfs_get_link(struct dentry *dentry, err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping)); if (err) return err; - page = read_cache_page(&inode->i_data, 0, nfs_symlink_filler, - inode); + page = read_cache_page(&inode->i_data, 0, + (filler_t)nfs_symlink_filler, inode); if (IS_ERR(page)) return ERR_CAST(page); } diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 7de11dcd534d6..9acfc605b3bc3 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -264,7 +264,7 @@ static inline gfp_t readahead_gfp_mask(struct address_space *x) return mapping_gfp_mask(x) | __GFP_NORETRY | __GFP_NOWARN; } -typedef int filler_t(void *, struct page *); +typedef int (*filler_t)(void *, struct page *); pgoff_t page_cache_next_miss(struct address_space *mapping, pgoff_t index, unsigned long max_scan); @@ -425,11 +425,11 @@ static inline struct page *grab_cache_page(struct address_space *mapping, } extern struct page * read_cache_page(struct address_space *mapping, - pgoff_t index, filler_t *filler, void *data); + pgoff_t index, filler_t filler, void *data); extern struct page * read_cache_page_gfp(struct address_space *mapping, pgoff_t index, gfp_t gfp_mask); extern int read_cache_pages(struct address_space *mapping, - struct list_head *pages, filler_t *filler, void *data); + struct list_head *pages, filler_t filler, void *data); static inline struct page *read_mapping_page(struct address_space *mapping, pgoff_t index, void *data) diff --git a/mm/filemap.c b/mm/filemap.c index 99c49eeae71b8..2cdbbffc55522 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2942,8 +2942,7 @@ static struct page *wait_on_page_read(struct page *page) } static struct page *do_read_cache_page(struct address_space *mapping, - pgoff_t index, - int (*filler)(void *, struct page *), + pgoff_t index, filler_t filler, void *data, gfp_t gfp) { @@ -3064,7 +3063,7 @@ static struct page *do_read_cache_page(struct address_space *mapping, */ struct page *read_cache_page(struct address_space *mapping, pgoff_t index, - int (*filler)(void *, struct page *), + filler_t filler, void *data) { return do_read_cache_page(mapping, index, filler, data, diff --git a/mm/readahead.c b/mm/readahead.c index 3c9a8dd7c56c8..cd67c9cfa931a 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -87,7 +87,7 @@ static void read_cache_pages_invalidate_pages(struct address_space *mapping, * Returns: %0 on success, error return by @filler otherwise */ int read_cache_pages(struct address_space *mapping, struct list_head *pages, - int (*filler)(void *, struct page *), void *data) + filler_t filler, void *data) { struct page *page; int ret = 0;