From patchwork Wed Sep 12 12:25:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 10597421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3B81920 for ; Wed, 12 Sep 2018 12:26:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3D6129D26 for ; Wed, 12 Sep 2018 12:26:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7F9C29D44; Wed, 12 Sep 2018 12:26:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92BE329D26 for ; Wed, 12 Sep 2018 12:26:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726839AbeILRaS (ORCPT ); Wed, 12 Sep 2018 13:30:18 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44534 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726491AbeILRaS (ORCPT ); Wed, 12 Sep 2018 13:30:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B380E9000; Wed, 12 Sep 2018 12:26:00 +0000 (UTC) Received: from odin.brq.redhat.com (unknown [10.43.17.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C42A2166BA3; Wed, 12 Sep 2018 12:25:59 +0000 (UTC) From: Carlos Maiolino To: linux-fsdevel@vger.kernel.org Cc: hch@lst.de, sandeen@redhat.com, david@fromorbit.com Subject: [PATCH 3/3] ecryptfs: drop direct calls to ->bmap Date: Wed, 12 Sep 2018 14:25:36 +0200 Message-Id: <20180912122536.31977-4-cmaiolino@redhat.com> In-Reply-To: <20180912122536.31977-1-cmaiolino@redhat.com> References: <20180912122536.31977-1-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 12 Sep 2018 12:26:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 12 Sep 2018 12:26:00 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cmaiolino@redhat.com' RCPT:'' Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace direct ->bmap calls by bmap() method. Signed-off-by: Carlos Maiolino --- fs/ecryptfs/mmap.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index cdf358b209d9..256721eb6a03 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c @@ -538,16 +538,17 @@ static int ecryptfs_write_end(struct file *file, static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block) { - int rc = 0; + sector_t blk_map = 0; + int ret; struct inode *inode; struct inode *lower_inode; inode = (struct inode *)mapping->host; lower_inode = ecryptfs_inode_to_lower(inode); - if (lower_inode->i_mapping->a_ops->bmap) - rc = lower_inode->i_mapping->a_ops->bmap(lower_inode->i_mapping, - block); - return rc; + + ret = bmap(lower_inode, &blk_map); + + return !ret ? blk_map : 0; } const struct address_space_operations ecryptfs_aops = {