forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/fs/hfsplus/super.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/fs/hfsplus/super.c
34 *
....@@ -18,7 +19,7 @@
1819 #include <linux/nls.h>
1920
2021 static struct inode *hfsplus_alloc_inode(struct super_block *sb);
21
-static void hfsplus_destroy_inode(struct inode *inode);
22
+static void hfsplus_free_inode(struct inode *inode);
2223
2324 #include "hfsplus_fs.h"
2425 #include "xattr.h"
....@@ -238,7 +239,7 @@
238239 mutex_unlock(&sbi->vh_mutex);
239240
240241 if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags))
241
- blkdev_issue_flush(sb->s_bdev, GFP_KERNEL, NULL);
242
+ blkdev_issue_flush(sb->s_bdev, GFP_KERNEL);
242243
243244 return error;
244245 }
....@@ -294,11 +295,11 @@
294295 hfsplus_sync_fs(sb, 1);
295296 }
296297
298
+ iput(sbi->alloc_file);
299
+ iput(sbi->hidden_dir);
297300 hfs_btree_close(sbi->attr_tree);
298301 hfs_btree_close(sbi->cat_tree);
299302 hfs_btree_close(sbi->ext_tree);
300
- iput(sbi->alloc_file);
301
- iput(sbi->hidden_dir);
302303 kfree(sbi->s_vhdr_buf);
303304 kfree(sbi->s_backup_vhdr_buf);
304305 unload_nls(sbi->nls);
....@@ -319,8 +320,7 @@
319320 buf->f_bavail = buf->f_bfree;
320321 buf->f_files = 0xFFFFFFFF;
321322 buf->f_ffree = 0xFFFFFFFF - sbi->next_cnid;
322
- buf->f_fsid.val[0] = (u32)id;
323
- buf->f_fsid.val[1] = (u32)(id >> 32);
323
+ buf->f_fsid = u64_to_fsid(id);
324324 buf->f_namelen = HFSPLUS_MAX_STRLEN;
325325
326326 return 0;
....@@ -361,7 +361,7 @@
361361
362362 static const struct super_operations hfsplus_sops = {
363363 .alloc_inode = hfsplus_alloc_inode,
364
- .destroy_inode = hfsplus_destroy_inode,
364
+ .free_inode = hfsplus_free_inode,
365365 .write_inode = hfsplus_write_inode,
366366 .evict_inode = hfsplus_evict_inode,
367367 .put_super = hfsplus_put_super,
....@@ -617,6 +617,7 @@
617617 MODULE_AUTHOR("Brad Boyer");
618618 MODULE_DESCRIPTION("Extended Macintosh Filesystem");
619619 MODULE_LICENSE("GPL");
620
+MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY);
620621
621622 static struct kmem_cache *hfsplus_inode_cachep;
622623
....@@ -628,16 +629,9 @@
628629 return i ? &i->vfs_inode : NULL;
629630 }
630631
631
-static void hfsplus_i_callback(struct rcu_head *head)
632
+static void hfsplus_free_inode(struct inode *inode)
632633 {
633
- struct inode *inode = container_of(head, struct inode, i_rcu);
634
-
635634 kmem_cache_free(hfsplus_inode_cachep, HFSPLUS_I(inode));
636
-}
637
-
638
-static void hfsplus_destroy_inode(struct inode *inode)
639
-{
640
- call_rcu(&inode->i_rcu, hfsplus_i_callback);
641635 }
642636
643637 #define HFSPLUS_INODE_SIZE sizeof(struct hfsplus_inode_info)