[Ocfs2-devel] [PATCH 04/40] ocfs2: move ip_last_trans to struct ocfs2_caching_info

Joel Becker Joel.Becker at oracle.com
Mon Feb 16 21:36:10 PST 2009


On Mon, Feb 16, 2009 at 09:07:18AM +0800, Tao Ma wrote:
> Joel Becker wrote:
>> 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: Joel Becker <joel.becker at oracle.com>
>> ---
>>  fs/ocfs2/inode.c    |   10 +++++-----
>>  fs/ocfs2/inode.h    |    2 --
>>  fs/ocfs2/journal.h  |    5 +++--
>>  fs/ocfs2/ocfs2.h    |    4 ++++
>>  fs/ocfs2/super.c    |    1 -
>>  fs/ocfs2/uptodate.c |   22 +++++++++++++++++++---
>>  fs/ocfs2/uptodate.h |    1 +
>>  7 files changed, 32 insertions(+), 13 deletions(-)
>>
>> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
>> index fc55fcf..9cefa54 100644
>> --- a/fs/ocfs2/inode.c
>> +++ b/fs/ocfs2/inode.c
>> @@ -1063,13 +1063,14 @@ 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(oi->ip_metadata_cache.ci_num_cached,
>> +	mlog_bug_on_msg(INODE_CACHE(inode)->ci_num_cached,
>>  			"Clear inode of %llu, inode has %u cache items\n",
>> -			(unsigned long long)oi->ip_blkno, oi->ip_metadata_cache.ci_num_cached);
>> +			(unsigned long long)oi->ip_blkno,
>> +			INODE_CACHE(inode)->ci_num_cached);
>>  -	mlog_bug_on_msg(!(oi->ip_metadata_cache.ci_flags &
>> +	mlog_bug_on_msg(!(INODE_CACHE(inode)->ci_flags &
>>  			  OCFS2_CACHE_FL_INLINE),
>>  			"Clear inode of %llu, inode has a bad flag\n",
>>  			(unsigned long long)oi->ip_blkno);
> These 2 lines(mlog) has nothing to do with your ip_last_trans, why  
> change them?  And if you really want to change it, it may be included in  
> the patch you add INODE_CACHE I guess?

	I do want to change it.  I thought I had it against the previous
patch.  Whoops?

Joel

-- 

"Here's something to think about:  How come you never see a headline
 like ``Psychic Wins Lottery''?"
	- Jay Leno

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-devel mailing list