From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0B80C10F01 for ; Mon, 18 Feb 2019 13:03:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8CDD5217F5 for ; Mon, 18 Feb 2019 13:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730668AbfBRNDq (ORCPT ); Mon, 18 Feb 2019 08:03:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58738 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbfBRNDq (ORCPT ); Mon, 18 Feb 2019 08:03:46 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D8E66698A; Mon, 18 Feb 2019 13:03:46 +0000 (UTC) Received: from hades.usersys.redhat.com (unknown [10.40.205.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45D1B6013D; Mon, 18 Feb 2019 13:03:45 +0000 (UTC) From: Carlos Maiolino To: linux-fsdevel@vger.kernel.org Cc: hch@lst.de, darrick.wong@oracle.com, adilger@dilger.ca Subject: [PATCH 3/9] ecryptfs: drop direct calls to ->bmap Date: Mon, 18 Feb 2019 14:03:25 +0100 Message-Id: <20190218130331.15882-4-cmaiolino@redhat.com> In-Reply-To: <20190218130331.15882-1-cmaiolino@redhat.com> References: <20190218130331.15882-1-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 18 Feb 2019 13:03:46 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Replace direct ->bmap calls by bmap() method. Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino --- fs/ecryptfs/mmap.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index cdf358b209d9..ff323dccef36 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c @@ -538,16 +538,12 @@ static int ecryptfs_write_end(struct file *file, static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block) { - int rc = 0; - 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; + struct inode *lower_inode = ecryptfs_inode_to_lower(mapping->host); + int ret = bmap(lower_inode, &block); + + if (ret) + return 0; + return block; } const struct address_space_operations ecryptfs_aops = { -- 2.17.2