From patchwork Fri Nov 29 09:38:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 11266801 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F617139A for ; Fri, 29 Nov 2019 09:38:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 075B421774 for ; Fri, 29 Nov 2019 09:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbfK2JiK (ORCPT ); Fri, 29 Nov 2019 04:38:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:46974 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725892AbfK2JiK (ORCPT ); Fri, 29 Nov 2019 04:38:10 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 88EF8ACA5; Fri, 29 Nov 2019 09:38:09 +0000 (UTC) From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH] btrfs: Simplify len alignment calculation Date: Fri, 29 Nov 2019 11:38:07 +0200 Message-Id: <20191129093807.525-1-nborisov@suse.com> X-Mailer: git-send-email 2.17.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Use ALIGN() directly rather than achieving the same thing in a roundabout way. No semantic changes. Signed-off-by: Nikolay Borisov --- fs/btrfs/delalloc-space.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/fs/btrfs/delalloc-space.c b/fs/btrfs/delalloc-space.c index 4cdac4d834f5..c08e905b0424 100644 --- a/fs/btrfs/delalloc-space.c +++ b/fs/btrfs/delalloc-space.c @@ -142,8 +142,7 @@ int btrfs_check_data_free_space(struct inode *inode, int ret; /* align the range */ - len = round_up(start + len, fs_info->sectorsize) - - round_down(start, fs_info->sectorsize); + len = ALIGN(len, fs_info->sectorsize); start = round_down(start, fs_info->sectorsize); ret = btrfs_alloc_data_chunk_ondemand(BTRFS_I(inode), len);