Skip to content

Commit 0f607a8

Browse files
mjguzikbrauner
authored andcommitted
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>
1 parent be97a4b commit 0f607a8

4 files changed

Lines changed: 3 additions & 25 deletions

File tree

fs/ocfs2/inode.c

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,8 @@ static void ocfs2_clear_inode(struct inode *inode)
12901290

12911291
void ocfs2_evict_inode(struct inode *inode)
12921292
{
1293+
write_inode_now(inode, 1);
1294+
12931295
if (!inode->i_nlink ||
12941296
(OCFS2_I(inode)->ip_flags & OCFS2_INODE_MAYBE_ORPHANED)) {
12951297
ocfs2_delete_inode(inode);
@@ -1299,27 +1301,6 @@ void ocfs2_evict_inode(struct inode *inode)
12991301
ocfs2_clear_inode(inode);
13001302
}
13011303

1302-
/* Called under inode_lock, with no more references on the
1303-
* struct inode, so it's safe here to check the flags field
1304-
* and to manipulate i_nlink without any other locks. */
1305-
int ocfs2_drop_inode(struct inode *inode)
1306-
{
1307-
struct ocfs2_inode_info *oi = OCFS2_I(inode);
1308-
1309-
trace_ocfs2_drop_inode((unsigned long long)oi->ip_blkno,
1310-
inode->i_nlink, oi->ip_flags);
1311-
1312-
assert_spin_locked(&inode->i_lock);
1313-
inode->i_state |= I_WILL_FREE;
1314-
spin_unlock(&inode->i_lock);
1315-
write_inode_now(inode, 1);
1316-
spin_lock(&inode->i_lock);
1317-
WARN_ON(inode->i_state & I_NEW);
1318-
inode->i_state &= ~I_WILL_FREE;
1319-
1320-
return 1;
1321-
}
1322-
13231304
/*
13241305
* This is called from our getattr.
13251306
*/

fs/ocfs2/inode.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ static inline struct ocfs2_caching_info *INODE_CACHE(struct inode *inode)
116116
}
117117

118118
void ocfs2_evict_inode(struct inode *inode);
119-
int ocfs2_drop_inode(struct inode *inode);
120119

121120
/* Flags for ocfs2_iget() */
122121
#define OCFS2_FI_FLAG_SYSFILE 0x1

fs/ocfs2/ocfs2_trace.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,8 +1569,6 @@ DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_delete_inode);
15691569

15701570
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_clear_inode);
15711571

1572-
DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_drop_inode);
1573-
15741572
TRACE_EVENT(ocfs2_inode_revalidate,
15751573
TP_PROTO(void *inode, unsigned long long ino,
15761574
unsigned int flags),

fs/ocfs2/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static const struct super_operations ocfs2_sops = {
129129
.statfs = ocfs2_statfs,
130130
.alloc_inode = ocfs2_alloc_inode,
131131
.free_inode = ocfs2_free_inode,
132-
.drop_inode = ocfs2_drop_inode,
132+
.drop_inode = inode_just_drop,
133133
.evict_inode = ocfs2_evict_inode,
134134
.sync_fs = ocfs2_sync_fs,
135135
.put_super = ocfs2_put_super,

0 commit comments

Comments
 (0)