diff --git a/.travis.yml b/.travis.yml index 5a50c5c3d6bf..c4a1e79ad976 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,6 @@ script: - sudo losetup /dev/loop21 test.img - sudo mkfs.exfat -c 4 /dev/loop20 - sudo mkfs.exfat -c 4 /dev/loop21 - - sudo make uninstall - cd .. - cd exfat-testsuites/ - tar xzvf xfstests-exfat.tgz > /dev/null diff --git a/README.md b/README.md index c70f1aecceb2..cee3699ed9be 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,53 @@ -# exfat -linux-exfat for 4.1 ~ the latest linus-tree +## exFAT filesystem +This is the exfat filesystem for support from the linux 4.1 kernel +to the latest kernel. + +## Installing as a stand-alone module + +Install prerequisite package for Fedora, RHEL: +``` + yum install kernel-devel-$(uname -r) +``` + +Build step: +``` + make + sudo make install +``` + +To load the driver manually, run this as root: +``` + modprobe exfat +``` + + +## Installing as a part of the kernel + +1. Let's take [linux] as the path to your kernel source dir. +``` + cd [linux] + cp -ar exfat [linux]/fs/ +``` + +2. edit [linux]/fs/Kconfig +``` + source "fs/fat/Kconfig" + +source "fs/exfat/Kconfig" + source "fs/ntfs/Kconfig" +``` + +3. edit [linux]/fs/Makefile +``` + obj-$(CONFIG_FAT_FS) += fat/ + +obj-$(CONFIG_EXFAT_FS) += exfat/ + obj-$(CONFIG_BFS_FS) += bfs/ +``` +4. make menuconfig and set exfat +``` + File systems ---> + DOS/FAT/NT Filesystems ---> + exFAT filesystem support + (utf8) Default iocharset for exFAT +``` + +build your kernel diff --git a/super.c b/super.c index b7f57665fa00..769dcdf4ac10 100644 --- a/super.c +++ b/super.c @@ -249,7 +249,27 @@ enum { Opt_time_offset, }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct constant_table exfat_param_enums[] = { + { "continue", EXFAT_ERRORS_CONT }, + { "panic", EXFAT_ERRORS_PANIC }, + { "remount-ro", EXFAT_ERRORS_RO }, + {} +}; +#else +static const struct fs_parameter_enum exfat_param_enums[] = { + { Opt_errors, "continue", EXFAT_ERRORS_CONT }, + { Opt_errors, "panic", EXFAT_ERRORS_PANIC }, + { Opt_errors, "remount-ro", EXFAT_ERRORS_RO }, + {} +}; +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct fs_parameter_spec exfat_parameters[] = { +#else static const struct fs_parameter_spec exfat_param_specs[] = { +#endif fsparam_u32("uid", Opt_uid), fsparam_u32("gid", Opt_gid), fsparam_u32oct("umask", Opt_umask), @@ -257,24 +277,23 @@ static const struct fs_parameter_spec exfat_param_specs[] = { fsparam_u32oct("fmask", Opt_fmask), fsparam_u32oct("allow_utime", Opt_allow_utime), fsparam_string("iocharset", Opt_charset), +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + fsparam_enum("errors", Opt_errors, exfat_param_enums), +#else fsparam_enum("errors", Opt_errors), +#endif fsparam_flag("discard", Opt_discard), fsparam_s32("time_offset", Opt_time_offset), {} }; -static const struct fs_parameter_enum exfat_param_enums[] = { - { Opt_errors, "continue", EXFAT_ERRORS_CONT }, - { Opt_errors, "panic", EXFAT_ERRORS_PANIC }, - { Opt_errors, "remount-ro", EXFAT_ERRORS_RO }, - {} -}; - +#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 5, 0) static const struct fs_parameter_description exfat_parameters = { .name = "exfat", .specs = exfat_param_specs, .enums = exfat_param_enums, }; +#endif static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param) { @@ -283,7 +302,11 @@ static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param) struct fs_parse_result result; int opt; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + opt = fs_parse(fc, exfat_parameters, param, &result); +#else opt = fs_parse(fc, &exfat_parameters, param, &result); +#endif if (opt < 0) return opt; @@ -893,7 +916,11 @@ static struct file_system_type exfat_fs_type = { .name = "exfat", #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) .init_fs_context = exfat_init_fs_context, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + .parameters = exfat_parameters, +#else .parameters = &exfat_parameters, +#endif #else .mount = exfat_fs_mount, #endif