| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. |
|---|
| 5 | 6 | * Copyright (c) 2001,2002 Richard Russon |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program/include file is free software; you can redistribute it and/or |
|---|
| 8 | | - * modify it under the terms of the GNU General Public License as published |
|---|
| 9 | | - * by the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | | - * (at your option) any later version. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program/include file is distributed in the hope that it will be |
|---|
| 13 | | - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
|---|
| 14 | | - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | | - * GNU General Public License for more details. |
|---|
| 16 | | - * |
|---|
| 17 | | - * You should have received a copy of the GNU General Public License |
|---|
| 18 | | - * along with this program (in the main directory of the Linux-NTFS |
|---|
| 19 | | - * distribution in the file COPYING); if not, write to the Free Software |
|---|
| 20 | | - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 21 | 7 | */ |
|---|
| 22 | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| 23 | 9 | |
|---|
| .. | .. |
|---|
| 1489 | 1475 | kfree(name); |
|---|
| 1490 | 1476 | /* Get the inode. */ |
|---|
| 1491 | 1477 | tmp_ino = ntfs_iget(vol->sb, MREF(mref)); |
|---|
| 1492 | | - if (unlikely(IS_ERR(tmp_ino) || is_bad_inode(tmp_ino))) { |
|---|
| 1478 | + if (IS_ERR(tmp_ino) || unlikely(is_bad_inode(tmp_ino))) { |
|---|
| 1493 | 1479 | if (!IS_ERR(tmp_ino)) |
|---|
| 1494 | 1480 | iput(tmp_ino); |
|---|
| 1495 | 1481 | ntfs_error(vol->sb, "Failed to load $UsnJrnl."); |
|---|
| .. | .. |
|---|
| 2106 | 2092 | // TODO: Initialize security. |
|---|
| 2107 | 2093 | /* Get the extended system files' directory inode. */ |
|---|
| 2108 | 2094 | vol->extend_ino = ntfs_iget(sb, FILE_Extend); |
|---|
| 2109 | | - if (IS_ERR(vol->extend_ino) || is_bad_inode(vol->extend_ino)) { |
|---|
| 2095 | + if (IS_ERR(vol->extend_ino) || is_bad_inode(vol->extend_ino) || |
|---|
| 2096 | + !S_ISDIR(vol->extend_ino->i_mode)) { |
|---|
| 2110 | 2097 | if (!IS_ERR(vol->extend_ino)) |
|---|
| 2111 | 2098 | iput(vol->extend_ino); |
|---|
| 2112 | 2099 | ntfs_error(sb, "Failed to load $Extend."); |
|---|
| .. | .. |
|---|
| 2657 | 2644 | * the least significant 32-bits in f_fsid[0] and the most significant |
|---|
| 2658 | 2645 | * 32-bits in f_fsid[1]. |
|---|
| 2659 | 2646 | */ |
|---|
| 2660 | | - sfs->f_fsid.val[0] = vol->serial_no & 0xffffffff; |
|---|
| 2661 | | - sfs->f_fsid.val[1] = (vol->serial_no >> 32) & 0xffffffff; |
|---|
| 2647 | + sfs->f_fsid = u64_to_fsid(vol->serial_no); |
|---|
| 2662 | 2648 | /* Maximum length of filenames. */ |
|---|
| 2663 | 2649 | sfs->f_namelen = NTFS_MAX_NAME_LEN; |
|---|
| 2664 | 2650 | return 0; |
|---|
| .. | .. |
|---|
| 2676 | 2662 | */ |
|---|
| 2677 | 2663 | static const struct super_operations ntfs_sops = { |
|---|
| 2678 | 2664 | .alloc_inode = ntfs_alloc_big_inode, /* VFS: Allocate new inode. */ |
|---|
| 2679 | | - .destroy_inode = ntfs_destroy_big_inode, /* VFS: Deallocate inode. */ |
|---|
| 2665 | + .free_inode = ntfs_free_big_inode, /* VFS: Deallocate inode. */ |
|---|
| 2680 | 2666 | #ifdef NTFS_RW |
|---|
| 2681 | 2667 | .write_inode = ntfs_write_inode, /* VFS: Write dirty inode to |
|---|
| 2682 | 2668 | disk. */ |
|---|
| .. | .. |
|---|
| 3201 | 3187 | MODULE_DESCRIPTION("NTFS 1.2/3.x driver - Copyright (c) 2001-2014 Anton Altaparmakov and Tuxera Inc."); |
|---|
| 3202 | 3188 | MODULE_VERSION(NTFS_VERSION); |
|---|
| 3203 | 3189 | MODULE_LICENSE("GPL"); |
|---|
| 3190 | +MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY); |
|---|
| 3204 | 3191 | #ifdef DEBUG |
|---|
| 3205 | 3192 | module_param(debug_msgs, bint, 0); |
|---|
| 3206 | 3193 | MODULE_PARM_DESC(debug_msgs, "Enable debug messages."); |
|---|