From patchwork Tue Nov 11 11:35:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karel Zak X-Patchwork-Id: 5272931 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DE546C11AD for ; Tue, 11 Nov 2014 11:36:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D0E22011D for ; Tue, 11 Nov 2014 11:36:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B60F920136 for ; Tue, 11 Nov 2014 11:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752114AbaKKLgL (ORCPT ); Tue, 11 Nov 2014 06:36:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57249 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbaKKLgJ (ORCPT ); Tue, 11 Nov 2014 06:36:09 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sABBa5ph008210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Nov 2014 06:36:05 -0500 Received: from x2.net.home (vpn1-4-99.ams2.redhat.com [10.36.4.99]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sABBa3aE028837; Tue, 11 Nov 2014 06:36:04 -0500 From: Karel Zak To: linux-btrfs@vger.kernel.org, Anand Jain Cc: dsterba@suse.cz, Karel Zak Subject: [PATCH 1/2] btrfs-progs: rename btrfs_scan_lblkid() to btrfs_scan_devices() Date: Tue, 11 Nov 2014 12:35:58 +0100 Message-Id: <1415705759-2681-1-git-send-email-kzak@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It seems like bad idea to use a library name (lblkid) within generic function name. The currently used scanning library is implementation detail and this detail should be hidden for rest of the code. Signed-off-by: Karel Zak --- cmds-device.c | 2 +- cmds-filesystem.c | 2 +- disk-io.c | 2 +- utils.c | 6 +++--- utils.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index 9323986..e18ef4b 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -235,7 +235,7 @@ static int cmd_scan_dev(int argc, char **argv) if (all || argc == 1) { printf("Scanning for Btrfs filesystems\n"); - ret = btrfs_scan_lblkid(); + ret = btrfs_scan_devices(); if (ret) fprintf(stderr, "ERROR: error %d while scanning\n", ret); ret = btrfs_register_all_devices(); diff --git a/cmds-filesystem.c b/cmds-filesystem.c index e4b2785..25ef382 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -948,7 +948,7 @@ static int cmd_show(int argc, char **argv) goto out; devs_only: - ret = btrfs_scan_lblkid(); + ret = btrfs_scan_devices(); if (ret) { fprintf(stderr, "ERROR: %d while scanning\n", ret); diff --git a/disk-io.c b/disk-io.c index bade5f0..85a2a57 100644 --- a/disk-io.c +++ b/disk-io.c @@ -1019,7 +1019,7 @@ int btrfs_scan_fs_devices(int fd, const char *path, } if (total_devs != 1) { - ret = btrfs_scan_lblkid(); + ret = btrfs_scan_devices(); if (ret) return ret; } diff --git a/utils.c b/utils.c index 4b3bace..cc33cfc 100644 --- a/utils.c +++ b/utils.c @@ -1188,7 +1188,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size, /* scan other devices */ if (is_btrfs && total_devs > 1) { - ret = btrfs_scan_lblkid(); + ret = btrfs_scan_devices(); if (ret) return ret; } @@ -1270,7 +1270,7 @@ int btrfs_register_one_device(const char *fname) /* * Register all devices in the fs_uuid list created in the user - * space. Ensure btrfs_scan_lblkid() is called before this func. + * space. Ensure btrfs_scan_devices() is called before this func. */ int btrfs_register_all_devices(void) { @@ -2181,7 +2181,7 @@ int test_dev_for_mkfs(char *file, int force_overwrite, char *estr) return 0; } -int btrfs_scan_lblkid() +int btrfs_scan_devices() { int fd = -1; int ret; diff --git a/utils.h b/utils.h index 8c94624..919dfcf 100644 --- a/utils.h +++ b/utils.h @@ -128,7 +128,7 @@ int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf, int verify); int ask_user(char *question); int lookup_ino_rootid(int fd, u64 *rootid); -int btrfs_scan_lblkid(void); +int btrfs_scan_devices(void); int get_btrfs_mount(const char *dev, char *mp, size_t mp_size); int find_mount_root(const char *path, char **mount_root); int get_device_info(int fd, u64 devid,