From patchwork Fri Mar 2 02:09:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10253151 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 1D2EC60291 for ; Fri, 2 Mar 2018 02:10:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D10E28861 for ; Fri, 2 Mar 2018 02:10:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01DF428863; Fri, 2 Mar 2018 02:10:17 +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.9 required=2.0 tests=BAYES_00,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 9E11C28861 for ; Fri, 2 Mar 2018 02:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163659AbeCBCKF (ORCPT ); Thu, 1 Mar 2018 21:10:05 -0500 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:59311 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163333AbeCBCKE (ORCPT ); Thu, 1 Mar 2018 21:10:04 -0500 Received: from adam-pc.lan (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Thu, 01 Mar 2018 19:09:52 -0700 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 2/3] btrfs: Unify inline extent creation condition for plain and compressed data Date: Fri, 2 Mar 2018 10:09:47 +0800 Message-Id: <20180302020948.24816-2-wqu@suse.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180302020948.24816-1-wqu@suse.com> References: <20180302020948.24816-1-wqu@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 cow_file_range_inline() used different condition for plain and compressed data. For compressed data, it's allowed to have inline extent equal to sectorsize, while for plain data, it's not allowed to have inline extent equal to sectorsize. But since we limit BTRFS_MAX_INLINE_DATA_SIZE() to (sectorsize - 1), there is no such difference any long, just remove the extra check. Signed-off-by: Qu Wenruo --- fs/btrfs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 0f7041e10c67..8c5e69bdbfb5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -299,8 +299,6 @@ static noinline int cow_file_range_inline(struct btrfs_root *root, if (start > 0 || actual_end > fs_info->sectorsize || - (!compressed_size && - (actual_end & (fs_info->sectorsize - 1)) == 0) || end + 1 < isize || data_len > fs_info->max_inline) { return 1;