|
16 | 16 | #include <linux/mount.h>
|
17 | 17 | #include <linux/fs.h>
|
18 | 18 | #include <linux/namei.h>
|
19 |
| -#ifndef KSU_HAS_PATH_UMOUNT |
| 19 | +#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)) && !defined(KSU_HAS_PATH_UMOUNT) |
20 | 20 | #include <linux/syscalls.h> // sys_umount
|
21 | 21 | #endif
|
22 | 22 |
|
@@ -510,13 +510,11 @@ static bool should_umount(struct path *path)
|
510 | 510 | return false;
|
511 | 511 | }
|
512 | 512 |
|
513 |
| -#ifdef KSU_HAS_PATH_UMOUNT |
514 |
| -static void ksu_umount_mnt(struct path *path, int flags) |
| 513 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || defined(KSU_HAS_PATH_UMOUNT) |
| 514 | +static void ksu_path_umount(const char *mnt, struct path *path, int flags) |
515 | 515 | {
|
516 | 516 | int err = path_umount(path, flags);
|
517 |
| - if (err) { |
518 |
| - pr_info("umount %s failed: %d\n", path->dentry->d_iname, err); |
519 |
| - } |
| 517 | + pr_info("%s: path: %s code: %d\n", __func__, mnt, err); |
520 | 518 | }
|
521 | 519 | #else
|
522 | 520 | static void ksu_sys_umount(const char *mnt, int flags)
|
@@ -555,8 +553,8 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
|
555 | 553 | return;
|
556 | 554 | }
|
557 | 555 |
|
558 |
| -#ifdef KSU_HAS_PATH_UMOUNT |
559 |
| - ksu_umount_mnt(&path, flags); |
| 556 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || defined(KSU_HAS_PATH_UMOUNT) |
| 557 | + ksu_path_umount(mnt, &path, flags); |
560 | 558 | // dont call path_put here!!
|
561 | 559 | // path_umount releases ref for us
|
562 | 560 | #else
|
|
0 commit comments