btrfs: SSD related mount option dependency rework.
diff mbox

Message ID 1406863651-11042-1-git-send-email-quwenruo@cn.fujitsu.com
State New, archived
Headers show

Commit Message

Qu Wenruo Aug. 1, 2014, 3:27 a.m. UTC
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 <quwenruo@cn.fujitsu.com>
---
 fs/btrfs/super.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Satoru Takeuchi Aug. 7, 2014, 10:37 a.m. UTC | #1
Hi Qu,

(2014/08/01 12:27), Qu Wenruo wrote:
> 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.

How about write down above-mentioned dependencies in
Documentations/filesystem/btrfs.txt too?

Thanks,
Satoru

> 
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
> ---
>   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,
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Qu Wenruo Oct. 27, 2014, 4:19 a.m. UTC | #2
Any new comments?

Cc: Satoru
Sorry for the late reply.
Unfortunately, it seems that your mail doesn't show in my inbox, but 
only occurs in patchwork.

About writing the dependency in btrfs.txt, since the patch is based on 
the btrfs.txt,
it already shows the dependency, so I'd like not to repeat them in 
btrfs.txt.

Thanks,
Qu

-------- Original Message --------
Subject: [PATCH] btrfs: SSD related mount option dependency rework.
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Date: 2014?08?01? 11:27
> 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 <quwenruo@cn.fujitsu.com>
> ---
>   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,

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

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,