|
Kmods SIG |
9e3ffb |
From ed0f84d30ba65f44bed2739572c7ab0fdeed4004 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
9e3ffb |
From: Tetsuhiro Kohada <kohada.t2@gmail.com>
|
|
Kmods SIG |
9e3ffb |
Date: Wed, 22 Apr 2020 08:30:56 +0900
|
|
Kmods SIG |
9e3ffb |
Subject: [Backport ed0f84d30ba6] exfat: replace 'time_ms' with 'time_cs'
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
Replace time_ms with time_cs in the file directory entry structure
|
|
Kmods SIG |
9e3ffb |
and related functions.
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
The unit of create_time_ms/modify_time_ms in File Directory Entry are not
|
|
Kmods SIG |
9e3ffb |
'milli-second', but 'centi-second'.
|
|
Kmods SIG |
9e3ffb |
The exfat specification uses the term '10ms', but instead use 'cs' as in
|
|
Kmods SIG |
9e3ffb |
msdos_fs.h.
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
|
|
Kmods SIG |
9e3ffb |
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
|
|
Kmods SIG |
9e3ffb |
---
|
|
Kmods SIG |
9e3ffb |
src/dir.c | 8 ++++----
|
|
Kmods SIG |
9e3ffb |
src/exfat_fs.h | 4 ++--
|
|
Kmods SIG |
9e3ffb |
src/exfat_raw.h | 4 ++--
|
|
Kmods SIG |
9e3ffb |
src/file.c | 2 +-
|
|
Kmods SIG |
9e3ffb |
src/inode.c | 4 ++--
|
|
Kmods SIG |
9e3ffb |
src/misc.c | 18 +++++++++---------
|
|
Kmods SIG |
9e3ffb |
src/namei.c | 4 ++--
|
|
Kmods SIG |
9e3ffb |
7 files changed, 22 insertions(+), 22 deletions(-)
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
diff --git a/src/dir.c b/src/dir.c
|
|
Kmods SIG |
9e3ffb |
index 53ae965da7ec583fb4e31cc548c40daf08ae941a..b5a237c33d50c02c632ec82627f78b4e70507d7a 100644
|
|
Kmods SIG |
9e3ffb |
--- a/src/dir.c
|
|
Kmods SIG |
9e3ffb |
+++ b/src/dir.c
|
|
Kmods SIG |
9e3ffb |
@@ -137,12 +137,12 @@ static int exfat_readdir(struct inode *inode, struct exfat_dir_entry *dir_entry)
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.create_tz,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.create_time,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.create_date,
|
|
Kmods SIG |
9e3ffb |
- ep->dentry.file.create_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ ep->dentry.file.create_time_cs);
|
|
Kmods SIG |
9e3ffb |
exfat_get_entry_time(sbi, &dir_entry->mtime,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.modify_tz,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.modify_time,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.modify_date,
|
|
Kmods SIG |
9e3ffb |
- ep->dentry.file.modify_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ ep->dentry.file.modify_time_cs);
|
|
Kmods SIG |
9e3ffb |
exfat_get_entry_time(sbi, &dir_entry->atime,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.access_tz,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.access_time,
|
|
Kmods SIG |
9e3ffb |
@@ -461,12 +461,12 @@ int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.create_tz,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.create_time,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.create_date,
|
|
Kmods SIG |
9e3ffb |
- &ep->dentry.file.create_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ &ep->dentry.file.create_time_cs);
|
|
Kmods SIG |
9e3ffb |
exfat_set_entry_time(sbi, &ts,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_tz,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_time,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_date,
|
|
Kmods SIG |
9e3ffb |
- &ep->dentry.file.modify_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ &ep->dentry.file.modify_time_cs);
|
|
Kmods SIG |
9e3ffb |
exfat_set_entry_time(sbi, &ts,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.access_tz,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.access_time,
|
|
Kmods SIG |
9e3ffb |
diff --git a/src/exfat_fs.h b/src/exfat_fs.h
|
|
Kmods SIG |
9e3ffb |
index 3862df6af7386bd5e54ed338cedcee64c3cb6ddd..294aa7792bc3ca6c7e334110cba9160577d9affe 100644
|
|
Kmods SIG |
9e3ffb |
--- a/src/exfat_fs.h
|
|
Kmods SIG |
9e3ffb |
+++ b/src/exfat_fs.h
|
|
Kmods SIG |
9e3ffb |
@@ -511,10 +511,10 @@ void exfat_msg(struct super_block *sb, const char *lv, const char *fmt, ...)
|
|
Kmods SIG |
9e3ffb |
exfat_msg(sb, KERN_INFO, fmt, ##__VA_ARGS__)
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
|
|
Kmods SIG |
9e3ffb |
- u8 tz, __le16 time, __le16 date, u8 time_ms);
|
|
Kmods SIG |
9e3ffb |
+ u8 tz, __le16 time, __le16 date, u8 time_cs);
|
|
Kmods SIG |
9e3ffb |
void exfat_truncate_atime(struct timespec64 *ts);
|
|
Kmods SIG |
9e3ffb |
void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
|
|
Kmods SIG |
9e3ffb |
- u8 *tz, __le16 *time, __le16 *date, u8 *time_ms);
|
|
Kmods SIG |
9e3ffb |
+ u8 *tz, __le16 *time, __le16 *date, u8 *time_cs);
|
|
Kmods SIG |
9e3ffb |
unsigned short exfat_calc_chksum_2byte(void *data, int len,
|
|
Kmods SIG |
9e3ffb |
unsigned short chksum, int type);
|
|
Kmods SIG |
9e3ffb |
void exfat_update_bh(struct super_block *sb, struct buffer_head *bh, int sync);
|
|
Kmods SIG |
9e3ffb |
diff --git a/src/exfat_raw.h b/src/exfat_raw.h
|
|
Kmods SIG |
9e3ffb |
index 2a841010e6490ccafd5d12844a48a93fc6ee4bbf..8d6c64a7546d8bc8899e677bfd7f9d91f4e0cb4d 100644
|
|
Kmods SIG |
9e3ffb |
--- a/src/exfat_raw.h
|
|
Kmods SIG |
9e3ffb |
+++ b/src/exfat_raw.h
|
|
Kmods SIG |
9e3ffb |
@@ -136,8 +136,8 @@ struct exfat_dentry {
|
|
Kmods SIG |
9e3ffb |
__le16 modify_date;
|
|
Kmods SIG |
9e3ffb |
__le16 access_time;
|
|
Kmods SIG |
9e3ffb |
__le16 access_date;
|
|
Kmods SIG |
9e3ffb |
- __u8 create_time_ms;
|
|
Kmods SIG |
9e3ffb |
- __u8 modify_time_ms;
|
|
Kmods SIG |
9e3ffb |
+ __u8 create_time_cs;
|
|
Kmods SIG |
9e3ffb |
+ __u8 modify_time_cs;
|
|
Kmods SIG |
9e3ffb |
__u8 create_tz;
|
|
Kmods SIG |
9e3ffb |
__u8 modify_tz;
|
|
Kmods SIG |
9e3ffb |
__u8 access_tz;
|
|
Kmods SIG |
9e3ffb |
diff --git a/src/file.c b/src/file.c
|
|
Kmods SIG |
9e3ffb |
index c9db8eb0cfc3ee267d5e3b051974ceae8de861b5..84f3d31a3a555729b5d2e655f354929018b6b290 100644
|
|
Kmods SIG |
9e3ffb |
--- a/src/file.c
|
|
Kmods SIG |
9e3ffb |
+++ b/src/file.c
|
|
Kmods SIG |
9e3ffb |
@@ -165,7 +165,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size)
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_tz,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_time,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_date,
|
|
Kmods SIG |
9e3ffb |
- &ep->dentry.file.modify_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ &ep->dentry.file.modify_time_cs);
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.attr = cpu_to_le16(ei->attr);
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
/* File size should be zero if there is no cluster allocated */
|
|
Kmods SIG |
9e3ffb |
diff --git a/src/inode.c b/src/inode.c
|
|
Kmods SIG |
9e3ffb |
index 06887492f54b791506d2f7c76eb3ef073b72026d..3f367d081cd6dfe6c7cdb475d77e130b64d14d6d 100644
|
|
Kmods SIG |
9e3ffb |
--- a/src/inode.c
|
|
Kmods SIG |
9e3ffb |
+++ b/src/inode.c
|
|
Kmods SIG |
9e3ffb |
@@ -56,12 +56,12 @@ static int __exfat_write_inode(struct inode *inode, int sync)
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.create_tz,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.create_time,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.create_date,
|
|
Kmods SIG |
9e3ffb |
- &ep->dentry.file.create_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ &ep->dentry.file.create_time_cs);
|
|
Kmods SIG |
9e3ffb |
exfat_set_entry_time(sbi, &inode->i_mtime,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_tz,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_time,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.modify_date,
|
|
Kmods SIG |
9e3ffb |
- &ep->dentry.file.modify_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ &ep->dentry.file.modify_time_cs);
|
|
Kmods SIG |
9e3ffb |
exfat_set_entry_time(sbi, &inode->i_atime,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.access_tz,
|
|
Kmods SIG |
9e3ffb |
&ep->dentry.file.access_time,
|
|
Kmods SIG |
9e3ffb |
diff --git a/src/misc.c b/src/misc.c
|
|
Kmods SIG |
9e3ffb |
index ce5e8a1b0726c6778db86daebe39c437f23c7fba..ab7f88b1f6d3065cd3fca409526d50e833bbbfb0 100644
|
|
Kmods SIG |
9e3ffb |
--- a/src/misc.c
|
|
Kmods SIG |
9e3ffb |
+++ b/src/misc.c
|
|
Kmods SIG |
9e3ffb |
@@ -75,7 +75,7 @@ static void exfat_adjust_tz(struct timespec64 *ts, u8 tz_off)
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
/* Convert a EXFAT time/date pair to a UNIX date (seconds since 1 1 70). */
|
|
Kmods SIG |
9e3ffb |
void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
|
|
Kmods SIG |
9e3ffb |
- u8 tz, __le16 time, __le16 date, u8 time_ms)
|
|
Kmods SIG |
9e3ffb |
+ u8 tz, __le16 time, __le16 date, u8 time_cs)
|
|
Kmods SIG |
9e3ffb |
{
|
|
Kmods SIG |
9e3ffb |
u16 t = le16_to_cpu(time);
|
|
Kmods SIG |
9e3ffb |
u16 d = le16_to_cpu(date);
|
|
Kmods SIG |
9e3ffb |
@@ -84,10 +84,10 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
|
|
Kmods SIG |
9e3ffb |
t >> 11, (t >> 5) & 0x003F, (t & 0x001F) << 1);
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
- /* time_ms field represent 0 ~ 199(1990 ms) */
|
|
Kmods SIG |
9e3ffb |
- if (time_ms) {
|
|
Kmods SIG |
9e3ffb |
- ts->tv_sec += time_ms / 100;
|
|
Kmods SIG |
9e3ffb |
- ts->tv_nsec = (time_ms % 100) * 10 * NSEC_PER_MSEC;
|
|
Kmods SIG |
9e3ffb |
+ /* time_cs field represent 0 ~ 199cs(1990 ms) */
|
|
Kmods SIG |
9e3ffb |
+ if (time_cs) {
|
|
Kmods SIG |
9e3ffb |
+ ts->tv_sec += time_cs / 100;
|
|
Kmods SIG |
9e3ffb |
+ ts->tv_nsec = (time_cs % 100) * 10 * NSEC_PER_MSEC;
|
|
Kmods SIG |
9e3ffb |
} else
|
|
Kmods SIG |
9e3ffb |
ts->tv_nsec = 0;
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
@@ -101,7 +101,7 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
/* Convert linear UNIX date to a EXFAT time/date pair. */
|
|
Kmods SIG |
9e3ffb |
void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
|
|
Kmods SIG |
9e3ffb |
- u8 *tz, __le16 *time, __le16 *date, u8 *time_ms)
|
|
Kmods SIG |
9e3ffb |
+ u8 *tz, __le16 *time, __le16 *date, u8 *time_cs)
|
|
Kmods SIG |
9e3ffb |
{
|
|
Kmods SIG |
9e3ffb |
struct tm tm;
|
|
Kmods SIG |
9e3ffb |
u16 t, d;
|
|
Kmods SIG |
9e3ffb |
@@ -113,9 +113,9 @@ void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
|
|
Kmods SIG |
9e3ffb |
*time = cpu_to_le16(t);
|
|
Kmods SIG |
9e3ffb |
*date = cpu_to_le16(d);
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
- /* time_ms field represent 0 ~ 199(1990 ms) */
|
|
Kmods SIG |
9e3ffb |
- if (time_ms)
|
|
Kmods SIG |
9e3ffb |
- *time_ms = (tm.tm_sec & 1) * 100 +
|
|
Kmods SIG |
9e3ffb |
+ /* time_cs field represent 0 ~ 199cs(1990 ms) */
|
|
Kmods SIG |
9e3ffb |
+ if (time_cs)
|
|
Kmods SIG |
9e3ffb |
+ *time_cs = (tm.tm_sec & 1) * 100 +
|
|
Kmods SIG |
9e3ffb |
ts->tv_nsec / (10 * NSEC_PER_MSEC);
|
|
Kmods SIG |
9e3ffb |
|
|
Kmods SIG |
9e3ffb |
/*
|
|
Kmods SIG |
9e3ffb |
diff --git a/src/namei.c b/src/namei.c
|
|
Kmods SIG |
9e3ffb |
index fa926b9c883adf353f3e911d96d6efcd71677dcc..48f4df883f3ba5a30219f8f038a025530a8f8fa2 100644
|
|
Kmods SIG |
9e3ffb |
--- a/src/namei.c
|
|
Kmods SIG |
9e3ffb |
+++ b/src/namei.c
|
|
Kmods SIG |
9e3ffb |
@@ -689,12 +689,12 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.create_tz,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.create_time,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.create_date,
|
|
Kmods SIG |
9e3ffb |
- ep->dentry.file.create_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ ep->dentry.file.create_time_cs);
|
|
Kmods SIG |
9e3ffb |
exfat_get_entry_time(sbi, &info->mtime,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.modify_tz,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.modify_time,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.modify_date,
|
|
Kmods SIG |
9e3ffb |
- ep->dentry.file.modify_time_ms);
|
|
Kmods SIG |
9e3ffb |
+ ep->dentry.file.modify_time_cs);
|
|
Kmods SIG |
9e3ffb |
exfat_get_entry_time(sbi, &info->atime,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.access_tz,
|
|
Kmods SIG |
9e3ffb |
ep->dentry.file.access_time,
|
|
Kmods SIG |
9e3ffb |
--
|
|
Kmods SIG |
9e3ffb |
2.31.1
|
|
Kmods SIG |
9e3ffb |
|