From patchwork Wed Sep 26 07:36:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 10615371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 57DDC13A4 for ; Wed, 26 Sep 2018 07:36:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 452B629C41 for ; Wed, 26 Sep 2018 07:36:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38F562A20C; Wed, 26 Sep 2018 07:36:44 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 C8C3A29C41 for ; Wed, 26 Sep 2018 07:36:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726703AbeIZNsQ (ORCPT ); Wed, 26 Sep 2018 09:48:16 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:39636 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbeIZNsP (ORCPT ); Wed, 26 Sep 2018 09:48:15 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8Q7YIgS137843 for ; Wed, 26 Sep 2018 07:36:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id; s=corp-2018-07-02; bh=rLlvuh70iEGInbX2K/k5GzChfpblR65AbjZBXQgLKoE=; b=vNJjvx9j9xfjOF7fFwz40fnpBHJaP2JUDMA44lUdKKFhrinP766qK4bADHOtNuR8pH4R 31g532urPzPfS0gv9aufjr8dvfPzAp/ZsZXZqX87XNGTzLfARdzH8qK0tjH4CqHInC4X gJ2VgriMTlY7IHxlrftr9p4eyYL5HCUutlPsBGiGxHZCFWf8u5kwUXsISFqx6qmlvWE1 LpUJj9hT3oLWvf+iKNHc1jOtjzNN2JPl6fafVCUieB3CR6Bgy+8OMdw/bB+TXgldnEJ4 eVl67x0BGx23+ZVjUyS3PdcswKkpcPwMcrHdkbEmfJFBXePIVJDu16ldpaV9f1zrQ29j Jg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2mndppgmpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 26 Sep 2018 07:36:40 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8Q7aZhc020863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 26 Sep 2018 07:36:35 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8Q7aZmR004902 for ; Wed, 26 Sep 2018 07:36:35 GMT Received: from tpasj.sg.oracle.com (/10.186.50.4) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Sep 2018 00:36:34 -0700 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs-progs: delete unused is_vol_small() and BTRFS_MKFS_SMALL_VOLUME_SIZE Date: Wed, 26 Sep 2018 15:36:28 +0800 Message-Id: <1537947388-10396-1-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9027 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809260078 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 Since commit c11e36a29e84 (Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified) we don't have automatic mixed mode, and the function is_vol_small() and the define BTRFS_MKFS_SMALL_VOLUME_SIZE was obsolete since then so clean it up. Signed-off-by: Anand Jain Reviewed-by: Qu Wenruo --- mkfs/common.c | 29 ----------------------------- mkfs/common.h | 1 - 2 files changed, 30 deletions(-) diff --git a/mkfs/common.c b/mkfs/common.c index 0ace262b0e5f..c59e1d8eda4a 100644 --- a/mkfs/common.c +++ b/mkfs/common.c @@ -772,35 +772,6 @@ int test_status_for_mkfs(const char *file, bool force_overwrite) return 0; } -int is_vol_small(const char *file) -{ - int fd = -1; - int e; - struct stat st; - u64 size; - - fd = open(file, O_RDONLY); - if (fd < 0) - return -errno; - if (fstat(fd, &st) < 0) { - e = -errno; - close(fd); - return e; - } - size = btrfs_device_size(fd, &st); - if (size == 0) { - close(fd); - return -1; - } - if (size < BTRFS_MKFS_SMALL_VOLUME_SIZE) { - close(fd); - return 1; - } else { - close(fd); - return 0; - } -} - int test_minimum_size(const char *file, u64 min_dev_size) { int fd; diff --git a/mkfs/common.h b/mkfs/common.h index 28912906d0a9..18f5c3b66270 100644 --- a/mkfs/common.h +++ b/mkfs/common.h @@ -26,7 +26,6 @@ #include "common-defs.h" #define BTRFS_MKFS_SYSTEM_GROUP_SIZE SZ_4M -#define BTRFS_MKFS_SMALL_VOLUME_SIZE SZ_1G /* * Tree root blocks created during mkfs