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 #5 from namjaejeon/exfat-next
Browse files Browse the repository at this point in the history
Exfat next
  • Loading branch information
namjaejeon authored Jun 13, 2020
2 parents 8fa6fe4 + 859f936 commit 90419f2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
10 changes: 6 additions & 4 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions exfat_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 10 additions & 2 deletions namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 90419f2

Please sign in to comment.