From patchwork Sun Mar 26 03:21:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9644939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 02BA4601D7 for ; Sun, 26 Mar 2017 03:23:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9CBC1FFD6 for ; Sun, 26 Mar 2017 03:23:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE6F128178; Sun, 26 Mar 2017 03:23:56 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 D75271FFD6 for ; Sun, 26 Mar 2017 03:23:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751258AbdCZDXw (ORCPT ); Sat, 25 Mar 2017 23:23:52 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36027 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751252AbdCZDXv (ORCPT ); Sat, 25 Mar 2017 23:23:51 -0400 Received: by mail-pf0-f196.google.com with SMTP id r137so4126924pfr.3 for ; Sat, 25 Mar 2017 20:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=naKHFzUpxQJGnq6HnLa51v5+dHPnloahqglCLV7fjnQ=; b=DzXd0/DkpFrBrIzxH847W70pG+UWGJ8WX+u7cIc4t42A+N7wgSeICCr5IY9FZpLM9J SixF9aCCry1U3vAMFCMdQQPN5tAjoI6GUzq/KA9zojtDpw9cxHxVLA2lOjUmVDfgTDG4 d+zQzMbhPUR9XOX0T5gB7ZO1aq2i0ZcEFJKqaleWoL03a9wnypJdQ4u6WfxhC0HNYTAA Sh7pxaIiffgiRtl3rZ4JGnH2GDdc0mYk58werHn6NZzshfBIkst3ZpAOSaB1UAkKUkl+ pHXRSZXYXYdx/PHm3Y8nPjo1jeZEGh+jVsPBOUVqWHMNVPfnaakmhBNwUdMAFn/DufnO 7vNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=naKHFzUpxQJGnq6HnLa51v5+dHPnloahqglCLV7fjnQ=; b=aEwNdKPFaHjLxFlGQB7BSS9GfCz4MS5TrHkC2GSvGeJpOxE1x0wHFh0XKxvdSk8nda nInWMt6y5M5y8nLy1zDynhsd0vbtq3YhafTAd5MJXdoJny48xelliWoMlNwVTA/WIZn5 FGuRicM0C2U/bzvaFDBGB9y6cbZn9yIkzwWeOeuMewnJFRGtNkQ4Nzg+a2kKaR7M8wHA Z1l0UZLAoNGzx7Ya3lcXiP0T63QB6iaOg4bbQ9E5Z6Z0BsFrLTKwNqGkCRnBR8HkSfCF jJ+LIj8hrOVgM/cETRqlUJrw0EPizJl/jEBX7xGxsSlAR2ER0rfWF6JwiVuKOTxATf4O Kvjw== X-Gm-Message-State: AFeK/H1NfomlsTZlbXvoPjo2ctllaGv+BnMyZH8tfRVbGgU/J1jgMe+moPb2seofZ2e0sQ== X-Received: by 10.99.150.1 with SMTP id c1mr17487969pge.160.1490498579598; Sat, 25 Mar 2017 20:22:59 -0700 (PDT) Received: from zzz.hsd1.wa.comcast.net (c-73-239-167-150.hsd1.wa.comcast.net. [73.239.167.150]) by smtp.gmail.com with ESMTPSA id s87sm12923180pfa.29.2017.03.25.20.22.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Mar 2017 20:22:58 -0700 (PDT) From: Eric Biggers To: linux-fsdevel@vger.kernel.org Cc: Alexander Viro , Eric Biggers Subject: [PATCH] fs/open.c: use ->f_mapping instead of ->f_mapping->host->i_mapping Date: Sat, 25 Mar 2017 20:21:28 -0700 Message-Id: <20170326032128.32721-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.12.1 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 From: Eric Biggers In do_dentry_open(), initialize the readahead state using ->f_mapping instead of ->f_mapping->host->i_mapping. This is equivalent, even for block device files; we don't need the extra indirection because ->f_mapping already represents the data read/written by the file (which for block device nodes is the underlying block device mapping). Signed-off-by: Eric Biggers Reviewed-by: Jeff Layton --- fs/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/open.c b/fs/open.c index 949cef29c3bb..32e19fda24d2 100644 --- a/fs/open.c +++ b/fs/open.c @@ -763,7 +763,7 @@ static int do_dentry_open(struct file *f, f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC); - file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping); + file_ra_state_init(&f->f_ra, f->f_mapping); return 0;