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

Commit 65eff9cc authored by Mark Fasheh's avatar Mark Fasheh
Browse files

ocfs2: remove handle argument to ocfs2_start_trans()



All callers either pass in NULL directly, or a local variable that is
already set to NULL.

The internals of ocfs2_start_trans() get a nice cleanup as a result.

Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent dae85832
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -1158,7 +1158,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
		goto out_mutex;
		goto out_mutex;
	}
	}


	handle = ocfs2_start_trans(osb, NULL, OCFS2_TRUNCATE_LOG_UPDATE);
	handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE);
	if (IS_ERR(handle)) {
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		status = PTR_ERR(handle);
		mlog_errno(status);
		mlog_errno(status);
@@ -1365,8 +1365,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
			}
			}
		}
		}


		handle = ocfs2_start_trans(osb, NULL,
		handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE);
					   OCFS2_TRUNCATE_LOG_UPDATE);
		if (IS_ERR(handle)) {
		if (IS_ERR(handle)) {
			status = PTR_ERR(handle);
			status = PTR_ERR(handle);
			mlog_errno(status);
			mlog_errno(status);
@@ -1860,7 +1859,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,


	credits = ocfs2_calc_tree_trunc_credits(osb->sb, clusters_to_del,
	credits = ocfs2_calc_tree_trunc_credits(osb->sb, clusters_to_del,
						fe, el);
						fe, el);
	handle = ocfs2_start_trans(osb, NULL, credits);
	handle = ocfs2_start_trans(osb, credits);
	if (IS_ERR(handle)) {
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		status = PTR_ERR(handle);
		handle = NULL;
		handle = NULL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -364,7 +364,7 @@ struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
	struct ocfs2_journal_handle *handle = NULL;
	struct ocfs2_journal_handle *handle = NULL;
	int ret = 0;
	int ret = 0;


	handle = ocfs2_start_trans(osb, NULL, OCFS2_INODE_UPDATE_CREDITS);
	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
	if (!handle) {
	if (!handle) {
		ret = -ENOMEM;
		ret = -ENOMEM;
		mlog_errno(ret);
		mlog_errno(ret);
+1 −1
Original line number Original line Diff line number Diff line
@@ -442,7 +442,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
		credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS;
		credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS;
	}
	}


	handle = ocfs2_start_trans(osb, NULL, credits);
	handle = ocfs2_start_trans(osb, credits);
	if (IS_ERR(handle)) {
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		status = PTR_ERR(handle);
		handle = NULL;
		handle = NULL;
+5 −6
Original line number Original line Diff line number Diff line
@@ -165,8 +165,7 @@ static int ocfs2_simple_size_update(struct inode *inode,
	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
	struct ocfs2_journal_handle *handle = NULL;
	struct ocfs2_journal_handle *handle = NULL;


	handle = ocfs2_start_trans(osb, NULL,
	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
				   OCFS2_INODE_UPDATE_CREDITS);
	if (handle == NULL) {
	if (handle == NULL) {
		ret = -ENOMEM;
		ret = -ENOMEM;
		mlog_errno(ret);
		mlog_errno(ret);
@@ -196,7 +195,7 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb,
	/* TODO: This needs to actually orphan the inode in this
	/* TODO: This needs to actually orphan the inode in this
	 * transaction. */
	 * transaction. */


	handle = ocfs2_start_trans(osb, NULL, OCFS2_INODE_UPDATE_CREDITS);
	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
	if (IS_ERR(handle)) {
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		status = PTR_ERR(handle);
		mlog_errno(status);
		mlog_errno(status);
@@ -496,7 +495,7 @@ static int ocfs2_extend_allocation(struct inode *inode,
	drop_alloc_sem = 1;
	drop_alloc_sem = 1;


	credits = ocfs2_calc_extend_credits(osb->sb, fe, clusters_to_add);
	credits = ocfs2_calc_extend_credits(osb->sb, fe, clusters_to_add);
	handle = ocfs2_start_trans(osb, NULL, credits);
	handle = ocfs2_start_trans(osb, credits);
	if (IS_ERR(handle)) {
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		status = PTR_ERR(handle);
		handle = NULL;
		handle = NULL;
@@ -832,7 +831,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
		}
		}
	}
	}


	handle = ocfs2_start_trans(osb, NULL, OCFS2_INODE_UPDATE_CREDITS);
	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
	if (IS_ERR(handle)) {
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		status = PTR_ERR(handle);
		mlog_errno(status);
		mlog_errno(status);
@@ -905,7 +904,7 @@ static int ocfs2_write_remove_suid(struct inode *inode)
	mlog_entry("(Inode %llu, mode 0%o)\n",
	mlog_entry("(Inode %llu, mode 0%o)\n",
		   (unsigned long long)oi->ip_blkno, inode->i_mode);
		   (unsigned long long)oi->ip_blkno, inode->i_mode);


	handle = ocfs2_start_trans(osb, NULL, OCFS2_INODE_UPDATE_CREDITS);
	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
	if (handle == NULL) {
	if (handle == NULL) {
		ret = -ENOMEM;
		ret = -ENOMEM;
		mlog_errno(ret);
		mlog_errno(ret);
+2 −2
Original line number Original line Diff line number Diff line
@@ -524,7 +524,7 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb,
	if (!fe->i_clusters)
	if (!fe->i_clusters)
		goto bail;
		goto bail;


	handle = ocfs2_start_trans(osb, handle, OCFS2_INODE_UPDATE_CREDITS);
	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
	if (IS_ERR(handle)) {
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		status = PTR_ERR(handle);
		handle = NULL;
		handle = NULL;
@@ -590,7 +590,7 @@ static int ocfs2_remove_inode(struct inode *inode,
		goto bail;
		goto bail;
	}
	}


	handle = ocfs2_start_trans(osb, NULL, OCFS2_DELETE_INODE_CREDITS);
	handle = ocfs2_start_trans(osb, OCFS2_DELETE_INODE_CREDITS);
	if (IS_ERR(handle)) {
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		status = PTR_ERR(handle);
		mlog_errno(status);
		mlog_errno(status);
Loading