diff options
author | Tao Ma <boyu.mt@taobao.com> | 2011-02-20 22:10:44 -0500 |
---|---|---|
committer | Tao Ma <boyu.mt@taobao.com> | 2011-02-20 22:10:44 -0500 |
commit | ef6b689b63b9f5227ccee6f16dd9ee3faf58a464 (patch) | |
tree | ebe3416fcc221e152f2625e8e8794e92e3d8c979 /fs/ocfs2/file.c | |
parent | 422e6c4bc4b48c15b3cb57a1ca71431abfc57e54 (diff) |
ocfs2: Remove ENTRY from masklog.
ENTRY is used to record the entry 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.
So for mlog_entry_void, we just remove it.
for mlog_entry(...), we replace it with mlog(0,...), and they
will be replace by trace event later.
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index a6651956482e..71375d7b7bbe 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -99,8 +99,8 @@ static int ocfs2_file_open(struct inode *inode, struct file *file) | |||
99 | int mode = file->f_flags; | 99 | int mode = file->f_flags; |
100 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 100 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
101 | 101 | ||
102 | mlog_entry("(0x%p, 0x%p, '%.*s')\n", inode, file, | 102 | mlog(0, "(0x%p, 0x%p, '%.*s')\n", inode, file, |
103 | file->f_path.dentry->d_name.len, file->f_path.dentry->d_name.name); | 103 | file->f_path.dentry->d_name.len, file->f_path.dentry->d_name.name); |
104 | 104 | ||
105 | if (file->f_mode & FMODE_WRITE) | 105 | if (file->f_mode & FMODE_WRITE) |
106 | dquot_initialize(inode); | 106 | dquot_initialize(inode); |
@@ -143,9 +143,9 @@ static int ocfs2_file_release(struct inode *inode, struct file *file) | |||
143 | { | 143 | { |
144 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 144 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
145 | 145 | ||
146 | mlog_entry("(0x%p, 0x%p, '%.*s')\n", inode, file, | 146 | mlog(0, "(0x%p, 0x%p, '%.*s')\n", inode, file, |
147 | file->f_path.dentry->d_name.len, | 147 | file->f_path.dentry->d_name.len, |
148 | file->f_path.dentry->d_name.name); | 148 | file->f_path.dentry->d_name.name); |
149 | 149 | ||
150 | spin_lock(&oi->ip_lock); | 150 | spin_lock(&oi->ip_lock); |
151 | if (!--oi->ip_open_count) | 151 | if (!--oi->ip_open_count) |
@@ -177,9 +177,9 @@ static int ocfs2_sync_file(struct file *file, int datasync) | |||
177 | struct inode *inode = file->f_mapping->host; | 177 | struct inode *inode = file->f_mapping->host; |
178 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 178 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
179 | 179 | ||
180 | mlog_entry("(0x%p, %d, 0x%p, '%.*s')\n", file, datasync, | 180 | mlog(0, "(0x%p, %d, 0x%p, '%.*s')\n", file, datasync, |
181 | file->f_path.dentry, file->f_path.dentry->d_name.len, | 181 | file->f_path.dentry, file->f_path.dentry->d_name.len, |
182 | file->f_path.dentry->d_name.name); | 182 | file->f_path.dentry->d_name.name); |
183 | 183 | ||
184 | if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) { | 184 | if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) { |
185 | /* | 185 | /* |
@@ -251,8 +251,6 @@ int ocfs2_update_inode_atime(struct inode *inode, | |||
251 | handle_t *handle; | 251 | handle_t *handle; |
252 | struct ocfs2_dinode *di = (struct ocfs2_dinode *) bh->b_data; | 252 | struct ocfs2_dinode *di = (struct ocfs2_dinode *) bh->b_data; |
253 | 253 | ||
254 | mlog_entry_void(); | ||
255 | |||
256 | handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); | 254 | handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); |
257 | if (IS_ERR(handle)) { | 255 | if (IS_ERR(handle)) { |
258 | ret = PTR_ERR(handle); | 256 | ret = PTR_ERR(handle); |
@@ -291,7 +289,6 @@ static int ocfs2_set_inode_size(handle_t *handle, | |||
291 | { | 289 | { |
292 | int status; | 290 | int status; |
293 | 291 | ||
294 | mlog_entry_void(); | ||
295 | i_size_write(inode, new_i_size); | 292 | i_size_write(inode, new_i_size); |
296 | inode->i_blocks = ocfs2_inode_sector_count(inode); | 293 | inode->i_blocks = ocfs2_inode_sector_count(inode); |
297 | inode->i_ctime = inode->i_mtime = CURRENT_TIME; | 294 | inode->i_ctime = inode->i_mtime = CURRENT_TIME; |
@@ -375,8 +372,6 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, | |||
375 | struct ocfs2_dinode *di; | 372 | struct ocfs2_dinode *di; |
376 | u64 cluster_bytes; | 373 | u64 cluster_bytes; |
377 | 374 | ||
378 | mlog_entry_void(); | ||
379 | |||
380 | /* | 375 | /* |
381 | * We need to CoW the cluster contains the offset if it is reflinked | 376 | * We need to CoW the cluster contains the offset if it is reflinked |
382 | * since we will call ocfs2_zero_range_for_truncate later which will | 377 | * since we will call ocfs2_zero_range_for_truncate later which will |
@@ -442,9 +437,9 @@ static int ocfs2_truncate_file(struct inode *inode, | |||
442 | struct ocfs2_dinode *fe = NULL; | 437 | struct ocfs2_dinode *fe = NULL; |
443 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 438 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
444 | 439 | ||
445 | mlog_entry("(inode = %llu, new_i_size = %llu\n", | 440 | mlog(0, "(inode = %llu, new_i_size = %llu\n", |
446 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 441 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
447 | (unsigned long long)new_i_size); | 442 | (unsigned long long)new_i_size); |
448 | 443 | ||
449 | /* We trust di_bh because it comes from ocfs2_inode_lock(), which | 444 | /* We trust di_bh because it comes from ocfs2_inode_lock(), which |
450 | * already validated it */ | 445 | * already validated it */ |
@@ -578,7 +573,7 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, | |||
578 | struct ocfs2_extent_tree et; | 573 | struct ocfs2_extent_tree et; |
579 | int did_quota = 0; | 574 | int did_quota = 0; |
580 | 575 | ||
581 | mlog_entry("(clusters_to_add = %u)\n", clusters_to_add); | 576 | mlog(0, "(clusters_to_add = %u)\n", clusters_to_add); |
582 | 577 | ||
583 | /* | 578 | /* |
584 | * This function only exists for file systems which don't | 579 | * This function only exists for file systems which don't |
@@ -1113,8 +1108,8 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) | |||
1113 | struct dquot *transfer_to[MAXQUOTAS] = { }; | 1108 | struct dquot *transfer_to[MAXQUOTAS] = { }; |
1114 | int qtype; | 1109 | int qtype; |
1115 | 1110 | ||
1116 | mlog_entry("(0x%p, '%.*s')\n", dentry, | 1111 | mlog(0, "(0x%p, '%.*s')\n", dentry, |
1117 | dentry->d_name.len, dentry->d_name.name); | 1112 | dentry->d_name.len, dentry->d_name.name); |
1118 | 1113 | ||
1119 | /* ensuring we don't even attempt to truncate a symlink */ | 1114 | /* ensuring we don't even attempt to truncate a symlink */ |
1120 | if (S_ISLNK(inode->i_mode)) | 1115 | if (S_ISLNK(inode->i_mode)) |
@@ -1287,8 +1282,6 @@ int ocfs2_getattr(struct vfsmount *mnt, | |||
1287 | struct ocfs2_super *osb = sb->s_fs_info; | 1282 | struct ocfs2_super *osb = sb->s_fs_info; |
1288 | int err; | 1283 | int err; |
1289 | 1284 | ||
1290 | mlog_entry_void(); | ||
1291 | |||
1292 | err = ocfs2_inode_revalidate(dentry); | 1285 | err = ocfs2_inode_revalidate(dentry); |
1293 | if (err) { | 1286 | if (err) { |
1294 | if (err != -ENOENT) | 1287 | if (err != -ENOENT) |
@@ -1314,8 +1307,6 @@ int ocfs2_permission(struct inode *inode, int mask, unsigned int flags) | |||
1314 | if (flags & IPERM_FLAG_RCU) | 1307 | if (flags & IPERM_FLAG_RCU) |
1315 | return -ECHILD; | 1308 | return -ECHILD; |
1316 | 1309 | ||
1317 | mlog_entry_void(); | ||
1318 | |||
1319 | ret = ocfs2_inode_lock(inode, NULL, 0); | 1310 | ret = ocfs2_inode_lock(inode, NULL, 0); |
1320 | if (ret) { | 1311 | if (ret) { |
1321 | if (ret != -ENOENT) | 1312 | if (ret != -ENOENT) |
@@ -1339,8 +1330,8 @@ static int __ocfs2_write_remove_suid(struct inode *inode, | |||
1339 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 1330 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
1340 | struct ocfs2_dinode *di; | 1331 | struct ocfs2_dinode *di; |
1341 | 1332 | ||
1342 | mlog_entry("(Inode %llu, mode 0%o)\n", | 1333 | mlog(0, "(Inode %llu, mode 0%o)\n", |
1343 | (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode); | 1334 | (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode); |
1344 | 1335 | ||
1345 | handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); | 1336 | handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); |
1346 | if (IS_ERR(handle)) { | 1337 | if (IS_ERR(handle)) { |
@@ -2233,10 +2224,10 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, | |||
2233 | int full_coherency = !(osb->s_mount_opt & | 2224 | int full_coherency = !(osb->s_mount_opt & |
2234 | OCFS2_MOUNT_COHERENCY_BUFFERED); | 2225 | OCFS2_MOUNT_COHERENCY_BUFFERED); |
2235 | 2226 | ||
2236 | mlog_entry("(0x%p, %u, '%.*s')\n", file, | 2227 | mlog(0, "(0x%p, %u, '%.*s')\n", file, |
2237 | (unsigned int)nr_segs, | 2228 | (unsigned int)nr_segs, |
2238 | file->f_path.dentry->d_name.len, | 2229 | file->f_path.dentry->d_name.len, |
2239 | file->f_path.dentry->d_name.name); | 2230 | file->f_path.dentry->d_name.name); |
2240 | 2231 | ||
2241 | if (iocb->ki_left == 0) | 2232 | if (iocb->ki_left == 0) |
2242 | return 0; | 2233 | return 0; |
@@ -2438,10 +2429,10 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, | |||
2438 | .u.file = out, | 2429 | .u.file = out, |
2439 | }; | 2430 | }; |
2440 | 2431 | ||
2441 | mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", out, pipe, | 2432 | mlog(0, "(0x%p, 0x%p, %u, '%.*s')\n", out, pipe, |
2442 | (unsigned int)len, | 2433 | (unsigned int)len, |
2443 | out->f_path.dentry->d_name.len, | 2434 | out->f_path.dentry->d_name.len, |
2444 | out->f_path.dentry->d_name.name); | 2435 | out->f_path.dentry->d_name.name); |
2445 | 2436 | ||
2446 | if (pipe->inode) | 2437 | if (pipe->inode) |
2447 | mutex_lock_nested(&pipe->inode->i_mutex, I_MUTEX_PARENT); | 2438 | mutex_lock_nested(&pipe->inode->i_mutex, I_MUTEX_PARENT); |
@@ -2498,10 +2489,10 @@ static ssize_t ocfs2_file_splice_read(struct file *in, | |||
2498 | int ret = 0, lock_level = 0; | 2489 | int ret = 0, lock_level = 0; |
2499 | struct inode *inode = in->f_path.dentry->d_inode; | 2490 | struct inode *inode = in->f_path.dentry->d_inode; |
2500 | 2491 | ||
2501 | mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", in, pipe, | 2492 | mlog(0, "(0x%p, 0x%p, %u, '%.*s')\n", in, pipe, |
2502 | (unsigned int)len, | 2493 | (unsigned int)len, |
2503 | in->f_path.dentry->d_name.len, | 2494 | in->f_path.dentry->d_name.len, |
2504 | in->f_path.dentry->d_name.name); | 2495 | in->f_path.dentry->d_name.name); |
2505 | 2496 | ||
2506 | /* | 2497 | /* |
2507 | * See the comment in ocfs2_file_aio_read() | 2498 | * See the comment in ocfs2_file_aio_read() |
@@ -2529,10 +2520,10 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, | |||
2529 | struct file *filp = iocb->ki_filp; | 2520 | struct file *filp = iocb->ki_filp; |
2530 | struct inode *inode = filp->f_path.dentry->d_inode; | 2521 | struct inode *inode = filp->f_path.dentry->d_inode; |
2531 | 2522 | ||
2532 | mlog_entry("(0x%p, %u, '%.*s')\n", filp, | 2523 | mlog(0, "(0x%p, %u, '%.*s')\n", filp, |
2533 | (unsigned int)nr_segs, | 2524 | (unsigned int)nr_segs, |
2534 | filp->f_path.dentry->d_name.len, | 2525 | filp->f_path.dentry->d_name.len, |
2535 | filp->f_path.dentry->d_name.name); | 2526 | filp->f_path.dentry->d_name.name); |
2536 | 2527 | ||
2537 | if (!inode) { | 2528 | if (!inode) { |
2538 | ret = -EINVAL; | 2529 | ret = -EINVAL; |