lede-Heleguo/package/kernel/antfs/patches/001-4.18.patch
2020-02-01 20:48:49 +08:00

77 lines
2.0 KiB
Diff

--- a/dir.c
+++ b/dir.c
@@ -1133,9 +1133,12 @@ static int antfs_setattr(struct dentry *
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
ktime_get_real_ts(&inode->i_mtime);
ktime_get_real_ts(&inode->i_ctime);
+#else
+ ktime_get_real_ts64(&inode->i_mtime);
+ ktime_get_real_ts64(&inode->i_ctime);
#endif
if (inode_needs_sync(inode)) {
sync_mapping_buffers(inode->i_mapping);
--- a/include/ntfstime.h
+++ b/include/ntfstime.h
@@ -47,9 +47,15 @@
*
* Return: A Unix time (number of seconds since 1970, and nanoseconds)
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
static inline struct timespec ntfs2timespec(sle64 ntfstime)
{
struct timespec spec;
+#else
+static inline struct timespec64 ntfs2timespec(sle64 ntfstime)
+{
+ struct timespec64 spec;
+#endif
uint64_t cputime;
cputime = sle64_to_cpu(ntfstime) - NTFS_TIME_OFFSET;
@@ -79,7 +85,11 @@ static inline struct timespec ntfs2times
*
* Return: An NTFS time (100ns units since Jan 1601)
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
static inline sle64 timespec2ntfs(struct timespec spec)
+#else
+static inline sle64 timespec2ntfs(struct timespec64 spec)
+#endif
{
s64 units;
@@ -94,10 +104,15 @@ static inline sle64 timespec2ntfs(struct
static inline sle64 ntfs_current_time(void)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
struct timespec ts;
getnstimeofday(&ts);
+#else
+ struct timespec64 ts;
+ getnstimeofday64(&ts);
+#endif
return timespec2ntfs(ts);
}
--- a/inode.c
+++ b/inode.c
@@ -435,7 +435,11 @@ int antfs_inode_init(struct inode *inode
inode->i_ino ==
(unsigned long)FILE_ROOT))) {
struct antfs_sb_info *sbi = ANTFS_SB(inode->i_sb);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
struct timespec ts;
+#else
+ struct timespec64 ts;
+#endif
/* Init a base mft record ("regular" inode):
* this has to be done in context of either: