From: "Goffredo Baroncelli <kreijack@libero.it>" <kreijack@libero.it>
To: <seto.hidetoshi@jp.fujitsu.com>, <linux-btrfs@vger.kernel.org>
Subject: R: [PATCH 2/2] Btrfs-progs: add mount-option command
Date: Tue, 18 Sep 2012 12:03:47 +0200 (CEST) [thread overview]
Message-ID: <26356142.2062531347962627486.JavaMail.root@wmail62> (raw)
In-Reply-To: <5057CDA7.3090201@jp.fujitsu.com>
Hi Seto,
please could you update also the man page too ?
Why it was not provided a way to clear a *single* flag ? To me it seems a bit
too long to clear all the flag (btrfs mount-option clear) and then set the
right one.
As user interface I suggest something like chmod:
btrfs mount-option set +ssd,skip_balance -nodatacow /dev/sdX
or
btrfs mount-option set =ssd,skip_balance,nodatacow /dev/sdX
Finally I have some small concern about two macro (see below)
>----Messaggio originale----
>Da: seto.hidetoshi@jp.fujitsu.com
>Data: 18/09/2012 3.30
>A: <linux-btrfs@vger.kernel.org>
>Ogg: [PATCH 2/2] Btrfs-progs: add mount-option command
>
[...]
>+/*
>+ * Flags for mount options.
>+ *
>+ * Note: don't forget to add new options to btrfs_show_options()
>+ */
>+#define BTRFS_MOUNT_NODATASUM (1 << 0)
>+#define BTRFS_MOUNT_NODATACOW (1 << 1)
>+#define BTRFS_MOUNT_NOBARRIER (1 << 2)
>+#define BTRFS_MOUNT_SSD (1 << 3)
>+#define BTRFS_MOUNT_DEGRADED (1 << 4)
>+#define BTRFS_MOUNT_COMPRESS (1 << 5)
>+#define BTRFS_MOUNT_NOTREELOG (1 << 6)
>+#define BTRFS_MOUNT_FLUSHONCOMMIT (1 << 7)
>+#define BTRFS_MOUNT_SSD_SPREAD (1 << 8)
>+#define BTRFS_MOUNT_NOSSD (1 << 9)
>+#define BTRFS_MOUNT_DISCARD (1 << 10)
>+#define BTRFS_MOUNT_FORCE_COMPRESS (1 << 11)
>+#define BTRFS_MOUNT_SPACE_CACHE (1 << 12)
>+#define BTRFS_MOUNT_CLEAR_CACHE (1 << 13)
>+#define BTRFS_MOUNT_USER_SUBVOL_RM_ALLOWED (1 << 14)
>+#define BTRFS_MOUNT_ENOSPC_DEBUG (1 << 15)
>+#define BTRFS_MOUNT_AUTO_DEFRAG (1 << 16)
>+#define BTRFS_MOUNT_INODE_MAP_CACHE (1 << 17)
>+#define BTRFS_MOUNT_RECOVERY (1 << 18)
>+#define BTRFS_MOUNT_SKIP_BALANCE (1 << 19)
>+#define BTRFS_MOUNT_CHECK_INTEGRITY (1 << 20)
>+#define BTRFS_MOUNT_CHECK_INTEGRITY_INCLUDING_EXTENT_DATA (1 << 21)
>+#define BTRFS_MOUNT_PANIC_ON_FATAL_ERROR (1 << 22)
>+
>+#define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt)
>+#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt)
>+#define btrfs_test_opt(root, opt) ((root)->fs_info->mount_opt& \
>+ BTRFS_MOUNT_##opt)
I think that the macro names are too generic, I suggest to rename the three
macros above as
#define btrfs_mount_XXXX_opt
Also, the last one should be
#define btrfs_test_opt(o, opt) ( o & BTRFS_MOUNT_##opt)
Or better the other two
#define btrfs_mount_clear_opt(root, opt) (((root)->fs_info->mount_opt) &=
~BTRFS_MOUNT_##opt)
#define btrfs_mount_set_opt(root, opt) (((root)->fs_info->mount_opt) |=
BTRFS_MOUNT_##opt)
>--
>1.7.7.6
>
>
>--
>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
>
next prev parent reply other threads:[~2012-09-18 10:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-18 1:25 [PATCH 0/2] Btrfs: set mount options permanently Hidetoshi Seto
2012-09-18 1:28 ` [PATCH 1/2] Btrfs: make space to keep default mount options Hidetoshi Seto
2012-09-18 12:10 ` David Sterba
2012-09-19 8:31 ` Hidetoshi Seto
2012-09-20 11:05 ` David Sterba
2012-09-18 1:30 ` [PATCH 2/2] Btrfs-progs: add mount-option command Hidetoshi Seto
2012-09-18 2:31 ` Miao Xie
2012-09-18 4:19 ` Roman Mamedov
2012-09-18 8:19 ` Hugo Mills
2012-09-18 12:06 ` David Sterba
2012-09-19 8:32 ` Hidetoshi Seto
2012-09-20 11:14 ` David Sterba
2012-09-18 12:30 ` David Sterba
2012-09-19 8:32 ` Hidetoshi Seto
2012-09-18 10:03 ` Goffredo Baroncelli <kreijack@libero.it> [this message]
2012-09-19 8:31 ` R: " Hidetoshi Seto
2012-09-20 11:28 ` David Sterba
2012-09-18 11:37 ` R: " Goffredo Baroncelli <kreijack@libero.it>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26356142.2062531347962627486.JavaMail.root@wmail62 \
--to=kreijack@libero.it \
--cc=linux-btrfs@vger.kernel.org \
--cc=seto.hidetoshi@jp.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).