btrfs: Fix compile error when CONFIG_SECURITY is not set.
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Wed, 8 Oct 2014 02:19:08 +0000 (10:19 +0800)
committerChris Mason <clm@fb.com>
Wed, 8 Oct 2014 13:59:24 +0000 (06:59 -0700)
Fix the following compile error when CONFIG_SECURITY is not set:

error: 'struct security_mnt_opts' has no member named 'num_mnt_opts'

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/super.c

index 2250284..a2b97ef 100644 (file)
@@ -1248,6 +1248,7 @@ static int setup_security_options(struct btrfs_fs_info *fs_info,
        if (ret)
                return ret;
 
+#ifdef CONFIG_SECURITY
        if (!fs_info->security_opts.num_mnt_opts) {
                /* first time security setup, copy sec_opts to fs_info */
                memcpy(&fs_info->security_opts, sec_opts, sizeof(*sec_opts));
@@ -1260,6 +1261,7 @@ static int setup_security_options(struct btrfs_fs_info *fs_info,
                 */
                security_free_mnt_opts(sec_opts);
        }
+#endif
        return ret;
 }