From patchwork Thu Nov 14 14:09:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 3182601 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 604289F432 for ; Thu, 14 Nov 2013 14:10:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38F4B20974 for ; Thu, 14 Nov 2013 14:10:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8E82208DE for ; Thu, 14 Nov 2013 14:10:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753914Ab3KNOJ7 (ORCPT ); Thu, 14 Nov 2013 09:09:59 -0500 Received: from cantor2.suse.de ([195.135.220.15]:53726 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753488Ab3KNOJ5 (ORCPT ); Thu, 14 Nov 2013 09:09:57 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2FCF4A67FD; Thu, 14 Nov 2013 15:09:57 +0100 (CET) Received: by ds.suse.cz (Postfix, from userid 10065) id 9B1FFDA8F8; Thu, 14 Nov 2013 15:09:56 +0100 (CET) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: chris.mason@fusionio.com, David Sterba Subject: [PATCH] btrfs-progs: mkfs: enable extended refs by default Date: Thu, 14 Nov 2013 15:09:53 +0100 Message-Id: <1384438193-13237-1-git-send-email-dsterba@suse.cz> X-Mailer: git-send-email 1.8.4.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 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 The feature has been introduced in kernel 3.7 and enabling it by default is desired. All features enabled by default are marked as such in 'mkfs.btrfs -O list-all' output. Signed-off-by: David Sterba --- mkfs.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mkfs.c b/mkfs.c index cd0af9ef8b4f..bdfc4b170700 100644 --- a/mkfs.c +++ b/mkfs.c @@ -46,6 +46,8 @@ static u64 index_cnt = 2; +#define DEFAULT_MKFS_FEATURES (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) + #define DEFAULT_MKFS_LEAF_SIZE 16384 struct directory_name_entry { @@ -1155,10 +1157,15 @@ static void list_all_fs_features(void) fprintf(stderr, "Filesystem features available at mkfs time:\n"); for (i = 0; i < ARRAY_SIZE(mkfs_features) - 1; i++) { - fprintf(stderr, "%-20s- %s (0x%llx)\n", + char *is_default = ""; + + if (mkfs_features[i].flag & DEFAULT_MKFS_FEATURES) + is_default = ", default"; + fprintf(stderr, "%-20s- %s (0x%llx%s)\n", mkfs_features[i].name, mkfs_features[i].desc, - mkfs_features[i].flag); + mkfs_features[i].flag, + is_default); } } @@ -1249,7 +1256,7 @@ int main(int ac, char **av) int dev_cnt = 0; int saved_optind; char estr[100]; - u64 features = 0; + u64 features = DEFAULT_MKFS_FEATURES; while(1) { int c;