From: Paul Keith Date: Fri, 2 Mar 2018 03:51:53 +0000 (+0100) Subject: fs: sdfat: Add config option to register sdFAT for exFAT X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4d98b7365c9a773e7542d1c95f88a2ef4d8dbda8;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git fs: sdfat: Add config option to register sdFAT for exFAT Change-Id: Id57abf0a4bd0b433fecc622eecb383cd4ea29d17 Signed-off-by: Paul Keith --- diff --git a/fs/sdfat/Kconfig b/fs/sdfat/Kconfig index 2ab3e9921b8c..3fe86e72c40b 100644 --- a/fs/sdfat/Kconfig +++ b/fs/sdfat/Kconfig @@ -15,6 +15,13 @@ config SDFAT_FS To compile this as a module, choose M here: the module will be called sdfat_core and sdfat_fs. +config SDFAT_USE_FOR_EXFAT + bool "Register sdFAT as exFAT" + default y + depends on SDFAT_FS && !EXFAT_FS + help + If you want to register sdFAT as available for exFAT, say Y. + config SDFAT_DELAYED_META_DIRTY bool "Enable delayed metadata dirty" default y diff --git a/fs/sdfat/sdfat.c b/fs/sdfat/sdfat.c index b25a0732125a..9d50d0ce72de 100644 --- a/fs/sdfat/sdfat.c +++ b/fs/sdfat/sdfat.c @@ -5051,6 +5051,20 @@ static struct file_system_type sdfat_fs_type = { .fs_flags = FS_REQUIRES_DEV, }; +#ifdef CONFIG_SDFAT_USE_FOR_EXFAT +static struct file_system_type exfat_fs_type = { + .owner = THIS_MODULE, + .name = "exfat", + .mount = sdfat_fs_mount, +#ifdef CONFIG_SDFAT_DBG_IOCTL + .kill_sb = sdfat_debug_kill_sb, +#else + .kill_sb = kill_block_super, +#endif /* CONFIG_SDFAT_DBG_IOCTL */ + .fs_flags = FS_REQUIRES_DEV, +}; +#endif /* CONFIG_SDFAT_USE_FOR_EXFAT */ + static int __init init_sdfat_fs(void) { int err; @@ -5089,6 +5103,14 @@ static int __init init_sdfat_fs(void) goto error; } +#ifdef CONFIG_SDFAT_USE_FOR_EXFAT + err = register_filesystem(&exfat_fs_type); + if (err) { + pr_err("[SDFAT] failed to register for exfat filesystem\n"); + goto error; + } +#endif /* CONFIG_SDFAT_USE_FOR_EXFAT */ + return 0; error: sdfat_statistics_uninit(); @@ -5118,7 +5140,9 @@ static void __exit exit_sdfat_fs(void) sdfat_destroy_inodecache(); unregister_filesystem(&sdfat_fs_type); - +#ifdef CONFIG_SDFAT_USE_FOR_EXFAT + unregister_filesystem(&exfat_fs_type); +#endif /* CONFIG_SDFAT_USE_FOR_EXFAT */ fsapi_shutdown(); }