Skip to content

Instantly share code, notes, and snippets.

@nanpuyue
Created May 26, 2018 07:20
Show Gist options
  • Save nanpuyue/b75f89987e8923faaba20425672f8108 to your computer and use it in GitHub Desktop.
Save nanpuyue/b75f89987e8923faaba20425672f8108 to your computer and use it in GitHub Desktop.
date: 2018-05-26
license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
author: nanpuyue <[email protected]> https://blog.nanpuyue.com
source:http://dl.paragon-software.com/free/Paragon-715-FRE_NTFS_Linux_9.5_Express.tar.gz
---
diff -u a/ifslinux/ufsdvfs.c b/ifslinux/ufsdvfs.c
--- a/ifslinux/ufsdvfs.c 2017-09-09 00:06:41.000000000 +0800
+++ b/ifslinux/ufsdvfs.c 2018-05-26 14:39:23.392496043 +0800
@@ -112,6 +112,10 @@
#include <linux/kthread.h>
#include <asm/div64.h> // this file defines macros 'do_div'
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+ #define global_page_state global_zone_page_state
+#endif
+
#include "config.h"
#include "ufsdapi.h"
#include "vfsdebug.h"
@@ -8611,6 +8615,8 @@
#ifdef BIO_UPTODATE
err = !test_bit( BIO_UPTODATE, &bio->bi_flags );
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
+ int err = bio->bi_status;
#else
// 4.3+
int err = bio->bi_error;
@@ -8662,6 +8668,8 @@
struct bio_vec *bvec = &bio->bi_io_vec[bio->bi_vcnt-1];
#ifdef BIO_UPTODATE
err = !test_bit( BIO_UPTODATE, &bio->bi_flags );
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
+ int err = bio->bi_status;
#else
// 4.3+
int err = bio->bi_error;
@@ -8704,7 +8712,11 @@
struct bio *bio = bio_alloc( GFP_NOFS|__GFP_HIGH, nr_vecs ); // GFP_NOIO
if ( likely( NULL != bio ) ) {
BIO_BISECTOR( bio ) = first_sector;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 13, 0)
bio->bi_bdev = bdev;
+#else
+ bio_set_dev(bio, bdev);
+#endif
DebugTrace( 0, UFSD_LEVEL_BIO, ("bio+: o=%" PSCT "x", first_sector << 9 ));
return bio;
@nanpuyue
Copy link
Author

paragon-ufsd kernel 4.14 patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment