Skip to content

Commit ed0f84d

Browse files
Tetsuhiro Kohadanamjaejeon
authored andcommitted
exfat: replace 'time_ms' with 'time_cs'
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 <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent cdc0612 commit ed0f84d

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

fs/exfat/dir.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ static int exfat_readdir(struct inode *inode, struct exfat_dir_entry *dir_entry)
137137
ep->dentry.file.create_tz,
138138
ep->dentry.file.create_time,
139139
ep->dentry.file.create_date,
140-
ep->dentry.file.create_time_ms);
140+
ep->dentry.file.create_time_cs);
141141
exfat_get_entry_time(sbi, &dir_entry->mtime,
142142
ep->dentry.file.modify_tz,
143143
ep->dentry.file.modify_time,
144144
ep->dentry.file.modify_date,
145-
ep->dentry.file.modify_time_ms);
145+
ep->dentry.file.modify_time_cs);
146146
exfat_get_entry_time(sbi, &dir_entry->atime,
147147
ep->dentry.file.access_tz,
148148
ep->dentry.file.access_time,
@@ -461,12 +461,12 @@ int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
461461
&ep->dentry.file.create_tz,
462462
&ep->dentry.file.create_time,
463463
&ep->dentry.file.create_date,
464-
&ep->dentry.file.create_time_ms);
464+
&ep->dentry.file.create_time_cs);
465465
exfat_set_entry_time(sbi, &ts,
466466
&ep->dentry.file.modify_tz,
467467
&ep->dentry.file.modify_time,
468468
&ep->dentry.file.modify_date,
469-
&ep->dentry.file.modify_time_ms);
469+
&ep->dentry.file.modify_time_cs);
470470
exfat_set_entry_time(sbi, &ts,
471471
&ep->dentry.file.access_tz,
472472
&ep->dentry.file.access_time,

fs/exfat/exfat_fs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ void exfat_msg(struct super_block *sb, const char *lv, const char *fmt, ...)
511511
exfat_msg(sb, KERN_INFO, fmt, ##__VA_ARGS__)
512512

513513
void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
514-
u8 tz, __le16 time, __le16 date, u8 time_ms);
514+
u8 tz, __le16 time, __le16 date, u8 time_cs);
515515
void exfat_truncate_atime(struct timespec64 *ts);
516516
void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
517-
u8 *tz, __le16 *time, __le16 *date, u8 *time_ms);
517+
u8 *tz, __le16 *time, __le16 *date, u8 *time_cs);
518518
unsigned short exfat_calc_chksum_2byte(void *data, int len,
519519
unsigned short chksum, int type);
520520
void exfat_update_bh(struct super_block *sb, struct buffer_head *bh, int sync);

fs/exfat/exfat_raw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ struct exfat_dentry {
136136
__le16 modify_date;
137137
__le16 access_time;
138138
__le16 access_date;
139-
__u8 create_time_ms;
140-
__u8 modify_time_ms;
139+
__u8 create_time_cs;
140+
__u8 modify_time_cs;
141141
__u8 create_tz;
142142
__u8 modify_tz;
143143
__u8 access_tz;

fs/exfat/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size)
165165
&ep->dentry.file.modify_tz,
166166
&ep->dentry.file.modify_time,
167167
&ep->dentry.file.modify_date,
168-
&ep->dentry.file.modify_time_ms);
168+
&ep->dentry.file.modify_time_cs);
169169
ep->dentry.file.attr = cpu_to_le16(ei->attr);
170170

171171
/* File size should be zero if there is no cluster allocated */

fs/exfat/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ static int __exfat_write_inode(struct inode *inode, int sync)
5656
&ep->dentry.file.create_tz,
5757
&ep->dentry.file.create_time,
5858
&ep->dentry.file.create_date,
59-
&ep->dentry.file.create_time_ms);
59+
&ep->dentry.file.create_time_cs);
6060
exfat_set_entry_time(sbi, &inode->i_mtime,
6161
&ep->dentry.file.modify_tz,
6262
&ep->dentry.file.modify_time,
6363
&ep->dentry.file.modify_date,
64-
&ep->dentry.file.modify_time_ms);
64+
&ep->dentry.file.modify_time_cs);
6565
exfat_set_entry_time(sbi, &inode->i_atime,
6666
&ep->dentry.file.access_tz,
6767
&ep->dentry.file.access_time,

fs/exfat/misc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void exfat_adjust_tz(struct timespec64 *ts, u8 tz_off)
7575

7676
/* Convert a EXFAT time/date pair to a UNIX date (seconds since 1 1 70). */
7777
void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
78-
u8 tz, __le16 time, __le16 date, u8 time_ms)
78+
u8 tz, __le16 time, __le16 date, u8 time_cs)
7979
{
8080
u16 t = le16_to_cpu(time);
8181
u16 d = le16_to_cpu(date);
@@ -84,10 +84,10 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
8484
t >> 11, (t >> 5) & 0x003F, (t & 0x001F) << 1);
8585

8686

87-
/* time_ms field represent 0 ~ 199(1990 ms) */
88-
if (time_ms) {
89-
ts->tv_sec += time_ms / 100;
90-
ts->tv_nsec = (time_ms % 100) * 10 * NSEC_PER_MSEC;
87+
/* time_cs field represent 0 ~ 199cs(1990 ms) */
88+
if (time_cs) {
89+
ts->tv_sec += time_cs / 100;
90+
ts->tv_nsec = (time_cs % 100) * 10 * NSEC_PER_MSEC;
9191
} else
9292
ts->tv_nsec = 0;
9393

@@ -101,7 +101,7 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
101101

102102
/* Convert linear UNIX date to a EXFAT time/date pair. */
103103
void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
104-
u8 *tz, __le16 *time, __le16 *date, u8 *time_ms)
104+
u8 *tz, __le16 *time, __le16 *date, u8 *time_cs)
105105
{
106106
struct tm tm;
107107
u16 t, d;
@@ -113,9 +113,9 @@ void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
113113
*time = cpu_to_le16(t);
114114
*date = cpu_to_le16(d);
115115

116-
/* time_ms field represent 0 ~ 199(1990 ms) */
117-
if (time_ms)
118-
*time_ms = (tm.tm_sec & 1) * 100 +
116+
/* time_cs field represent 0 ~ 199cs(1990 ms) */
117+
if (time_cs)
118+
*time_cs = (tm.tm_sec & 1) * 100 +
119119
ts->tv_nsec / (10 * NSEC_PER_MSEC);
120120

121121
/*

fs/exfat/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,12 +689,12 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
689689
ep->dentry.file.create_tz,
690690
ep->dentry.file.create_time,
691691
ep->dentry.file.create_date,
692-
ep->dentry.file.create_time_ms);
692+
ep->dentry.file.create_time_cs);
693693
exfat_get_entry_time(sbi, &info->mtime,
694694
ep->dentry.file.modify_tz,
695695
ep->dentry.file.modify_time,
696696
ep->dentry.file.modify_date,
697-
ep->dentry.file.modify_time_ms);
697+
ep->dentry.file.modify_time_cs);
698698
exfat_get_entry_time(sbi, &info->atime,
699699
ep->dentry.file.access_tz,
700700
ep->dentry.file.access_time,

0 commit comments

Comments
 (0)