提交 02dc1af4 编写于 作者: M Mark Fasheh

ocfs2: pass ocfs2_super * into ocfs2_commit_trans()

This sets us up to remove handle->journal.
Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
上级 4bcec184
...@@ -1170,7 +1170,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) ...@@ -1170,7 +1170,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
if (status < 0) if (status < 0)
mlog_errno(status); mlog_errno(status);
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
out_unlock: out_unlock:
brelse(data_alloc_bh); brelse(data_alloc_bh);
...@@ -1379,7 +1379,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb, ...@@ -1379,7 +1379,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
status = ocfs2_truncate_log_append(osb, handle, status = ocfs2_truncate_log_append(osb, handle,
start_blk, clusters); start_blk, clusters);
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
if (status < 0) { if (status < 0) {
mlog_errno(status); mlog_errno(status);
goto bail_up; goto bail_up;
...@@ -1883,7 +1883,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb, ...@@ -1883,7 +1883,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
mutex_unlock(&tl_inode->i_mutex); mutex_unlock(&tl_inode->i_mutex);
tl_sem = 0; tl_sem = 0;
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
handle = NULL; handle = NULL;
BUG_ON(le32_to_cpu(fe->i_clusters) < target_i_clusters); BUG_ON(le32_to_cpu(fe->i_clusters) < target_i_clusters);
...@@ -1898,7 +1898,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb, ...@@ -1898,7 +1898,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
mutex_unlock(&tl_inode->i_mutex); mutex_unlock(&tl_inode->i_mutex);
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
if (last_eb_bh) if (last_eb_bh)
brelse(last_eb_bh); brelse(last_eb_bh);
......
...@@ -382,7 +382,7 @@ struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode, ...@@ -382,7 +382,7 @@ struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
out: out:
if (ret) { if (ret) {
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
handle = ERR_PTR(ret); handle = ERR_PTR(ret);
} }
return handle; return handle;
...@@ -464,7 +464,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page, ...@@ -464,7 +464,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page,
} }
out_commit: out_commit:
ocfs2_commit_trans(handle); ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
out_unlock_data: out_unlock_data:
ocfs2_data_unlock(inode, 1); ocfs2_data_unlock(inode, 1);
out_unlock_meta: out_unlock_meta:
......
...@@ -488,7 +488,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb, ...@@ -488,7 +488,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
get_bh(*new_de_bh); get_bh(*new_de_bh);
bail: bail:
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
if (data_ac) if (data_ac)
ocfs2_free_alloc_context(data_ac); ocfs2_free_alloc_context(data_ac);
......
...@@ -178,7 +178,7 @@ static int ocfs2_simple_size_update(struct inode *inode, ...@@ -178,7 +178,7 @@ static int ocfs2_simple_size_update(struct inode *inode,
if (ret < 0) if (ret < 0)
mlog_errno(ret); mlog_errno(ret);
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
out: out:
return ret; return ret;
} }
...@@ -207,7 +207,7 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, ...@@ -207,7 +207,7 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb,
if (status < 0) if (status < 0)
mlog_errno(status); mlog_errno(status);
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
out: out:
mlog_exit(status); mlog_exit(status);
return status; return status;
...@@ -576,7 +576,7 @@ static int ocfs2_extend_allocation(struct inode *inode, ...@@ -576,7 +576,7 @@ static int ocfs2_extend_allocation(struct inode *inode,
drop_alloc_sem = 0; drop_alloc_sem = 0;
} }
if (handle) { if (handle) {
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
handle = NULL; handle = NULL;
} }
if (data_ac) { if (data_ac) {
...@@ -655,7 +655,7 @@ static int ocfs2_write_zero_page(struct inode *inode, ...@@ -655,7 +655,7 @@ static int ocfs2_write_zero_page(struct inode *inode,
ret = 0; ret = 0;
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
out_unlock: out_unlock:
unlock_page(page); unlock_page(page);
page_cache_release(page); page_cache_release(page);
...@@ -850,7 +850,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -850,7 +850,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
mlog_errno(status); mlog_errno(status);
bail_commit: bail_commit:
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
bail_unlock: bail_unlock:
ocfs2_meta_unlock(inode, 1); ocfs2_meta_unlock(inode, 1);
bail_unlock_rw: bail_unlock_rw:
...@@ -938,7 +938,7 @@ static int ocfs2_write_remove_suid(struct inode *inode) ...@@ -938,7 +938,7 @@ static int ocfs2_write_remove_suid(struct inode *inode)
out_bh: out_bh:
brelse(bh); brelse(bh);
out_trans: out_trans:
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
out: out:
mlog_exit(ret); mlog_exit(ret);
return ret; return ret;
......
...@@ -538,7 +538,7 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb, ...@@ -538,7 +538,7 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb,
goto bail; goto bail;
} }
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
handle = NULL; handle = NULL;
status = ocfs2_prepare_truncate(osb, inode, fe_bh, &tc); status = ocfs2_prepare_truncate(osb, inode, fe_bh, &tc);
...@@ -554,7 +554,7 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb, ...@@ -554,7 +554,7 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb,
} }
bail: bail:
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
mlog_exit(status); mlog_exit(status);
return status; return status;
...@@ -629,7 +629,7 @@ static int ocfs2_remove_inode(struct inode *inode, ...@@ -629,7 +629,7 @@ static int ocfs2_remove_inode(struct inode *inode,
mlog_errno(status); mlog_errno(status);
bail_commit: bail_commit:
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
bail_unlock: bail_unlock:
ocfs2_meta_unlock(inode_alloc_inode, 1); ocfs2_meta_unlock(inode_alloc_inode, 1);
mutex_unlock(&inode_alloc_inode->i_mutex); mutex_unlock(&inode_alloc_inode->i_mutex);
......
...@@ -96,7 +96,7 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags, ...@@ -96,7 +96,7 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
if (status < 0) if (status < 0)
mlog_errno(status); mlog_errno(status);
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
bail_unlock: bail_unlock:
ocfs2_meta_unlock(inode, 1); ocfs2_meta_unlock(inode, 1);
bail: bail:
......
...@@ -195,11 +195,12 @@ struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb, ...@@ -195,11 +195,12 @@ struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb,
return ERR_PTR(ret); return ERR_PTR(ret);
} }
void ocfs2_commit_trans(struct ocfs2_journal_handle *handle) void ocfs2_commit_trans(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle)
{ {
handle_t *jbd_handle; handle_t *jbd_handle;
int retval; int retval;
struct ocfs2_journal *journal = handle->journal; struct ocfs2_journal *journal = osb->journal;
mlog_entry_void(); mlog_entry_void();
......
...@@ -219,7 +219,8 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) ...@@ -219,7 +219,8 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode)
struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb, struct ocfs2_journal_handle *ocfs2_start_trans(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle, struct ocfs2_journal_handle *handle,
int max_buffs); int max_buffs);
void ocfs2_commit_trans(struct ocfs2_journal_handle *handle); void ocfs2_commit_trans(struct ocfs2_super *osb,
struct ocfs2_journal_handle *handle);
int ocfs2_extend_trans(handle_t *handle, int nblocks); int ocfs2_extend_trans(handle_t *handle, int nblocks);
/* /*
......
...@@ -280,7 +280,7 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb) ...@@ -280,7 +280,7 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb)
mlog_errno(status); mlog_errno(status);
out_commit: out_commit:
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
out_unlock: out_unlock:
if (main_bm_bh) if (main_bm_bh)
...@@ -421,7 +421,7 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb, ...@@ -421,7 +421,7 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,
if (status < 0) if (status < 0)
mlog_errno(status); mlog_errno(status);
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
out_unlock: out_unlock:
ocfs2_meta_unlock(main_bm_inode, 1); ocfs2_meta_unlock(main_bm_inode, 1);
...@@ -954,7 +954,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb, ...@@ -954,7 +954,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb,
status = 0; status = 0;
bail: bail:
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
if (main_bm_bh) if (main_bm_bh)
brelse(main_bm_bh); brelse(main_bm_bh);
......
...@@ -440,7 +440,7 @@ static int ocfs2_mknod(struct inode *dir, ...@@ -440,7 +440,7 @@ static int ocfs2_mknod(struct inode *dir,
status = 0; status = 0;
leave: leave:
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
ocfs2_meta_unlock(dir, 1); ocfs2_meta_unlock(dir, 1);
...@@ -746,7 +746,7 @@ static int ocfs2_link(struct dentry *old_dentry, ...@@ -746,7 +746,7 @@ static int ocfs2_link(struct dentry *old_dentry,
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
out_commit: out_commit:
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
out_unlock_inode: out_unlock_inode:
ocfs2_meta_unlock(inode, 1); ocfs2_meta_unlock(inode, 1);
...@@ -942,7 +942,7 @@ static int ocfs2_unlink(struct inode *dir, ...@@ -942,7 +942,7 @@ static int ocfs2_unlink(struct inode *dir,
leave: leave:
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
if (child_locked) if (child_locked)
ocfs2_meta_unlock(inode, 1); ocfs2_meta_unlock(inode, 1);
...@@ -1428,7 +1428,7 @@ static int ocfs2_rename(struct inode *old_dir, ...@@ -1428,7 +1428,7 @@ static int ocfs2_rename(struct inode *old_dir,
ocfs2_rename_unlock(osb); ocfs2_rename_unlock(osb);
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
if (parents_locked) if (parents_locked)
ocfs2_double_unlock(old_dir, new_dir); ocfs2_double_unlock(old_dir, new_dir);
...@@ -1730,7 +1730,7 @@ static int ocfs2_symlink(struct inode *dir, ...@@ -1730,7 +1730,7 @@ static int ocfs2_symlink(struct inode *dir,
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
bail: bail:
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
ocfs2_meta_unlock(dir, 1); ocfs2_meta_unlock(dir, 1);
......
...@@ -387,7 +387,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb, ...@@ -387,7 +387,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb,
status = 0; status = 0;
bail: bail:
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(osb, handle);
if (ac) if (ac)
ocfs2_free_alloc_context(ac); ocfs2_free_alloc_context(ac);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册