Commit 66fb345d authored by Joel Becker's avatar Joel Becker
Browse files

ocfs2: move ip_last_trans to struct ocfs2_caching_info



We have the read side of metadata caching isolated to struct
ocfs2_caching_info, now we need the write side.  This means the journal
functions.  The journal only does a couple of things with struct inode.

This change moves the ip_last_trans field onto struct
ocfs2_caching_info as ci_last_trans.  This field tells the journal
whether a pending journal flush is required.

Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent 8cb471e8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1112,7 +1112,7 @@ void ocfs2_clear_inode(struct inode *inode)
	ocfs2_lock_res_free(&oi->ip_inode_lockres);
	ocfs2_lock_res_free(&oi->ip_open_lockres);

	ocfs2_metadata_cache_purge(INODE_CACHE(inode));
	ocfs2_metadata_cache_exit(INODE_CACHE(inode));

	mlog_bug_on_msg(INODE_CACHE(inode)->ci_num_cached,
			"Clear inode of %llu, inode has %u cache items\n",
@@ -1148,7 +1148,6 @@ void ocfs2_clear_inode(struct inode *inode)
	/* Clear all other flags. */
	oi->ip_flags = 0;
	oi->ip_created_trans = 0;
	oi->ip_last_trans = 0;
	oi->ip_dir_start_lookup = 0;
	oi->ip_blkno = 0ULL;

+0 −2
Original line number Diff line number Diff line
@@ -63,8 +63,6 @@ struct ocfs2_inode_info
	/* next two are protected by trans_inc_lock */
	/* which transaction were we created on? Zero if none. */
	unsigned long			ip_created_trans;
	/* last transaction we were a part of. */
	unsigned long			ip_last_trans;

	struct ocfs2_caching_info	ip_metadata_cache;

+3 −2
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ static inline void ocfs2_set_inode_lock_trans(struct ocfs2_journal *journal,
					      struct inode *inode)
{
	spin_lock(&trans_inc_lock);
	OCFS2_I(inode)->ip_last_trans = journal->j_trans_id;
	INODE_CACHE(inode)->ci_last_trans = journal->j_trans_id;
	spin_unlock(&trans_inc_lock);
}

@@ -109,7 +109,8 @@ static inline int ocfs2_inode_fully_checkpointed(struct inode *inode)
	struct ocfs2_journal *journal = OCFS2_SB(inode->i_sb)->journal;

	spin_lock(&trans_inc_lock);
	ret = time_after(journal->j_trans_id, OCFS2_I(inode)->ip_last_trans);
	ret = time_after(journal->j_trans_id,
			 INODE_CACHE(inode)->ci_last_trans);
	spin_unlock(&trans_inc_lock);
	return ret;
}
+4 −0
Original line number Diff line number Diff line
@@ -77,6 +77,10 @@ struct ocfs2_caching_info {
	 */
	const struct ocfs2_caching_operations *ci_ops;

	/* last transaction we were a part of. */
	unsigned long		ci_last_trans;

	/* Cache structures */
	unsigned int		ci_flags;
	unsigned int		ci_num_cached;
	union {
+0 −1
Original line number Diff line number Diff line
@@ -1669,7 +1669,6 @@ static void ocfs2_inode_init_once(void *data)
	ocfs2_extent_map_init(&oi->vfs_inode);
	INIT_LIST_HEAD(&oi->ip_io_markers);
	oi->ip_created_trans = 0;
	oi->ip_last_trans = 0;
	oi->ip_dir_start_lookup = 0;

	init_rwsem(&oi->ip_alloc_sem);
Loading