summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc.c7
-rw-r--r--sdfat.c6
-rw-r--r--sdfat_fs.h3
-rw-r--r--version.h2
4 files changed, 16 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index 6d76162f398c..30d04af7c7c7 100644
--- a/misc.c
+++ b/misc.c
@@ -52,6 +52,13 @@
#define ST_LOG(fmt, ...)
#endif
+/*************************************************************************
+ * FUNCTIONS WHICH HAS KERNEL VERSION DEPENDENCY
+ *************************************************************************/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#define CURRENT_TIME_SEC timespec_trunc(current_kernel_time(), NSEC_PER_SEC)
+#endif
+
/*
* sdfat_fs_error reports a file system problem that might indicate fa data
* corruption/inconsistency. Depending on 'errors' mount option the
diff --git a/sdfat.c b/sdfat.c
index a25055a93098..17971ba3f2ad 100644
--- a/sdfat.c
+++ b/sdfat.c
@@ -147,6 +147,10 @@ static inline void bio_set_dev(struct bio *bio, struct block_device *bdev)
}
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#define CURRENT_TIME_SEC timespec_trunc(current_kernel_time(), NSEC_PER_SEC)
+#endif
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
static int sdfat_getattr(const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int query_flags)
@@ -3711,7 +3715,7 @@ static int sdfat_check_writable(struct super_block *sb)
if (fsapi_check_bdi_valid(sb))
return -EIO;
- if (SDFAT_IS_SB_RDONLY(sb))
+ if (sb->s_flags & MS_RDONLY)
return -EROFS;
return 0;
diff --git a/sdfat_fs.h b/sdfat_fs.h
index 487ac3f8af3a..7044f8549655 100644
--- a/sdfat_fs.h
+++ b/sdfat_fs.h
@@ -33,7 +33,10 @@
#define EXFAT_SUPER_MAGIC (0x2011BAB0UL)
#endif /* EXFAT_SUPER_MAGIC */
+#ifndef SDFAT_SUPER_MAGIC
#define SDFAT_SUPER_MAGIC (0x5EC5DFA4UL)
+#endif /* SDFAT_SUPER_MAGIC */
+
#define SDFAT_ROOT_INO 1
/* FAT types */
diff --git a/version.h b/version.h
index 3cd0b73691ac..c96fcf47b753 100644
--- a/version.h
+++ b/version.h
@@ -22,4 +22,4 @@
/* PURPOSE : sdFAT File Manager */
/* */
/************************************************************************/
-#define SDFAT_VERSION "2.1.8-lineage"
+#define SDFAT_VERSION "2.1.10-lineage"