Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ocfs2: retire ocfs2_drop_inode() and I_WILL_FREE usage

This postpones the writeout to ocfs2_evict_inode(), which I'm told is
fine (tm).

The intent is to retire the I_WILL_FREE flag.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Reviewed-by: Joel Becker <jlbec@evilplan.org>
Reviewed-by: Mark Tinguely <amrk.tinguely@oracle.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Mateusz Guzik and committed by
Christian Brauner
0f607a89 be97a4b6

+3 -25
+2 -21
fs/ocfs2/inode.c
··· 1290 1290 1291 1291 void ocfs2_evict_inode(struct inode *inode) 1292 1292 { 1293 + write_inode_now(inode, 1); 1294 + 1293 1295 if (!inode->i_nlink || 1294 1296 (OCFS2_I(inode)->ip_flags & OCFS2_INODE_MAYBE_ORPHANED)) { 1295 1297 ocfs2_delete_inode(inode); ··· 1299 1297 truncate_inode_pages_final(&inode->i_data); 1300 1298 } 1301 1299 ocfs2_clear_inode(inode); 1302 - } 1303 - 1304 - /* Called under inode_lock, with no more references on the 1305 - * struct inode, so it's safe here to check the flags field 1306 - * and to manipulate i_nlink without any other locks. */ 1307 - int ocfs2_drop_inode(struct inode *inode) 1308 - { 1309 - struct ocfs2_inode_info *oi = OCFS2_I(inode); 1310 - 1311 - trace_ocfs2_drop_inode((unsigned long long)oi->ip_blkno, 1312 - inode->i_nlink, oi->ip_flags); 1313 - 1314 - assert_spin_locked(&inode->i_lock); 1315 - inode->i_state |= I_WILL_FREE; 1316 - spin_unlock(&inode->i_lock); 1317 - write_inode_now(inode, 1); 1318 - spin_lock(&inode->i_lock); 1319 - WARN_ON(inode->i_state & I_NEW); 1320 - inode->i_state &= ~I_WILL_FREE; 1321 - 1322 - return 1; 1323 1300 } 1324 1301 1325 1302 /*
-1
fs/ocfs2/inode.h
··· 116 116 } 117 117 118 118 void ocfs2_evict_inode(struct inode *inode); 119 - int ocfs2_drop_inode(struct inode *inode); 120 119 121 120 /* Flags for ocfs2_iget() */ 122 121 #define OCFS2_FI_FLAG_SYSFILE 0x1
-2
fs/ocfs2/ocfs2_trace.h
··· 1569 1569 1570 1570 DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_clear_inode); 1571 1571 1572 - DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_drop_inode); 1573 - 1574 1572 TRACE_EVENT(ocfs2_inode_revalidate, 1575 1573 TP_PROTO(void *inode, unsigned long long ino, 1576 1574 unsigned int flags),
+1 -1
fs/ocfs2/super.c
··· 129 129 .statfs = ocfs2_statfs, 130 130 .alloc_inode = ocfs2_alloc_inode, 131 131 .free_inode = ocfs2_free_inode, 132 - .drop_inode = ocfs2_drop_inode, 132 + .drop_inode = inode_just_drop, 133 133 .evict_inode = ocfs2_evict_inode, 134 134 .sync_fs = ocfs2_sync_fs, 135 135 .put_super = ocfs2_put_super,