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

Commit c1e8d35e authored by Tao Ma's avatar Tao Ma
Browse files

ocfs2: Remove EXIT from masklog.



mlog_exit is used to record the exit status of a function.
But because it is added in so many functions, if we enable it,
the system logs get filled up quickly and cause too much I/O.
So actually no one can open it for a production system or even
for a test.

This patch just try to remove it or change it. So:
1. if all the error paths already use mlog_errno, it is just removed.
   Otherwise, it will be replaced by mlog_errno.
2. if it is used to print some return value, it is replaced with
   mlog(0,...).
mlog_exit_ptr is changed to mlog(0.
All those mlog(0,...) will be replaced with trace events later.

Signed-off-by: default avatarTao Ma <boyu.mt@taobao.com>
parent ef6b689b
Loading
Loading
Loading
Loading
+5 −21
Original line number Diff line number Diff line
@@ -985,7 +985,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
bail:
	brelse(eb_bh);

	mlog_exit(retval);
	mlog(0, "retval = %d\n", retval);
	return retval;
}

@@ -1070,8 +1070,8 @@ bail:
			brelse(bhs[i]);
			bhs[i] = NULL;
		}
		mlog_errno(status);
	}
	mlog_exit(status);
	return status;
}

@@ -1326,7 +1326,6 @@ bail:
		kfree(new_eb_bhs);
	}

	mlog_exit(status);
	return status;
}

@@ -1407,7 +1406,6 @@ static int ocfs2_shift_tree_depth(handle_t *handle,
bail:
	brelse(new_eb_bh);

	mlog_exit(status);
	return status;
}

@@ -1493,7 +1491,6 @@ static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et,
bail:
	brelse(bh);

	mlog_exit(status);
	return status;
}

@@ -4552,7 +4549,7 @@ static int ocfs2_figure_insert_type(struct ocfs2_extent_tree *et,
					      ocfs2_et_get_last_eb_blk(et),
					      &bh);
		if (ret) {
			mlog_exit(ret);
			mlog_errno(ret);
			goto out;
		}
		eb = (struct ocfs2_extent_block *) bh->b_data;
@@ -4716,7 +4713,6 @@ int ocfs2_insert_extent(handle_t *handle,
bail:
	brelse(last_eb_bh);

	mlog_exit(status);
	return status;
}

@@ -4818,7 +4814,6 @@ int ocfs2_add_clusters_in_btree(handle_t *handle,
	}

leave:
	mlog_exit(status);
	if (reason_ret)
		*reason_ret = reason;
	return status;
@@ -5029,7 +5024,7 @@ int ocfs2_split_extent(handle_t *handle,
					      ocfs2_et_get_last_eb_blk(et),
					      &last_eb_bh);
		if (ret) {
			mlog_exit(ret);
			mlog_errno(ret);
			goto out;
		}

@@ -5849,7 +5844,6 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb,

	osb->truncated_clusters += num_clusters;
bail:
	mlog_exit(status);
	return status;
}

@@ -5920,7 +5914,6 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
	osb->truncated_clusters = 0;

bail:
	mlog_exit(status);
	return status;
}

@@ -5995,7 +5988,6 @@ out_mutex:
	iput(data_alloc_inode);

out:
	mlog_exit(status);
	return status;
}

@@ -6023,8 +6015,6 @@ static void ocfs2_truncate_log_worker(struct work_struct *work)
		mlog_errno(status);
	else
		ocfs2_init_steal_slots(osb);

	mlog_exit(status);
}

#define OCFS2_TRUNCATE_LOG_FLUSH_INTERVAL (2 * HZ)
@@ -6070,7 +6060,6 @@ static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb,
	*tl_inode = inode;
	*tl_bh    = bh;
bail:
	mlog_exit(status);
	return status;
}

@@ -6141,9 +6130,9 @@ bail:
	if (status < 0 && (*tl_copy)) {
		kfree(*tl_copy);
		*tl_copy = NULL;
		mlog_errno(status);
	}

	mlog_exit(status);
	return status;
}

@@ -6201,7 +6190,6 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
bail_up:
	mutex_unlock(&tl_inode->i_mutex);

	mlog_exit(status);
	return status;
}

@@ -6221,8 +6209,6 @@ void ocfs2_truncate_log_shutdown(struct ocfs2_super *osb)
		brelse(osb->osb_tl_bh);
		iput(osb->osb_tl_inode);
	}

	mlog_exit_void();
}

int ocfs2_truncate_log_init(struct ocfs2_super *osb)
@@ -6246,7 +6232,6 @@ int ocfs2_truncate_log_init(struct ocfs2_super *osb)
	osb->osb_tl_bh    = tl_bh;
	osb->osb_tl_inode = tl_inode;

	mlog_exit(status);
	return status;
}

@@ -7112,7 +7097,6 @@ bail:

	ocfs2_free_path(path);

	mlog_exit(status);
	return status;
}

+4 −15
Original line number Diff line number Diff line
@@ -123,7 +123,6 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
bail:
	brelse(bh);

	mlog_exit(err);
	return err;
}

@@ -208,7 +207,6 @@ bail:
	if (err < 0)
		err = -EIO;

	mlog_exit(err);
	return err;
}

@@ -323,7 +321,6 @@ out_inode_unlock:
out:
	if (unlock)
		unlock_page(page);
	mlog_exit(ret);
	return ret;
}

@@ -402,8 +399,6 @@ static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)

	ret = block_write_full_page(page, ocfs2_get_block, wbc);

	mlog_exit(ret);

	return ret;
}

@@ -484,8 +479,6 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
bail:
	status = err ? 0 : p_blkno;

	mlog_exit((int)status);

	return status;
}

@@ -616,7 +609,6 @@ static ssize_t ocfs2_direct_IO(int rw,
{
	struct file *file = iocb->ki_filp;
	struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host;
	int ret;

	/*
	 * Fallback to buffered I/O if we see an inode without
@@ -629,13 +621,10 @@ static ssize_t ocfs2_direct_IO(int rw,
	if (i_size_read(inode) <= offset)
		return 0;

	ret = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev,
	return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev,
				    iov, offset, nr_segs,
				    ocfs2_direct_IO_get_blocks,
				    ocfs2_dio_end_io, NULL, 0);

	mlog_exit(ret);
	return ret;
}

static void ocfs2_figure_cluster_boundaries(struct ocfs2_super *osb,
+4 −3
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
	 * can get modified during recovery even if read-only. */
	if (ocfs2_is_hard_readonly(osb)) {
		ret = -EROFS;
		mlog_errno(ret);
		goto out;
	}

@@ -91,11 +92,11 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
		 * uptodate. */
		ret = -EIO;
		put_bh(bh);
		mlog_errno(ret);
	}

	ocfs2_metadata_cache_io_unlock(ci);
out:
	mlog_exit(ret);
	return ret;
}

@@ -374,7 +375,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,

bail:

	mlog_exit(status);
	return status;
}

@@ -413,6 +413,7 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,

	if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) {
		ret = -EROFS;
		mlog_errno(ret);
		goto out;
	}

@@ -432,9 +433,9 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
	if (!buffer_uptodate(bh)) {
		ret = -EIO;
		put_bh(bh);
		mlog_errno(ret);
	}

out:
	mlog_exit(ret);
	return ret;
}
+0 −1
Original line number Diff line number Diff line
@@ -1679,7 +1679,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
	}

out:
	mlog_exit(ret);
	return ret;
}

+1 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@

struct mlog_bits mlog_and_bits = MLOG_BITS_RHS(MLOG_INITIAL_AND_MASK);
EXPORT_SYMBOL_GPL(mlog_and_bits);
struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(MLOG_INITIAL_NOT_MASK);
struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(0);
EXPORT_SYMBOL_GPL(mlog_not_bits);

static ssize_t mlog_mask_show(u64 mask, char *buf)
@@ -80,7 +80,6 @@ struct mlog_attribute {
}

static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
	define_mask(EXIT),
	define_mask(TCP),
	define_mask(MSG),
	define_mask(SOCKET),
Loading