From patchwork Fri Feb 17 14:43:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9580013 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 8AE8F600F6 for ; Fri, 17 Feb 2017 14:45:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79874286F3 for ; Fri, 17 Feb 2017 14:45:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E69F286F5; Fri, 17 Feb 2017 14:45: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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 0128E286F3 for ; Fri, 17 Feb 2017 14:45:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934312AbdBQOpJ (ORCPT ); Fri, 17 Feb 2017 09:45:09 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36487 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934351AbdBQOoH (ORCPT ); Fri, 17 Feb 2017 09:44:07 -0500 Received: by mail-wm0-f66.google.com with SMTP id r18so2936480wmd.3 for ; Fri, 17 Feb 2017 06:44:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pzPhjVlr849nRxjpAJhJ/+th220EVXj9QelnIQSYfOY=; b=UArI8LwxtLa73SlyHJPwIXcua/3STdjGLnyzIVVy8LIthnVR1pUp8o1T6u1fVe9W+b iyke0qbkqnVcEwgINXpvBCQ8yKfKp5UqjYE750YldcFK0zqVgxEicLhEd0SY/QuqY8V6 k9kweBq2zsJpLAm7X6eRaJzy3X8K9rMe5Daa/G3C2Rz0AZ3W5w8xTPk9H/lbqWekiQez dTHHfDbcrRvJsdQcQZAFggq2on8WSiM2kYOpX6a6VfxXwOOKSAY+ksWnB6trvaC3l5VG tfXWyOBhOTOF7SLgLmRgJbfGfBAhvi/afMQ//OxRnTbjGZX2DjU7b0E8Nqrl4N/49Fxl viVQ== 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:in-reply-to :references; bh=pzPhjVlr849nRxjpAJhJ/+th220EVXj9QelnIQSYfOY=; b=r7PzCqgY5g1l5BFkweXa71c7tSLIdt/rgYhepsGhDeKuNJG+1rUVRCw/fZ8PVL4fsp qRQGO4WpGaBnu4njWaqGCZkOejpgwVoEMlEGAgVcN5+sEdhZEiI0/NNaqMnrK0rqXUDI H0LXMyCT/KcSSXWmPpbi8jKrZkfkOJ8YUzDfJhfMQ7vWRVLbvX4rErW7vZ+6PAcJ2ZzU JxXPtB/HHJVwsTUUeBRoALojh3+ylKoz/gHltQLZxduwhosni3kFVloboLaClHeirKFG zFwImUYmP4i+buzWGstTJbZc1w4+xAAKYcjxbp/MhyxNxrNGPyeFdYv6o6aqORp8BEql rXFQ== X-Gm-Message-State: AMke39lVDb9DXqoHf0wd0OiA0izNKX6WgTaVGzJftXOkxK+mH1/t4+ZUFQNKpl4nKcEBMw== X-Received: by 10.28.8.130 with SMTP id 124mr3767712wmi.65.1487342646348; Fri, 17 Feb 2017 06:44:06 -0800 (PST) Received: from fisk.suse.de (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id y126sm1932713wmg.19.2017.02.17.06.44.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Feb 2017 06:44:05 -0800 (PST) From: Nikolay Borisov X-Google-Original-From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov , Nikolay Borisov Subject: [PATCH 19/38] btrfs: Make btrfs_mark_extent_written take btrfs_inode Date: Fri, 17 Feb 2017 16:43:10 +0200 Message-Id: <1487342609-20652-20-git-send-email-nborisov@suse.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487342609-20652-1-git-send-email-nborisov@suse.com> References: <1487342609-20652-1-git-send-email-nborisov@suse.com> 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 From: Nikolay Borisov Signed-off-by: Nikolay Borisov --- fs/btrfs/ctree.h | 2 +- fs/btrfs/file.c | 8 ++++---- fs/btrfs/inode.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 4db18e5dc8f9..2bfc2e289f51 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3233,7 +3233,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct inode *inode, u64 start, u64 end, int drop_cache); int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, - struct inode *inode, u64 start, u64 end); + struct btrfs_inode *inode, u64 start, u64 end); int btrfs_release_file(struct inode *inode, struct file *file); int btrfs_dirty_pages(struct inode *inode, struct page **pages, size_t num_pages, loff_t pos, size_t write_bytes, diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index e37b643205e1..8e48094ae831 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1082,10 +1082,10 @@ static int extent_mergeable(struct extent_buffer *leaf, int slot, * two or three. */ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, - struct inode *inode, u64 start, u64 end) + struct btrfs_inode *inode, u64 start, u64 end) { - struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); - struct btrfs_root *root = BTRFS_I(inode)->root; + struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb); + struct btrfs_root *root = inode->root; struct extent_buffer *leaf; struct btrfs_path *path; struct btrfs_file_extent_item *fi; @@ -1102,7 +1102,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, int del_slot = 0; int recow; int ret; - u64 ino = btrfs_ino(BTRFS_I(inode)); + u64 ino = btrfs_ino(inode); path = btrfs_alloc_path(); if (!path) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 92e42a063639..ac134d75cd08 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2879,7 +2879,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent) compress_type = ordered_extent->compress_type; if (test_bit(BTRFS_ORDERED_PREALLOC, &ordered_extent->flags)) { BUG_ON(compress_type); - ret = btrfs_mark_extent_written(trans, inode, + ret = btrfs_mark_extent_written(trans, BTRFS_I(inode), ordered_extent->file_offset, ordered_extent->file_offset + logical_len);