hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/ntfs/super.c
....@@ -1,23 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project.
34 *
45 * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.
56 * 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
217 */
228 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
239
....@@ -1489,7 +1475,7 @@
14891475 kfree(name);
14901476 /* Get the inode. */
14911477 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))) {
14931479 if (!IS_ERR(tmp_ino))
14941480 iput(tmp_ino);
14951481 ntfs_error(vol->sb, "Failed to load $UsnJrnl.");
....@@ -2106,7 +2092,8 @@
21062092 // TODO: Initialize security.
21072093 /* Get the extended system files' directory inode. */
21082094 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)) {
21102097 if (!IS_ERR(vol->extend_ino))
21112098 iput(vol->extend_ino);
21122099 ntfs_error(sb, "Failed to load $Extend.");
....@@ -2657,8 +2644,7 @@
26572644 * the least significant 32-bits in f_fsid[0] and the most significant
26582645 * 32-bits in f_fsid[1].
26592646 */
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);
26622648 /* Maximum length of filenames. */
26632649 sfs->f_namelen = NTFS_MAX_NAME_LEN;
26642650 return 0;
....@@ -2676,7 +2662,7 @@
26762662 */
26772663 static const struct super_operations ntfs_sops = {
26782664 .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. */
26802666 #ifdef NTFS_RW
26812667 .write_inode = ntfs_write_inode, /* VFS: Write dirty inode to
26822668 disk. */
....@@ -3201,6 +3187,7 @@
32013187 MODULE_DESCRIPTION("NTFS 1.2/3.x driver - Copyright (c) 2001-2014 Anton Altaparmakov and Tuxera Inc.");
32023188 MODULE_VERSION(NTFS_VERSION);
32033189 MODULE_LICENSE("GPL");
3190
+MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY);
32043191 #ifdef DEBUG
32053192 module_param(debug_msgs, bint, 0);
32063193 MODULE_PARM_DESC(debug_msgs, "Enable debug messages.");