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.hideto...@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


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

Reply via email to