| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/fs/hfsplus/super.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 18 | 19 | #include <linux/nls.h> |
|---|
| 19 | 20 | |
|---|
| 20 | 21 | 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); |
|---|
| 22 | 23 | |
|---|
| 23 | 24 | #include "hfsplus_fs.h" |
|---|
| 24 | 25 | #include "xattr.h" |
|---|
| .. | .. |
|---|
| 238 | 239 | mutex_unlock(&sbi->vh_mutex); |
|---|
| 239 | 240 | |
|---|
| 240 | 241 | 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); |
|---|
| 242 | 243 | |
|---|
| 243 | 244 | return error; |
|---|
| 244 | 245 | } |
|---|
| .. | .. |
|---|
| 294 | 295 | hfsplus_sync_fs(sb, 1); |
|---|
| 295 | 296 | } |
|---|
| 296 | 297 | |
|---|
| 298 | + iput(sbi->alloc_file); |
|---|
| 299 | + iput(sbi->hidden_dir); |
|---|
| 297 | 300 | hfs_btree_close(sbi->attr_tree); |
|---|
| 298 | 301 | hfs_btree_close(sbi->cat_tree); |
|---|
| 299 | 302 | hfs_btree_close(sbi->ext_tree); |
|---|
| 300 | | - iput(sbi->alloc_file); |
|---|
| 301 | | - iput(sbi->hidden_dir); |
|---|
| 302 | 303 | kfree(sbi->s_vhdr_buf); |
|---|
| 303 | 304 | kfree(sbi->s_backup_vhdr_buf); |
|---|
| 304 | 305 | unload_nls(sbi->nls); |
|---|
| .. | .. |
|---|
| 319 | 320 | buf->f_bavail = buf->f_bfree; |
|---|
| 320 | 321 | buf->f_files = 0xFFFFFFFF; |
|---|
| 321 | 322 | 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); |
|---|
| 324 | 324 | buf->f_namelen = HFSPLUS_MAX_STRLEN; |
|---|
| 325 | 325 | |
|---|
| 326 | 326 | return 0; |
|---|
| .. | .. |
|---|
| 361 | 361 | |
|---|
| 362 | 362 | static const struct super_operations hfsplus_sops = { |
|---|
| 363 | 363 | .alloc_inode = hfsplus_alloc_inode, |
|---|
| 364 | | - .destroy_inode = hfsplus_destroy_inode, |
|---|
| 364 | + .free_inode = hfsplus_free_inode, |
|---|
| 365 | 365 | .write_inode = hfsplus_write_inode, |
|---|
| 366 | 366 | .evict_inode = hfsplus_evict_inode, |
|---|
| 367 | 367 | .put_super = hfsplus_put_super, |
|---|
| .. | .. |
|---|
| 617 | 617 | MODULE_AUTHOR("Brad Boyer"); |
|---|
| 618 | 618 | MODULE_DESCRIPTION("Extended Macintosh Filesystem"); |
|---|
| 619 | 619 | MODULE_LICENSE("GPL"); |
|---|
| 620 | +MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY); |
|---|
| 620 | 621 | |
|---|
| 621 | 622 | static struct kmem_cache *hfsplus_inode_cachep; |
|---|
| 622 | 623 | |
|---|
| .. | .. |
|---|
| 628 | 629 | return i ? &i->vfs_inode : NULL; |
|---|
| 629 | 630 | } |
|---|
| 630 | 631 | |
|---|
| 631 | | -static void hfsplus_i_callback(struct rcu_head *head) |
|---|
| 632 | +static void hfsplus_free_inode(struct inode *inode) |
|---|
| 632 | 633 | { |
|---|
| 633 | | - struct inode *inode = container_of(head, struct inode, i_rcu); |
|---|
| 634 | | - |
|---|
| 635 | 634 | 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); |
|---|
| 641 | 635 | } |
|---|
| 642 | 636 | |
|---|
| 643 | 637 | #define HFSPLUS_INODE_SIZE sizeof(struct hfsplus_inode_info) |
|---|