Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from namjaejeon/exfat-next
Browse files Browse the repository at this point in the history
Exfat next
  • Loading branch information
namjaejeon authored Jul 25, 2020
2 parents e758ac7 + bb455ac commit 23252f9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion exfat_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <linux/ratelimit.h>
#include <linux/nls.h>

#define EXFAT_VERSION "5.8.4"
#define EXFAT_VERSION "5.8.7"

#define EXFAT_SUPER_MAGIC 0x2011BAB0UL
#define EXFAT_ROOT_INO 1
Expand Down
2 changes: 1 addition & 1 deletion file.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size)
ep2->dentry.stream.size = 0;
} else {
ep2->dentry.stream.valid_size = cpu_to_le64(new_size);
ep2->dentry.stream.size = ep->dentry.stream.valid_size;
ep2->dentry.stream.size = ep2->dentry.stream.valid_size;
}

if (new_size == 0) {
Expand Down
8 changes: 4 additions & 4 deletions nls.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
struct exfat_uni_name *p_uniname, int *p_lossy)
{
int i, unilen, lossy = NLS_NAME_NO_LOSSY;
unsigned short upname[MAX_NAME_LENGTH + 1];
__le16 upname[MAX_NAME_LENGTH + 1];
unsigned short *uniname = p_uniname->name;

WARN_ON(!len);
Expand All @@ -519,7 +519,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
exfat_wstrchr(bad_uni_chars, *uniname))
lossy |= NLS_NAME_LOSSY;

upname[i] = exfat_toupper(sb, *uniname);
upname[i] = cpu_to_le16(exfat_toupper(sb, *uniname));
uniname++;
}

Expand Down Expand Up @@ -597,7 +597,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb,
struct exfat_uni_name *p_uniname, int *p_lossy)
{
int i = 0, unilen = 0, lossy = NLS_NAME_NO_LOSSY;
unsigned short upname[MAX_NAME_LENGTH + 1];
__le16 upname[MAX_NAME_LENGTH + 1];
unsigned short *uniname = p_uniname->name;
struct nls_table *nls = EXFAT_SB(sb)->nls_io;

Expand All @@ -611,7 +611,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb,
exfat_wstrchr(bad_uni_chars, *uniname))
lossy |= NLS_NAME_LOSSY;

upname[unilen] = exfat_toupper(sb, *uniname);
upname[unilen] = cpu_to_le16(exfat_toupper(sb, *uniname));
uniname++;
unilen++;
}
Expand Down
20 changes: 8 additions & 12 deletions super.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
#else
Expand Down Expand Up @@ -237,7 +237,7 @@ static const struct super_operations exfat_sops = {
.show_options = exfat_show_options,
};

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
enum {
Opt_uid,
Opt_gid,
Expand Down Expand Up @@ -303,7 +303,7 @@ static const struct fs_parameter_spec exfat_param_specs[] = {
{}
};

#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 5, 0)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0)
static const struct fs_parameter_description exfat_parameters = {
.name = "exfat",
.specs = exfat_param_specs,
Expand Down Expand Up @@ -824,15 +824,15 @@ static int __exfat_fill_super(struct super_block *sb)
return ret;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
#else
static int exfat_fill_super(struct super_block *sb, void *data, int silent)
#endif
{
struct inode *root_inode;
int err;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
struct exfat_sb_info *sbi = sb->s_fs_info;
struct exfat_mount_options *opts = &sbi->options;

Expand Down Expand Up @@ -895,7 +895,7 @@ static int exfat_fill_super(struct super_block *sb, void *data, int silent)
exfat_hash_init(sb);

if (!strcmp(sbi->options.iocharset, "utf8"))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
opts->utf8 = 1;
#else
sbi->options.utf8 = 1;
Expand Down Expand Up @@ -964,7 +964,7 @@ static int exfat_fill_super(struct super_block *sb, void *data, int silent)
return err;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
static int exfat_get_tree(struct fs_context *fc)
{
return get_tree_bdev(fc, exfat_fill_super);
Expand Down Expand Up @@ -1031,13 +1031,9 @@ static struct dentry *exfat_fs_mount(struct file_system_type *fs_type,
static struct file_system_type exfat_fs_type = {
.owner = THIS_MODULE,
.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)
.init_fs_context = exfat_init_fs_context,
.parameters = exfat_parameters,
#else
.parameters = &exfat_parameters,
#endif
#else
.mount = exfat_fs_mount,
#endif
Expand Down

0 comments on commit 23252f9

Please sign in to comment.