From patchwork Fri Aug 1 03:27:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 4660221 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 3C60D9F36A for ; Fri, 1 Aug 2014 03:27:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 699D1201BB for ; Fri, 1 Aug 2014 03:27:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2C0C201B9 for ; Fri, 1 Aug 2014 03:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbaHAD1d (ORCPT ); Thu, 31 Jul 2014 23:27:33 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:56391 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751999AbaHAD1c (ORCPT ); Thu, 31 Jul 2014 23:27:32 -0400 X-IronPort-AV: E=Sophos;i="5.04,240,1406563200"; d="scan'208";a="34048518" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 01 Aug 2014 11:24:41 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s713RSZl005238 for ; Fri, 1 Aug 2014 11:27:28 +0800 Received: from adam-work.lan (10.167.226.24) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Fri, 1 Aug 2014 11:27:30 +0800 From: Qu Wenruo To: Subject: [PATCH] btrfs: SSD related mount option dependency rework. Date: Fri, 1 Aug 2014 11:27:31 +0800 Message-ID: <1406863651-11042-1-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.0.3 MIME-Version: 1.0 X-Originating-IP: [10.167.226.24] 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 According to Documentations/filesystem/btrfs.txt, ssd/ssd_spread/nossd has their own dependency(See below), but only ssd_spread implying ssd is implemented. ssd_spread implies ssd, conflicts nossd. ssd conflicts nossd. nossd conflicts ssd and ssd_spread. This patch adds ssd{,_spread} confliction with nossd. Signed-off-by: Qu Wenruo --- fs/btrfs/super.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 8e16bca..2508a16 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -515,19 +515,22 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) compress_type); } break; - case Opt_ssd: - btrfs_set_and_info(root, SSD, - "use ssd allocation scheme"); - break; case Opt_ssd_spread: btrfs_set_and_info(root, SSD_SPREAD, "use spread ssd allocation scheme"); + /* suppress the ssd mount option log */ btrfs_set_opt(info->mount_opt, SSD); + /* fall through for other ssd routine */ + case Opt_ssd: + btrfs_set_and_info(root, SSD, + "use ssd allocation scheme"); + btrfs_clear_opt(info->mount_opt, NOSSD); break; case Opt_nossd: btrfs_set_and_info(root, NOSSD, "not using ssd allocation scheme"); btrfs_clear_opt(info->mount_opt, SSD); + btrfs_clear_opt(info->mount_opt, SSD_SPREAD); break; case Opt_barrier: btrfs_clear_and_info(root, NOBARRIER,