All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/2] Btrfs: make space to keep default mount options
Date: Tue, 18 Sep 2012 10:28:48 +0900	[thread overview]
Message-ID: <5057CE50.1050706@jp.fujitsu.com> (raw)
In-Reply-To: <5057CDA7.3090201@jp.fujitsu.com>

This patch create space to hold default mount option,
and to use saved default mount option change super.c
to read default mount option first when mount devices.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
---
 fs/btrfs/ctree.h |    5 ++++-
 fs/btrfs/super.c |    2 ++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index fa5c45b..3eb0551 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -458,8 +458,11 @@ struct btrfs_super_block {
 
 	__le64 cache_generation;
 
+	/* default mount options */
+	unsigned long default_mount_opt;
+
 	/* future expansion */
-	__le64 reserved[31];
+	__le64 reserved[30];
 	u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
 	struct btrfs_root_backup super_roots[BTRFS_NUM_BACKUP_ROOTS];
 } __attribute__ ((__packed__));
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index e239915..7ef4a2e 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -340,6 +340,8 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
 	char *compress_type;
 	bool compress_force = false;
 
+	info->mount_opt = info->super_copy->default_mount_opt;
+
 	cache_gen = btrfs_super_cache_generation(root->fs_info->super_copy);
 	if (cache_gen)
 		btrfs_set_opt(info->mount_opt, SPACE_CACHE);
-- 
1.7.7.6



  reply	other threads:[~2012-09-18  1:29 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 ` Hidetoshi Seto [this message]
2012-09-18 12:10   ` [PATCH 1/2] Btrfs: make space to keep default mount options 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 ` R: " Goffredo Baroncelli <kreijack@libero.it>
2012-09-19  8:31   ` 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=5057CE50.1050706@jp.fujitsu.com \
    --to=seto.hidetoshi@jp.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.