exfat: replace 'time_ms' with 'time_cs'
authorTetsuhiro Kohada <kohada.t2@gmail.com>
Tue, 21 Apr 2020 23:30:56 +0000 (08:30 +0900)
committerNamjae Jeon <namjae.jeon@samsung.com>
Tue, 9 Jun 2020 07:49:00 +0000 (16:49 +0900)
Replace time_ms  with time_cs in the file directory entry structure
and related functions.

The unit of create_time_ms/modify_time_ms in File Directory Entry are not
'milli-second', but 'centi-second'.
The exfat specification uses the term '10ms', but instead use 'cs' as in
msdos_fs.h.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
fs/exfat/dir.c
fs/exfat/exfat_fs.h
fs/exfat/exfat_raw.h
fs/exfat/file.c
fs/exfat/inode.c
fs/exfat/misc.c
fs/exfat/namei.c

index 53ae965da7ec583fb4e31cc548c40daf08ae941a..b5a237c33d50c02c632ec82627f78b4e70507d7a 100644 (file)
@@ -137,12 +137,12 @@ static int exfat_readdir(struct inode *inode, struct exfat_dir_entry *dir_entry)
                                        ep->dentry.file.create_tz,
                                        ep->dentry.file.create_time,
                                        ep->dentry.file.create_date,
-                                       ep->dentry.file.create_time_ms);
+                                       ep->dentry.file.create_time_cs);
                        exfat_get_entry_time(sbi, &dir_entry->mtime,
                                        ep->dentry.file.modify_tz,
                                        ep->dentry.file.modify_time,
                                        ep->dentry.file.modify_date,
-                                       ep->dentry.file.modify_time_ms);
+                                       ep->dentry.file.modify_time_cs);
                        exfat_get_entry_time(sbi, &dir_entry->atime,
                                        ep->dentry.file.access_tz,
                                        ep->dentry.file.access_time,
@@ -461,12 +461,12 @@ int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
                        &ep->dentry.file.create_tz,
                        &ep->dentry.file.create_time,
                        &ep->dentry.file.create_date,
-                       &ep->dentry.file.create_time_ms);
+                       &ep->dentry.file.create_time_cs);
        exfat_set_entry_time(sbi, &ts,
                        &ep->dentry.file.modify_tz,
                        &ep->dentry.file.modify_time,
                        &ep->dentry.file.modify_date,
-                       &ep->dentry.file.modify_time_ms);
+                       &ep->dentry.file.modify_time_cs);
        exfat_set_entry_time(sbi, &ts,
                        &ep->dentry.file.access_tz,
                        &ep->dentry.file.access_time,
index 3862df6af7386bd5e54ed338cedcee64c3cb6ddd..294aa7792bc3ca6c7e334110cba9160577d9affe 100644 (file)
@@ -511,10 +511,10 @@ void exfat_msg(struct super_block *sb, const char *lv, const char *fmt, ...)
        exfat_msg(sb, KERN_INFO, fmt, ##__VA_ARGS__)
 
 void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
-               u8 tz, __le16 time, __le16 date, u8 time_ms);
+               u8 tz, __le16 time, __le16 date, u8 time_cs);
 void exfat_truncate_atime(struct timespec64 *ts);
 void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
-               u8 *tz, __le16 *time, __le16 *date, u8 *time_ms);
+               u8 *tz, __le16 *time, __le16 *date, u8 *time_cs);
 unsigned short exfat_calc_chksum_2byte(void *data, int len,
                unsigned short chksum, int type);
 void exfat_update_bh(struct super_block *sb, struct buffer_head *bh, int sync);
index 2a841010e6490ccafd5d12844a48a93fc6ee4bbf..8d6c64a7546d8bc8899e677bfd7f9d91f4e0cb4d 100644 (file)
@@ -136,8 +136,8 @@ struct exfat_dentry {
                        __le16 modify_date;
                        __le16 access_time;
                        __le16 access_date;
-                       __u8 create_time_ms;
-                       __u8 modify_time_ms;
+                       __u8 create_time_cs;
+                       __u8 modify_time_cs;
                        __u8 create_tz;
                        __u8 modify_tz;
                        __u8 access_tz;
index c9db8eb0cfc3ee267d5e3b051974ceae8de861b5..84f3d31a3a555729b5d2e655f354929018b6b290 100644 (file)
@@ -165,7 +165,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size)
                                &ep->dentry.file.modify_tz,
                                &ep->dentry.file.modify_time,
                                &ep->dentry.file.modify_date,
-                               &ep->dentry.file.modify_time_ms);
+                               &ep->dentry.file.modify_time_cs);
                ep->dentry.file.attr = cpu_to_le16(ei->attr);
 
                /* File size should be zero if there is no cluster allocated */
index 06887492f54b791506d2f7c76eb3ef073b72026d..3f367d081cd6dfe6c7cdb475d77e130b64d14d6d 100644 (file)
@@ -56,12 +56,12 @@ static int __exfat_write_inode(struct inode *inode, int sync)
                        &ep->dentry.file.create_tz,
                        &ep->dentry.file.create_time,
                        &ep->dentry.file.create_date,
-                       &ep->dentry.file.create_time_ms);
+                       &ep->dentry.file.create_time_cs);
        exfat_set_entry_time(sbi, &inode->i_mtime,
                        &ep->dentry.file.modify_tz,
                        &ep->dentry.file.modify_time,
                        &ep->dentry.file.modify_date,
-                       &ep->dentry.file.modify_time_ms);
+                       &ep->dentry.file.modify_time_cs);
        exfat_set_entry_time(sbi, &inode->i_atime,
                        &ep->dentry.file.access_tz,
                        &ep->dentry.file.access_time,
index ce5e8a1b0726c6778db86daebe39c437f23c7fba..ab7f88b1f6d3065cd3fca409526d50e833bbbfb0 100644 (file)
@@ -75,7 +75,7 @@ static void exfat_adjust_tz(struct timespec64 *ts, u8 tz_off)
 
 /* Convert a EXFAT time/date pair to a UNIX date (seconds since 1 1 70). */
 void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
-               u8 tz, __le16 time, __le16 date, u8 time_ms)
+               u8 tz, __le16 time, __le16 date, u8 time_cs)
 {
        u16 t = le16_to_cpu(time);
        u16 d = le16_to_cpu(date);
@@ -84,10 +84,10 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
                              t >> 11, (t >> 5) & 0x003F, (t & 0x001F) << 1);
 
 
-       /* time_ms field represent 0 ~ 199(1990 ms) */
-       if (time_ms) {
-               ts->tv_sec += time_ms / 100;
-               ts->tv_nsec = (time_ms % 100) * 10 * NSEC_PER_MSEC;
+       /* time_cs field represent 0 ~ 199cs(1990 ms) */
+       if (time_cs) {
+               ts->tv_sec += time_cs / 100;
+               ts->tv_nsec = (time_cs % 100) * 10 * NSEC_PER_MSEC;
        } else
                ts->tv_nsec = 0;
 
@@ -101,7 +101,7 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
 
 /* Convert linear UNIX date to a EXFAT time/date pair. */
 void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
-               u8 *tz, __le16 *time, __le16 *date, u8 *time_ms)
+               u8 *tz, __le16 *time, __le16 *date, u8 *time_cs)
 {
        struct tm tm;
        u16 t, d;
@@ -113,9 +113,9 @@ void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
        *time = cpu_to_le16(t);
        *date = cpu_to_le16(d);
 
-       /* time_ms field represent 0 ~ 199(1990 ms) */
-       if (time_ms)
-               *time_ms = (tm.tm_sec & 1) * 100 +
+       /* time_cs field represent 0 ~ 199cs(1990 ms) */
+       if (time_cs)
+               *time_cs = (tm.tm_sec & 1) * 100 +
                        ts->tv_nsec / (10 * NSEC_PER_MSEC);
 
        /*
index fa926b9c883adf353f3e911d96d6efcd71677dcc..48f4df883f3ba5a30219f8f038a025530a8f8fa2 100644 (file)
@@ -689,12 +689,12 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
                                ep->dentry.file.create_tz,
                                ep->dentry.file.create_time,
                                ep->dentry.file.create_date,
-                               ep->dentry.file.create_time_ms);
+                               ep->dentry.file.create_time_cs);
                exfat_get_entry_time(sbi, &info->mtime,
                                ep->dentry.file.modify_tz,
                                ep->dentry.file.modify_time,
                                ep->dentry.file.modify_date,
-                               ep->dentry.file.modify_time_ms);
+                               ep->dentry.file.modify_time_cs);
                exfat_get_entry_time(sbi, &info->atime,
                                ep->dentry.file.access_tz,
                                ep->dentry.file.access_time,