From patchwork Thu May 24 21:41:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10425595 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 F1C1C6019D for ; Thu, 24 May 2018 21:42:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1FA729574 for ; Thu, 24 May 2018 21:42:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6AB3295BC; Thu, 24 May 2018 21:42:28 +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,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 78B8A29574 for ; Thu, 24 May 2018 21:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S971651AbeEXVmA (ORCPT ); Thu, 24 May 2018 17:42:00 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:42680 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S971635AbeEXVlp (ORCPT ); Thu, 24 May 2018 17:41:45 -0400 Received: by mail-pg0-f68.google.com with SMTP id p9-v6so1346447pgc.9 for ; Thu, 24 May 2018 14:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=vgzdKXBYG19VaFLcQTw6SC/Tl9V9w+UpcujDZUzQg+s=; b=WIACQgXKkfxZ3fs3jAANKq04DFXek3yUC5GMxIPt+QrKNuqAnJ+CRvdYRQuyy0xWRs N4YayMtGglVwFW9d18lP0S74OiSKekMRVtAnR5j6D8SyGZSXK2++Mzf/7ydulz78/ZBw Uji5wK4qTFfyrjM1V3ZBa4PbhbuyjxONtenVe9edoTfi7SOKHL3qBZ7oFZ0I2X/SvfDe lsUh2JLphrODHQIb29CRM+HvgsRt/dvcVlTcazJu7YsooT3NjsSlno63S5y0s14MVtSw ybvHF8u2WCf423iJSw/yxPSdu9oZBrrrxO3g1DDISDmr7ysNiUXFweFZVL3Jb5NuscUq OTHA== 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:in-reply-to:references; bh=vgzdKXBYG19VaFLcQTw6SC/Tl9V9w+UpcujDZUzQg+s=; b=eCLo2UsT5PToB9lJI9eccjXyVC0ybOnqOH5O5sTeJkU6nWFiCeTueH1Ia7pojwMF3Y Pm998LYbmz2Pw2qmemWcQ/pVhlfxTBENwfuP5n5NiYym927FLXwCMdrHZCRbxSPwbbBX mcw+7s/kkSiAQtFXH9PB4UmwKKbzUvUfqmpirzCp/pIgRLn6YSQ2v3xzcLJSfEpQT6mv 2Bmb7OMDQEfE+j4DWQF0NFKa8FkH/YbXif1X8u7XxnT3dH0oMKTs//EvgnKUb6/jaYUO /flSf2+HCdBmEf05vJRdqRLlteU0VyoyPPqPlXrXjCy4UyVW/2HzgrYldo9I9Mmt0T+w sCgg== X-Gm-Message-State: ALKqPwcF6pHjmFNjVakrqejOBqoi+hA7yVGXCd67GkMnXkeaI+p0U+hQ KYpkRmMPvt70huz7nKfIgkMqRA== X-Google-Smtp-Source: AB8JxZoGu1gaP2kr4cnztF3vFI1/b21t6PiyOUis7YnR0lEumiKDoooZ9HEDxHPDnVdj1WBcKHKskA== X-Received: by 2002:a62:62c2:: with SMTP id w185-v6mr8985241pfb.78.1527198104757; Thu, 24 May 2018 14:41:44 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::6:a0b5]) by smtp.gmail.com with ESMTPSA id g68-v6sm37388994pfk.53.2018.05.24.14.41.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 14:41:44 -0700 (PDT) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: kernel-team@fb.com, linux-fsdevel@vger.kernel.org, Tejun Heo Subject: [RFC PATCH v4 5/6] Btrfs: rename get_chunk_map() and make it non-static Date: Thu, 24 May 2018 14:41:29 -0700 Message-Id: X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: 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: Omar Sandoval The Btrfs swap code is going to need it, so give it a btrfs_ prefix and make it non-static. Signed-off-by: Omar Sandoval Reviewed-by: Nikolay Borisov --- fs/btrfs/volumes.c | 22 +++++++++++----------- fs/btrfs/volumes.h | 2 ++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 33b3d329ebb9..6e1a89c6b362 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2789,8 +2789,8 @@ static int btrfs_del_sys_chunk(struct btrfs_fs_info *fs_info, u64 chunk_offset) return ret; } -static struct extent_map *get_chunk_map(struct btrfs_fs_info *fs_info, - u64 logical, u64 length) +struct extent_map *btrfs_get_chunk_map(struct btrfs_fs_info *fs_info, + u64 logical, u64 length) { struct extent_map_tree *em_tree; struct extent_map *em; @@ -2827,7 +2827,7 @@ int btrfs_remove_chunk(struct btrfs_trans_handle *trans, int i, ret = 0; struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; - em = get_chunk_map(fs_info, chunk_offset, 1); + em = btrfs_get_chunk_map(fs_info, chunk_offset, 1); if (IS_ERR(em)) { /* * This is a logic error, but we don't want to just rely on the @@ -4962,7 +4962,7 @@ int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans, int i = 0; int ret = 0; - em = get_chunk_map(fs_info, chunk_offset, chunk_size); + em = btrfs_get_chunk_map(fs_info, chunk_offset, chunk_size); if (IS_ERR(em)) return PTR_ERR(em); @@ -5105,7 +5105,7 @@ int btrfs_chunk_readonly(struct btrfs_fs_info *fs_info, u64 chunk_offset) int miss_ndevs = 0; int i; - em = get_chunk_map(fs_info, chunk_offset, 1); + em = btrfs_get_chunk_map(fs_info, chunk_offset, 1); if (IS_ERR(em)) return 1; @@ -5165,7 +5165,7 @@ int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len) struct map_lookup *map; int ret; - em = get_chunk_map(fs_info, logical, len); + em = btrfs_get_chunk_map(fs_info, logical, len); if (IS_ERR(em)) /* * We could return errors for these cases, but that could get @@ -5211,7 +5211,7 @@ unsigned long btrfs_full_stripe_len(struct btrfs_fs_info *fs_info, struct map_lookup *map; unsigned long len = fs_info->sectorsize; - em = get_chunk_map(fs_info, logical, len); + em = btrfs_get_chunk_map(fs_info, logical, len); if (!WARN_ON(IS_ERR(em))) { map = em->map_lookup; @@ -5228,7 +5228,7 @@ int btrfs_is_parity_mirror(struct btrfs_fs_info *fs_info, u64 logical, u64 len) struct map_lookup *map; int ret = 0; - em = get_chunk_map(fs_info, logical, len); + em = btrfs_get_chunk_map(fs_info, logical, len); if(!WARN_ON(IS_ERR(em))) { map = em->map_lookup; @@ -5387,7 +5387,7 @@ static int __btrfs_map_block_for_discard(struct btrfs_fs_info *fs_info, /* discard always return a bbio */ ASSERT(bbio_ret); - em = get_chunk_map(fs_info, logical, length); + em = btrfs_get_chunk_map(fs_info, logical, length); if (IS_ERR(em)) return PTR_ERR(em); @@ -5713,7 +5713,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, return __btrfs_map_block_for_discard(fs_info, logical, *length, bbio_ret); - em = get_chunk_map(fs_info, logical, *length); + em = btrfs_get_chunk_map(fs_info, logical, *length); if (IS_ERR(em)) return PTR_ERR(em); @@ -6012,7 +6012,7 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start, u64 rmap_len; int i, j, nr = 0; - em = get_chunk_map(fs_info, chunk_start, 1); + em = btrfs_get_chunk_map(fs_info, chunk_start, 1); if (IS_ERR(em)) return -EIO; diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 5139ec8daf4c..d3dedfd1324b 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -467,6 +467,8 @@ unsigned long btrfs_full_stripe_len(struct btrfs_fs_info *fs_info, int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info, u64 chunk_offset, u64 chunk_size); +struct extent_map *btrfs_get_chunk_map(struct btrfs_fs_info *fs_info, + u64 logical, u64 length); int btrfs_remove_chunk(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info, u64 chunk_offset);