From patchwork Tue May 8 18:04:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Fasheh X-Patchwork-Id: 10386943 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 BDA54602C2 for ; Tue, 8 May 2018 18:12:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 867D1291E0 for ; Tue, 8 May 2018 18:12:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72113291B5; Tue, 8 May 2018 18:12:11 +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 22F58296D9 for ; Tue, 8 May 2018 18:11:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933131AbeEHSKs (ORCPT ); Tue, 8 May 2018 14:10:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:54278 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932849AbeEHSGV (ORCPT ); Tue, 8 May 2018 14:06:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BF455AE08; Tue, 8 May 2018 18:06:19 +0000 (UTC) From: Mark Fasheh To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, Mark Fasheh Subject: [PATCH 64/76] fs/read: Use inode_sb() helper instead of inode->i_sb Date: Tue, 8 May 2018 11:04:24 -0700 Message-Id: <20180508180436.716-65-mfasheh@suse.de> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180508180436.716-1-mfasheh@suse.de> References: <20180508180436.716-1-mfasheh@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Mark Fasheh --- fs/read_write.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index f8547b82dfb3..cf9900707558 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -146,7 +146,7 @@ loff_t generic_file_llseek(struct file *file, loff_t offset, int whence) struct inode *inode = file->f_mapping->host; return generic_file_llseek_size(file, offset, whence, - inode->i_sb->s_maxbytes, + inode_sb(inode)->s_maxbytes, i_size_read(inode)); } EXPORT_SYMBOL(generic_file_llseek); @@ -1389,7 +1389,8 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, goto fput_out; if (!max) - max = min(in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes); + max = min(inode_sb(in_inode)->s_maxbytes, + inode_sb(out_inode)->s_maxbytes); if (unlikely(pos + count > max)) { retval = -EOVERFLOW; @@ -1549,7 +1550,7 @@ ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in, return -EBADF; /* this could be relaxed once a method supports cross-fs copies */ - if (inode_in->i_sb != inode_out->i_sb) + if (inode_sb(inode_in) != inode_sb(inode_out)) return -EXDEV; if (len == 0) @@ -1694,7 +1695,7 @@ int vfs_clone_file_prep_inodes(struct inode *inode_in, loff_t pos_in, struct inode *inode_out, loff_t pos_out, u64 *len, bool is_dedupe) { - loff_t bs = inode_out->i_sb->s_blocksize; + loff_t bs = inode_sb(inode_out)->s_blocksize; loff_t blen; loff_t isize; bool same_inode = (inode_in == inode_out); @@ -1808,7 +1809,7 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in, * the same mount. Practically, they only need to be on the same file * system. */ - if (inode_in->i_sb != inode_out->i_sb) + if (inode_sb(inode_in) != inode_sb(inode_out)) return -EXDEV; if (!(file_in->f_mode & FMODE_READ) ||