Merge pull request #5 from namjaejeon/exfat-next

Exfat next
This commit is contained in:
Namjae Jeon 2020-06-13 22:07:15 +09:00 • committed by GitHub
commit 90419f2172
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 6 deletions

10
dir.c
View file

@ -426,10 +426,12 @@ static void exfat_init_name_entry(struct exfat_dentry *ep,
ep->dentry.name.flags = 0x0;
for (i = 0; i < EXFAT_FILE_NAME_LEN; i++) {
ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
if (*uniname == 0x0)
break;
uniname++;
if (*uniname != 0x0) {
ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
uniname++;
} else {
ep->dentry.name.unicode_0_14[i] = 0x0;
}
}
}

View file

@ -11,6 +11,8 @@
#include <linux/ratelimit.h>
#include <linux/nls.h>
#define EXFAT_VERSION "5.8.1"
#define EXFAT_SUPER_MAGIC 0x2011BAB0UL
#define EXFAT_ROOT_INO 1

12
namei.c
View file

@ -1184,10 +1184,14 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
epold = exfat_get_dentry(sb, p_dir, oldentry + 1, &old_bh,
&sector_old);
if (!epold)
return -EIO;
epnew = exfat_get_dentry(sb, p_dir, newentry + 1, &new_bh,
&sector_new);
if (!epold || !epnew)
if (!epnew) {
brelse(old_bh);
return -EIO;
}
memcpy(epnew, epold, DENTRY_SIZE);
exfat_update_bh(sb, new_bh, sync);
@ -1268,10 +1272,14 @@ static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,
epmov = exfat_get_dentry(sb, p_olddir, oldentry + 1, &mov_bh,
&sector_mov);
if (!epmov)
return -EIO;
epnew = exfat_get_dentry(sb, p_newdir, newentry + 1, &new_bh,
&sector_new);
if (!epmov || !epnew)
if (!epnew) {
brelse(mov_bh);
return -EIO;
}
memcpy(epnew, epmov, DENTRY_SIZE);
exfat_update_bh(sb, new_bh, IS_DIRSYNC(inode));

View file

@ -1077,3 +1077,4 @@ MODULE_ALIAS_FS("exfat");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("exFAT filesystem support");
MODULE_AUTHOR("Samsung Electronics Co., Ltd.");
MODULE_VERSION(EXFAT_VERSION);