diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-04-15 22:48:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-05-01 22:43:26 -0400 |
commit | b3b4a6e356dbded14a0513fa0da4fe3ac1c5a33a (patch) | |
tree | 36dc357c6988601005cc2a6e9ce4ea497575c9f8 | |
parent | 9baf28bbfea165a62211dd90986d993d77631372 (diff) |
jfs: switch to ->free_inode()
synchronous part can be moved to ->evict_inode(), the rest -
->free_inode() fodder
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/jfs/inode.c | 13 | ||||
-rw-r--r-- | fs/jfs/super.c | 24 |
2 files changed, 16 insertions, 21 deletions
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 805ae9e8944a..f2b92b292abe 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "jfs_extent.h" | 31 | #include "jfs_extent.h" |
32 | #include "jfs_unicode.h" | 32 | #include "jfs_unicode.h" |
33 | #include "jfs_debug.h" | 33 | #include "jfs_debug.h" |
34 | #include "jfs_dmap.h" | ||
34 | 35 | ||
35 | 36 | ||
36 | struct inode *jfs_iget(struct super_block *sb, unsigned long ino) | 37 | struct inode *jfs_iget(struct super_block *sb, unsigned long ino) |
@@ -150,6 +151,8 @@ int jfs_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
150 | 151 | ||
151 | void jfs_evict_inode(struct inode *inode) | 152 | void jfs_evict_inode(struct inode *inode) |
152 | { | 153 | { |
154 | struct jfs_inode_info *ji = JFS_IP(inode); | ||
155 | |||
153 | jfs_info("In jfs_evict_inode, inode = 0x%p", inode); | 156 | jfs_info("In jfs_evict_inode, inode = 0x%p", inode); |
154 | 157 | ||
155 | if (!inode->i_nlink && !is_bad_inode(inode)) { | 158 | if (!inode->i_nlink && !is_bad_inode(inode)) { |
@@ -173,6 +176,16 @@ void jfs_evict_inode(struct inode *inode) | |||
173 | } | 176 | } |
174 | clear_inode(inode); | 177 | clear_inode(inode); |
175 | dquot_drop(inode); | 178 | dquot_drop(inode); |
179 | |||
180 | BUG_ON(!list_empty(&ji->anon_inode_list)); | ||
181 | |||
182 | spin_lock_irq(&ji->ag_lock); | ||
183 | if (ji->active_ag != -1) { | ||
184 | struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; | ||
185 | atomic_dec(&bmap->db_active[ji->active_ag]); | ||
186 | ji->active_ag = -1; | ||
187 | } | ||
188 | spin_unlock_irq(&ji->ag_lock); | ||
176 | } | 189 | } |
177 | 190 | ||
178 | void jfs_dirty_inode(struct inode *inode, int flags) | 191 | void jfs_dirty_inode(struct inode *inode, int flags) |
diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 65d8fc87ab11..9454831bbd71 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c | |||
@@ -124,27 +124,9 @@ static struct inode *jfs_alloc_inode(struct super_block *sb) | |||
124 | return &jfs_inode->vfs_inode; | 124 | return &jfs_inode->vfs_inode; |
125 | } | 125 | } |
126 | 126 | ||
127 | static void jfs_i_callback(struct rcu_head *head) | 127 | static void jfs_free_inode(struct inode *inode) |
128 | { | 128 | { |
129 | struct inode *inode = container_of(head, struct inode, i_rcu); | 129 | kmem_cache_free(jfs_inode_cachep, JFS_IP(inode)); |
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); | ||
148 | } | 130 | } |
149 | 131 | ||
150 | static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) | 132 | static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
@@ -912,7 +894,7 @@ out: | |||
912 | 894 | ||
913 | static const struct super_operations jfs_super_operations = { | 895 | static const struct super_operations jfs_super_operations = { |
914 | .alloc_inode = jfs_alloc_inode, | 896 | .alloc_inode = jfs_alloc_inode, |
915 | .destroy_inode = jfs_destroy_inode, | 897 | .free_inode = jfs_free_inode, |
916 | .dirty_inode = jfs_dirty_inode, | 898 | .dirty_inode = jfs_dirty_inode, |
917 | .write_inode = jfs_write_inode, | 899 | .write_inode = jfs_write_inode, |
918 | .evict_inode = jfs_evict_inode, | 900 | .evict_inode = jfs_evict_inode, |