Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux 4.18/4.20 fix #137

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions exfat_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,13 @@ static time_t accum_days_in_year[] = {
static void _exfat_truncate(struct inode *inode, loff_t old_size);

/* Convert a FAT time/date pair to a UNIX date (seconds since 1 1 70). */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,01)
void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec64 *ts,
DATE_TIME_T *tp)
#else
void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
DATE_TIME_T *tp)
#endif
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be:

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,18,01)
#define timespec64 timespec
#endif

a good idea?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to the repo owner I guess

Also this change is because of this commit
torvalds/linux@95582b0

Which went into kernel v4.18-rc1 so maybe use KERNEL_VERSION(4,18) as the test

You want me to use your change and resubmit the pr?

{
time_t year = tp->Year;
time_t ld;
Expand All @@ -166,8 +171,13 @@ void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
}

/* Convert linear UNIX date to a FAT time/date pair. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,01)
void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec64 *ts,
DATE_TIME_T *tp)
#else
void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
DATE_TIME_T *tp)
#endif
{
time_t second = ts->tv_sec;
time_t day, month, year;
Expand Down