| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) International Business Machines Corp., 2000-2004 |
|---|
| 3 | 4 | * Portions Copyright (C) Christoph Hellwig, 2001-2002 |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 7 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | | - * (at your option) any later version. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
|---|
| 13 | | - * the GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, write to the Free Software |
|---|
| 17 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 18 | 5 | */ |
|---|
| 19 | 6 | |
|---|
| 20 | 7 | #include <linux/fs.h> |
|---|
| .. | .. |
|---|
| 50 | 37 | MODULE_DESCRIPTION("The Journaled Filesystem (JFS)"); |
|---|
| 51 | 38 | MODULE_AUTHOR("Steve Best/Dave Kleikamp/Barry Arndt, IBM"); |
|---|
| 52 | 39 | MODULE_LICENSE("GPL"); |
|---|
| 40 | +MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY); |
|---|
| 53 | 41 | |
|---|
| 54 | 42 | static struct kmem_cache *jfs_inode_cachep; |
|---|
| 55 | 43 | |
|---|
| .. | .. |
|---|
| 124 | 112 | return &jfs_inode->vfs_inode; |
|---|
| 125 | 113 | } |
|---|
| 126 | 114 | |
|---|
| 127 | | -static void jfs_i_callback(struct rcu_head *head) |
|---|
| 115 | +static void jfs_free_inode(struct inode *inode) |
|---|
| 128 | 116 | { |
|---|
| 129 | | - struct inode *inode = container_of(head, struct inode, i_rcu); |
|---|
| 130 | | - struct jfs_inode_info *ji = JFS_IP(inode); |
|---|
| 131 | | - kmem_cache_free(jfs_inode_cachep, ji); |
|---|
| 132 | | -} |
|---|
| 133 | | - |
|---|
| 134 | | -static void jfs_destroy_inode(struct inode *inode) |
|---|
| 135 | | -{ |
|---|
| 136 | | - struct jfs_inode_info *ji = JFS_IP(inode); |
|---|
| 137 | | - |
|---|
| 138 | | - BUG_ON(!list_empty(&ji->anon_inode_list)); |
|---|
| 139 | | - |
|---|
| 140 | | - spin_lock_irq(&ji->ag_lock); |
|---|
| 141 | | - if (ji->active_ag != -1) { |
|---|
| 142 | | - struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; |
|---|
| 143 | | - atomic_dec(&bmap->db_active[ji->active_ag]); |
|---|
| 144 | | - ji->active_ag = -1; |
|---|
| 145 | | - } |
|---|
| 146 | | - spin_unlock_irq(&ji->ag_lock); |
|---|
| 147 | | - call_rcu(&inode->i_rcu, jfs_i_callback); |
|---|
| 117 | + kmem_cache_free(jfs_inode_cachep, JFS_IP(inode)); |
|---|
| 148 | 118 | } |
|---|
| 149 | 119 | |
|---|
| 150 | 120 | static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
|---|
| .. | .. |
|---|
| 174 | 144 | buf->f_files = maxinodes; |
|---|
| 175 | 145 | buf->f_ffree = maxinodes - (atomic_read(&imap->im_numinos) - |
|---|
| 176 | 146 | atomic_read(&imap->im_numfree)); |
|---|
| 177 | | - buf->f_fsid.val[0] = (u32)crc32_le(0, sbi->uuid, sizeof(sbi->uuid)/2); |
|---|
| 178 | | - buf->f_fsid.val[1] = (u32)crc32_le(0, sbi->uuid + sizeof(sbi->uuid)/2, |
|---|
| 179 | | - sizeof(sbi->uuid)/2); |
|---|
| 147 | + buf->f_fsid.val[0] = crc32_le(0, (char *)&sbi->uuid, |
|---|
| 148 | + sizeof(sbi->uuid)/2); |
|---|
| 149 | + buf->f_fsid.val[1] = crc32_le(0, |
|---|
| 150 | + (char *)&sbi->uuid + sizeof(sbi->uuid)/2, |
|---|
| 151 | + sizeof(sbi->uuid)/2); |
|---|
| 180 | 152 | |
|---|
| 181 | 153 | buf->f_namelen = JFS_NAME_MAX; |
|---|
| 182 | 154 | return 0; |
|---|
| .. | .. |
|---|
| 247 | 219 | {Opt_resize_nosize, "resize"}, |
|---|
| 248 | 220 | {Opt_errors, "errors=%s"}, |
|---|
| 249 | 221 | {Opt_ignore, "noquota"}, |
|---|
| 250 | | - {Opt_ignore, "quota"}, |
|---|
| 222 | + {Opt_quota, "quota"}, |
|---|
| 251 | 223 | {Opt_usrquota, "usrquota"}, |
|---|
| 252 | 224 | {Opt_grpquota, "grpquota"}, |
|---|
| 253 | 225 | {Opt_uid, "uid=%u"}, |
|---|
| .. | .. |
|---|
| 532 | 504 | |
|---|
| 533 | 505 | sb->s_fs_info = sbi; |
|---|
| 534 | 506 | sb->s_max_links = JFS_LINK_MAX; |
|---|
| 507 | + sb->s_time_min = 0; |
|---|
| 508 | + sb->s_time_max = U32_MAX; |
|---|
| 535 | 509 | sbi->sb = sb; |
|---|
| 536 | 510 | sbi->uid = INVALID_UID; |
|---|
| 537 | 511 | sbi->gid = INVALID_GID; |
|---|
| .. | .. |
|---|
| 912 | 886 | |
|---|
| 913 | 887 | static const struct super_operations jfs_super_operations = { |
|---|
| 914 | 888 | .alloc_inode = jfs_alloc_inode, |
|---|
| 915 | | - .destroy_inode = jfs_destroy_inode, |
|---|
| 889 | + .free_inode = jfs_free_inode, |
|---|
| 916 | 890 | .dirty_inode = jfs_dirty_inode, |
|---|
| 917 | 891 | .write_inode = jfs_write_inode, |
|---|
| 918 | 892 | .evict_inode = jfs_evict_inode, |
|---|