Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fabe148 authored by Mark Fasheh's avatar Mark Fasheh
Browse files

ocfs2: Remove struct ocfs2_journal_handle in favor of handle_t



This is mostly a search and replace as ocfs2_journal_handle is now no more
than a container for a handle_t pointer.

ocfs2_commit_trans() becomes very straight forward, and we remove some out
of date comments / code.

Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent 65eff9cc
Loading
Loading
Loading
Loading
+16 −16
Original line number Original line Diff line number Diff line
@@ -52,14 +52,14 @@ static int ocfs2_extent_contig(struct inode *inode,
			       u64 blkno);
			       u64 blkno);


static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
				     struct ocfs2_journal_handle *handle,
				     handle_t *handle,
				     struct inode *inode,
				     struct inode *inode,
				     int wanted,
				     int wanted,
				     struct ocfs2_alloc_context *meta_ac,
				     struct ocfs2_alloc_context *meta_ac,
				     struct buffer_head *bhs[]);
				     struct buffer_head *bhs[]);


static int ocfs2_add_branch(struct ocfs2_super *osb,
static int ocfs2_add_branch(struct ocfs2_super *osb,
			    struct ocfs2_journal_handle *handle,
			    handle_t *handle,
			    struct inode *inode,
			    struct inode *inode,
			    struct buffer_head *fe_bh,
			    struct buffer_head *fe_bh,
			    struct buffer_head *eb_bh,
			    struct buffer_head *eb_bh,
@@ -67,14 +67,14 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
			    struct ocfs2_alloc_context *meta_ac);
			    struct ocfs2_alloc_context *meta_ac);


static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
				  struct ocfs2_journal_handle *handle,
				  handle_t *handle,
				  struct inode *inode,
				  struct inode *inode,
				  struct buffer_head *fe_bh,
				  struct buffer_head *fe_bh,
				  struct ocfs2_alloc_context *meta_ac,
				  struct ocfs2_alloc_context *meta_ac,
				  struct buffer_head **ret_new_eb_bh);
				  struct buffer_head **ret_new_eb_bh);


static int ocfs2_do_insert_extent(struct ocfs2_super *osb,
static int ocfs2_do_insert_extent(struct ocfs2_super *osb,
				  struct ocfs2_journal_handle *handle,
				  handle_t *handle,
				  struct inode *inode,
				  struct inode *inode,
				  struct buffer_head *fe_bh,
				  struct buffer_head *fe_bh,
				  u64 blkno,
				  u64 blkno,
@@ -152,7 +152,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
 * l_count for you
 * l_count for you
 */
 */
static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
				     struct ocfs2_journal_handle *handle,
				     handle_t *handle,
				     struct inode *inode,
				     struct inode *inode,
				     int wanted,
				     int wanted,
				     struct ocfs2_alloc_context *meta_ac,
				     struct ocfs2_alloc_context *meta_ac,
@@ -253,7 +253,7 @@ static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
 * contain a single record with e_clusters == 0.
 * contain a single record with e_clusters == 0.
 */
 */
static int ocfs2_add_branch(struct ocfs2_super *osb,
static int ocfs2_add_branch(struct ocfs2_super *osb,
			    struct ocfs2_journal_handle *handle,
			    handle_t *handle,
			    struct inode *inode,
			    struct inode *inode,
			    struct buffer_head *fe_bh,
			    struct buffer_head *fe_bh,
			    struct buffer_head *eb_bh,
			    struct buffer_head *eb_bh,
@@ -418,7 +418,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
 * after this call.
 * after this call.
 */
 */
static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
				  struct ocfs2_journal_handle *handle,
				  handle_t *handle,
				  struct inode *inode,
				  struct inode *inode,
				  struct buffer_head *fe_bh,
				  struct buffer_head *fe_bh,
				  struct ocfs2_alloc_context *meta_ac,
				  struct ocfs2_alloc_context *meta_ac,
@@ -520,7 +520,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
 * down.
 * down.
 */
 */
static int ocfs2_do_insert_extent(struct ocfs2_super *osb,
static int ocfs2_do_insert_extent(struct ocfs2_super *osb,
				  struct ocfs2_journal_handle *handle,
				  handle_t *handle,
				  struct inode *inode,
				  struct inode *inode,
				  struct buffer_head *fe_bh,
				  struct buffer_head *fe_bh,
				  u64 start_blk,
				  u64 start_blk,
@@ -809,7 +809,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,


/* the caller needs to update fe->i_clusters */
/* the caller needs to update fe->i_clusters */
int ocfs2_insert_extent(struct ocfs2_super *osb,
int ocfs2_insert_extent(struct ocfs2_super *osb,
			struct ocfs2_journal_handle *handle,
			handle_t *handle,
			struct inode *inode,
			struct inode *inode,
			struct buffer_head *fe_bh,
			struct buffer_head *fe_bh,
			u64 start_blk,
			u64 start_blk,
@@ -951,7 +951,7 @@ static int ocfs2_truncate_log_can_coalesce(struct ocfs2_truncate_log *tl,
}
}


static int ocfs2_truncate_log_append(struct ocfs2_super *osb,
static int ocfs2_truncate_log_append(struct ocfs2_super *osb,
				     struct ocfs2_journal_handle *handle,
				     handle_t *handle,
				     u64 start_blk,
				     u64 start_blk,
				     unsigned int num_clusters)
				     unsigned int num_clusters)
{
{
@@ -1034,7 +1034,7 @@ static int ocfs2_truncate_log_append(struct ocfs2_super *osb,
}
}


static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
					 struct ocfs2_journal_handle *handle,
					 handle_t *handle,
					 struct inode *data_alloc_inode,
					 struct inode *data_alloc_inode,
					 struct buffer_head *data_alloc_bh)
					 struct buffer_head *data_alloc_bh)
{
{
@@ -1074,7 +1074,7 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
		/* TODO: Perhaps we can calculate the bulk of the
		/* TODO: Perhaps we can calculate the bulk of the
		 * credits up front rather than extending like
		 * credits up front rather than extending like
		 * this. */
		 * this. */
		status = ocfs2_extend_trans(handle->k_handle,
		status = ocfs2_extend_trans(handle,
					    OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC);
					    OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC);
		if (status < 0) {
		if (status < 0) {
			mlog_errno(status);
			mlog_errno(status);
@@ -1113,7 +1113,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
{
{
	int status;
	int status;
	unsigned int num_to_flush;
	unsigned int num_to_flush;
	struct ocfs2_journal_handle *handle;
	handle_t *handle;
	struct inode *tl_inode = osb->osb_tl_inode;
	struct inode *tl_inode = osb->osb_tl_inode;
	struct inode *data_alloc_inode = NULL;
	struct inode *data_alloc_inode = NULL;
	struct buffer_head *tl_bh = osb->osb_tl_bh;
	struct buffer_head *tl_bh = osb->osb_tl_bh;
@@ -1339,7 +1339,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
	int i;
	int i;
	unsigned int clusters, num_recs, start_cluster;
	unsigned int clusters, num_recs, start_cluster;
	u64 start_blk;
	u64 start_blk;
	struct ocfs2_journal_handle *handle;
	handle_t *handle;
	struct inode *tl_inode = osb->osb_tl_inode;
	struct inode *tl_inode = osb->osb_tl_inode;
	struct ocfs2_truncate_log *tl;
	struct ocfs2_truncate_log *tl;


@@ -1534,7 +1534,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
			     struct inode *inode,
			     struct inode *inode,
			     struct buffer_head *fe_bh,
			     struct buffer_head *fe_bh,
			     struct buffer_head *old_last_eb_bh,
			     struct buffer_head *old_last_eb_bh,
			     struct ocfs2_journal_handle *handle,
			     handle_t *handle,
			     struct ocfs2_truncate_context *tc)
			     struct ocfs2_truncate_context *tc)
{
{
	int status, i, depth;
	int status, i, depth;
@@ -1773,7 +1773,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
	struct ocfs2_extent_block *eb;
	struct ocfs2_extent_block *eb;
	struct ocfs2_extent_list *el;
	struct ocfs2_extent_list *el;
	struct buffer_head *last_eb_bh;
	struct buffer_head *last_eb_bh;
	struct ocfs2_journal_handle *handle = NULL;
	handle_t *handle = NULL;
	struct inode *tl_inode = osb->osb_tl_inode;
	struct inode *tl_inode = osb->osb_tl_inode;


	mlog_entry_void();
	mlog_entry_void();
+1 −1
Original line number Original line Diff line number Diff line
@@ -28,7 +28,7 @@


struct ocfs2_alloc_context;
struct ocfs2_alloc_context;
int ocfs2_insert_extent(struct ocfs2_super *osb,
int ocfs2_insert_extent(struct ocfs2_super *osb,
			struct ocfs2_journal_handle *handle,
			handle_t *handle,
			struct inode *inode,
			struct inode *inode,
			struct buffer_head *fe_bh,
			struct buffer_head *fe_bh,
			u64 blkno,
			u64 blkno,
+4 −4
Original line number Original line Diff line number Diff line
@@ -355,13 +355,13 @@ static int walk_page_buffers( handle_t *handle,
	return ret;
	return ret;
}
}


struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
							 struct page *page,
							 struct page *page,
							 unsigned from,
							 unsigned from,
							 unsigned to)
							 unsigned to)
{
{
	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
	struct ocfs2_journal_handle *handle = NULL;
	handle_t *handle = NULL;
	int ret = 0;
	int ret = 0;


	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
@@ -372,7 +372,7 @@ struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
	}
	}


	if (ocfs2_should_order_data(inode)) {
	if (ocfs2_should_order_data(inode)) {
		ret = walk_page_buffers(handle->k_handle,
		ret = walk_page_buffers(handle,
					page_buffers(page),
					page_buffers(page),
					from, to, NULL,
					from, to, NULL,
					ocfs2_journal_dirty_data);
					ocfs2_journal_dirty_data);
@@ -394,7 +394,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page,
	int ret;
	int ret;
	struct buffer_head *di_bh = NULL;
	struct buffer_head *di_bh = NULL;
	struct inode *inode = page->mapping->host;
	struct inode *inode = page->mapping->host;
	struct ocfs2_journal_handle *handle = NULL;
	handle_t *handle = NULL;
	struct ocfs2_dinode *di;
	struct ocfs2_dinode *di;


	mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
	mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
+1 −1
Original line number Original line Diff line number Diff line
@@ -25,7 +25,7 @@
int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page,
int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page,
			       unsigned from, unsigned to);
			       unsigned from, unsigned to);


struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
							 struct page *page,
							 struct page *page,
							 unsigned from,
							 unsigned from,
							 unsigned to);
							 unsigned to);
+2 −2
Original line number Original line Diff line number Diff line
@@ -340,7 +340,7 @@ int ocfs2_empty_dir(struct inode *inode)


/* returns a bh of the 1st new block in the allocation. */
/* returns a bh of the 1st new block in the allocation. */
int ocfs2_do_extend_dir(struct super_block *sb,
int ocfs2_do_extend_dir(struct super_block *sb,
			struct ocfs2_journal_handle *handle,
			handle_t *handle,
			struct inode *dir,
			struct inode *dir,
			struct buffer_head *parent_fe_bh,
			struct buffer_head *parent_fe_bh,
			struct ocfs2_alloc_context *data_ac,
			struct ocfs2_alloc_context *data_ac,
@@ -398,7 +398,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
	struct ocfs2_dinode *fe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
	struct ocfs2_dinode *fe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
	struct ocfs2_alloc_context *data_ac = NULL;
	struct ocfs2_alloc_context *data_ac = NULL;
	struct ocfs2_alloc_context *meta_ac = NULL;
	struct ocfs2_alloc_context *meta_ac = NULL;
	struct ocfs2_journal_handle *handle = NULL;
	handle_t *handle = NULL;
	struct buffer_head *new_bh = NULL;
	struct buffer_head *new_bh = NULL;
	struct ocfs2_dir_entry * de;
	struct ocfs2_dir_entry * de;
	struct super_block *sb = osb->sb;
	struct super_block *sb = osb->sb;
Loading