Commit a4338481 authored by Tao Ma's avatar Tao Ma Committed by Joel Becker

ocfs2: Abstract caching info checkpoint.

In meta downconvert, we need to checkpoint the metadata in an inode.
For refcount tree, we also need it. So abstract the process out.

Signed-off-by: Tao Ma <tao.ma@oracle.com> 
parent f2c870e3
...@@ -3495,11 +3495,11 @@ out: ...@@ -3495,11 +3495,11 @@ out:
return UNBLOCK_CONTINUE; return UNBLOCK_CONTINUE;
} }
static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres, static int ocfs2_ci_checkpointed(struct ocfs2_caching_info *ci,
int new_level) struct ocfs2_lock_res *lockres,
int new_level)
{ {
struct inode *inode = ocfs2_lock_res_inode(lockres); int checkpointed = ocfs2_ci_fully_checkpointed(ci);
int checkpointed = ocfs2_ci_fully_checkpointed(INODE_CACHE(inode));
BUG_ON(new_level != DLM_LOCK_NL && new_level != DLM_LOCK_PR); BUG_ON(new_level != DLM_LOCK_NL && new_level != DLM_LOCK_PR);
BUG_ON(lockres->l_level != DLM_LOCK_EX && !checkpointed); BUG_ON(lockres->l_level != DLM_LOCK_EX && !checkpointed);
...@@ -3507,10 +3507,18 @@ static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres, ...@@ -3507,10 +3507,18 @@ static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres,
if (checkpointed) if (checkpointed)
return 1; return 1;
ocfs2_start_checkpoint(OCFS2_SB(inode->i_sb)); ocfs2_start_checkpoint(OCFS2_SB(ocfs2_metadata_cache_get_super(ci)));
return 0; return 0;
} }
static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres,
int new_level)
{
struct inode *inode = ocfs2_lock_res_inode(lockres);
return ocfs2_ci_checkpointed(INODE_CACHE(inode), lockres, new_level);
}
static void ocfs2_set_meta_lvb(struct ocfs2_lock_res *lockres) static void ocfs2_set_meta_lvb(struct ocfs2_lock_res *lockres)
{ {
struct inode *inode = ocfs2_lock_res_inode(lockres); struct inode *inode = ocfs2_lock_res_inode(lockres);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment