diff options
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 190 |
1 files changed, 93 insertions, 97 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 1e1a93aa0526..41565ae52856 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <linux/quotaops.h> | 38 | #include <linux/quotaops.h> |
39 | #include <linux/blkdev.h> | 39 | #include <linux/blkdev.h> |
40 | 40 | ||
41 | #define MLOG_MASK_PREFIX ML_INODE | ||
42 | #include <cluster/masklog.h> | 41 | #include <cluster/masklog.h> |
43 | 42 | ||
44 | #include "ocfs2.h" | 43 | #include "ocfs2.h" |
@@ -61,6 +60,7 @@ | |||
61 | #include "acl.h" | 60 | #include "acl.h" |
62 | #include "quota.h" | 61 | #include "quota.h" |
63 | #include "refcounttree.h" | 62 | #include "refcounttree.h" |
63 | #include "ocfs2_trace.h" | ||
64 | 64 | ||
65 | #include "buffer_head_io.h" | 65 | #include "buffer_head_io.h" |
66 | 66 | ||
@@ -99,8 +99,10 @@ 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(0, "(0x%p, 0x%p, '%.*s')\n", inode, file, | 102 | trace_ocfs2_file_open(inode, file, file->f_path.dentry, |
103 | file->f_path.dentry->d_name.len, file->f_path.dentry->d_name.name); | 103 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
104 | file->f_path.dentry->d_name.len, | ||
105 | file->f_path.dentry->d_name.name, mode); | ||
104 | 106 | ||
105 | if (file->f_mode & FMODE_WRITE) | 107 | if (file->f_mode & FMODE_WRITE) |
106 | dquot_initialize(inode); | 108 | dquot_initialize(inode); |
@@ -142,13 +144,15 @@ static int ocfs2_file_release(struct inode *inode, struct file *file) | |||
142 | { | 144 | { |
143 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 145 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
144 | 146 | ||
145 | mlog(0, "(0x%p, 0x%p, '%.*s')\n", inode, file, | ||
146 | file->f_path.dentry->d_name.len, | ||
147 | file->f_path.dentry->d_name.name); | ||
148 | |||
149 | spin_lock(&oi->ip_lock); | 147 | spin_lock(&oi->ip_lock); |
150 | if (!--oi->ip_open_count) | 148 | if (!--oi->ip_open_count) |
151 | oi->ip_flags &= ~OCFS2_INODE_OPEN_DIRECT; | 149 | oi->ip_flags &= ~OCFS2_INODE_OPEN_DIRECT; |
150 | |||
151 | trace_ocfs2_file_release(inode, file, file->f_path.dentry, | ||
152 | oi->ip_blkno, | ||
153 | file->f_path.dentry->d_name.len, | ||
154 | file->f_path.dentry->d_name.name, | ||
155 | oi->ip_open_count); | ||
152 | spin_unlock(&oi->ip_lock); | 156 | spin_unlock(&oi->ip_lock); |
153 | 157 | ||
154 | ocfs2_free_file_private(inode, file); | 158 | ocfs2_free_file_private(inode, file); |
@@ -174,9 +178,11 @@ static int ocfs2_sync_file(struct file *file, int datasync) | |||
174 | struct inode *inode = file->f_mapping->host; | 178 | struct inode *inode = file->f_mapping->host; |
175 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 179 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
176 | 180 | ||
177 | mlog(0, "(0x%p, %d, 0x%p, '%.*s')\n", file, datasync, | 181 | trace_ocfs2_sync_file(inode, file, file->f_path.dentry, |
178 | file->f_path.dentry, file->f_path.dentry->d_name.len, | 182 | OCFS2_I(inode)->ip_blkno, |
179 | file->f_path.dentry->d_name.name); | 183 | file->f_path.dentry->d_name.len, |
184 | file->f_path.dentry->d_name.name, | ||
185 | (unsigned long long)datasync); | ||
180 | 186 | ||
181 | if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) { | 187 | if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) { |
182 | /* | 188 | /* |
@@ -431,14 +437,14 @@ static int ocfs2_truncate_file(struct inode *inode, | |||
431 | struct ocfs2_dinode *fe = NULL; | 437 | struct ocfs2_dinode *fe = NULL; |
432 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 438 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
433 | 439 | ||
434 | mlog(0, "(inode = %llu, new_i_size = %llu\n", | ||
435 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | ||
436 | (unsigned long long)new_i_size); | ||
437 | |||
438 | /* We trust di_bh because it comes from ocfs2_inode_lock(), which | 440 | /* We trust di_bh because it comes from ocfs2_inode_lock(), which |
439 | * already validated it */ | 441 | * already validated it */ |
440 | fe = (struct ocfs2_dinode *) di_bh->b_data; | 442 | fe = (struct ocfs2_dinode *) di_bh->b_data; |
441 | 443 | ||
444 | trace_ocfs2_truncate_file((unsigned long long)OCFS2_I(inode)->ip_blkno, | ||
445 | (unsigned long long)le64_to_cpu(fe->i_size), | ||
446 | (unsigned long long)new_i_size); | ||
447 | |||
442 | mlog_bug_on_msg(le64_to_cpu(fe->i_size) != i_size_read(inode), | 448 | mlog_bug_on_msg(le64_to_cpu(fe->i_size) != i_size_read(inode), |
443 | "Inode %llu, inode i_size = %lld != di " | 449 | "Inode %llu, inode i_size = %lld != di " |
444 | "i_size = %llu, i_flags = 0x%x\n", | 450 | "i_size = %llu, i_flags = 0x%x\n", |
@@ -448,19 +454,14 @@ static int ocfs2_truncate_file(struct inode *inode, | |||
448 | le32_to_cpu(fe->i_flags)); | 454 | le32_to_cpu(fe->i_flags)); |
449 | 455 | ||
450 | if (new_i_size > le64_to_cpu(fe->i_size)) { | 456 | if (new_i_size > le64_to_cpu(fe->i_size)) { |
451 | mlog(0, "asked to truncate file with size (%llu) to size (%llu)!\n", | 457 | trace_ocfs2_truncate_file_error( |
452 | (unsigned long long)le64_to_cpu(fe->i_size), | 458 | (unsigned long long)le64_to_cpu(fe->i_size), |
453 | (unsigned long long)new_i_size); | 459 | (unsigned long long)new_i_size); |
454 | status = -EINVAL; | 460 | status = -EINVAL; |
455 | mlog_errno(status); | 461 | mlog_errno(status); |
456 | goto bail; | 462 | goto bail; |
457 | } | 463 | } |
458 | 464 | ||
459 | mlog(0, "inode %llu, i_size = %llu, new_i_size = %llu\n", | ||
460 | (unsigned long long)le64_to_cpu(fe->i_blkno), | ||
461 | (unsigned long long)le64_to_cpu(fe->i_size), | ||
462 | (unsigned long long)new_i_size); | ||
463 | |||
464 | /* lets handle the simple truncate cases before doing any more | 465 | /* lets handle the simple truncate cases before doing any more |
465 | * cluster locking. */ | 466 | * cluster locking. */ |
466 | if (new_i_size == le64_to_cpu(fe->i_size)) | 467 | if (new_i_size == le64_to_cpu(fe->i_size)) |
@@ -566,8 +567,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, | |||
566 | struct ocfs2_extent_tree et; | 567 | struct ocfs2_extent_tree et; |
567 | int did_quota = 0; | 568 | int did_quota = 0; |
568 | 569 | ||
569 | mlog(0, "(clusters_to_add = %u)\n", clusters_to_add); | ||
570 | |||
571 | /* | 570 | /* |
572 | * This function only exists for file systems which don't | 571 | * This function only exists for file systems which don't |
573 | * support holes. | 572 | * support holes. |
@@ -584,11 +583,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, | |||
584 | restart_all: | 583 | restart_all: |
585 | BUG_ON(le32_to_cpu(fe->i_clusters) != OCFS2_I(inode)->ip_clusters); | 584 | BUG_ON(le32_to_cpu(fe->i_clusters) != OCFS2_I(inode)->ip_clusters); |
586 | 585 | ||
587 | mlog(0, "extend inode %llu, i_size = %lld, di->i_clusters = %u, " | ||
588 | "clusters_to_add = %u\n", | ||
589 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | ||
590 | (long long)i_size_read(inode), le32_to_cpu(fe->i_clusters), | ||
591 | clusters_to_add); | ||
592 | ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), bh); | 586 | ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), bh); |
593 | status = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, | 587 | status = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, |
594 | &data_ac, &meta_ac); | 588 | &data_ac, &meta_ac); |
@@ -608,6 +602,12 @@ restart_all: | |||
608 | } | 602 | } |
609 | 603 | ||
610 | restarted_transaction: | 604 | restarted_transaction: |
605 | trace_ocfs2_extend_allocation( | ||
606 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | ||
607 | (unsigned long long)i_size_read(inode), | ||
608 | le32_to_cpu(fe->i_clusters), clusters_to_add, | ||
609 | why, restart_func); | ||
610 | |||
611 | status = dquot_alloc_space_nodirty(inode, | 611 | status = dquot_alloc_space_nodirty(inode, |
612 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_add)); | 612 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_add)); |
613 | if (status) | 613 | if (status) |
@@ -654,13 +654,11 @@ restarted_transaction: | |||
654 | 654 | ||
655 | if (why != RESTART_NONE && clusters_to_add) { | 655 | if (why != RESTART_NONE && clusters_to_add) { |
656 | if (why == RESTART_META) { | 656 | if (why == RESTART_META) { |
657 | mlog(0, "restarting function.\n"); | ||
658 | restart_func = 1; | 657 | restart_func = 1; |
659 | status = 0; | 658 | status = 0; |
660 | } else { | 659 | } else { |
661 | BUG_ON(why != RESTART_TRANS); | 660 | BUG_ON(why != RESTART_TRANS); |
662 | 661 | ||
663 | mlog(0, "restarting transaction.\n"); | ||
664 | /* TODO: This can be more intelligent. */ | 662 | /* TODO: This can be more intelligent. */ |
665 | credits = ocfs2_calc_extend_credits(osb->sb, | 663 | credits = ocfs2_calc_extend_credits(osb->sb, |
666 | &fe->id2.i_list, | 664 | &fe->id2.i_list, |
@@ -677,11 +675,11 @@ restarted_transaction: | |||
677 | } | 675 | } |
678 | } | 676 | } |
679 | 677 | ||
680 | mlog(0, "fe: i_clusters = %u, i_size=%llu\n", | 678 | trace_ocfs2_extend_allocation_end(OCFS2_I(inode)->ip_blkno, |
681 | le32_to_cpu(fe->i_clusters), | 679 | le32_to_cpu(fe->i_clusters), |
682 | (unsigned long long)le64_to_cpu(fe->i_size)); | 680 | (unsigned long long)le64_to_cpu(fe->i_size), |
683 | mlog(0, "inode: ip_clusters=%u, i_size=%lld\n", | 681 | OCFS2_I(inode)->ip_clusters, |
684 | OCFS2_I(inode)->ip_clusters, (long long)i_size_read(inode)); | 682 | (unsigned long long)i_size_read(inode)); |
685 | 683 | ||
686 | leave: | 684 | leave: |
687 | if (status < 0 && did_quota) | 685 | if (status < 0 && did_quota) |
@@ -772,10 +770,11 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, | |||
772 | if (!zero_to) | 770 | if (!zero_to) |
773 | zero_to = PAGE_CACHE_SIZE; | 771 | zero_to = PAGE_CACHE_SIZE; |
774 | 772 | ||
775 | mlog(0, | 773 | trace_ocfs2_write_zero_page( |
776 | "abs_from = %llu, abs_to = %llu, index = %lu, zero_from = %u, zero_to = %u\n", | 774 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
777 | (unsigned long long)abs_from, (unsigned long long)abs_to, | 775 | (unsigned long long)abs_from, |
778 | index, zero_from, zero_to); | 776 | (unsigned long long)abs_to, |
777 | index, zero_from, zero_to); | ||
779 | 778 | ||
780 | /* We know that zero_from is block aligned */ | 779 | /* We know that zero_from is block aligned */ |
781 | for (block_start = zero_from; block_start < zero_to; | 780 | for (block_start = zero_from; block_start < zero_to; |
@@ -915,9 +914,10 @@ static int ocfs2_zero_extend_range(struct inode *inode, u64 range_start, | |||
915 | u64 next_pos; | 914 | u64 next_pos; |
916 | u64 zero_pos = range_start; | 915 | u64 zero_pos = range_start; |
917 | 916 | ||
918 | mlog(0, "range_start = %llu, range_end = %llu\n", | 917 | trace_ocfs2_zero_extend_range( |
919 | (unsigned long long)range_start, | 918 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
920 | (unsigned long long)range_end); | 919 | (unsigned long long)range_start, |
920 | (unsigned long long)range_end); | ||
921 | BUG_ON(range_start >= range_end); | 921 | BUG_ON(range_start >= range_end); |
922 | 922 | ||
923 | while (zero_pos < range_end) { | 923 | while (zero_pos < range_end) { |
@@ -949,9 +949,9 @@ int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh, | |||
949 | struct super_block *sb = inode->i_sb; | 949 | struct super_block *sb = inode->i_sb; |
950 | 950 | ||
951 | zero_start = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode)); | 951 | zero_start = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode)); |
952 | mlog(0, "zero_start %llu for i_size %llu\n", | 952 | trace_ocfs2_zero_extend((unsigned long long)OCFS2_I(inode)->ip_blkno, |
953 | (unsigned long long)zero_start, | 953 | (unsigned long long)zero_start, |
954 | (unsigned long long)i_size_read(inode)); | 954 | (unsigned long long)i_size_read(inode)); |
955 | while (zero_start < zero_to_size) { | 955 | while (zero_start < zero_to_size) { |
956 | ret = ocfs2_zero_extend_get_range(inode, di_bh, zero_start, | 956 | ret = ocfs2_zero_extend_get_range(inode, di_bh, zero_start, |
957 | zero_to_size, | 957 | zero_to_size, |
@@ -1100,30 +1100,20 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) | |||
1100 | struct dquot *transfer_to[MAXQUOTAS] = { }; | 1100 | struct dquot *transfer_to[MAXQUOTAS] = { }; |
1101 | int qtype; | 1101 | int qtype; |
1102 | 1102 | ||
1103 | mlog(0, "(0x%p, '%.*s')\n", dentry, | 1103 | trace_ocfs2_setattr(inode, dentry, |
1104 | dentry->d_name.len, dentry->d_name.name); | 1104 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
1105 | dentry->d_name.len, dentry->d_name.name, | ||
1106 | attr->ia_valid, attr->ia_mode, | ||
1107 | attr->ia_uid, attr->ia_gid); | ||
1105 | 1108 | ||
1106 | /* ensuring we don't even attempt to truncate a symlink */ | 1109 | /* ensuring we don't even attempt to truncate a symlink */ |
1107 | if (S_ISLNK(inode->i_mode)) | 1110 | if (S_ISLNK(inode->i_mode)) |
1108 | attr->ia_valid &= ~ATTR_SIZE; | 1111 | attr->ia_valid &= ~ATTR_SIZE; |
1109 | 1112 | ||
1110 | if (attr->ia_valid & ATTR_MODE) | ||
1111 | mlog(0, "mode change: %d\n", attr->ia_mode); | ||
1112 | if (attr->ia_valid & ATTR_UID) | ||
1113 | mlog(0, "uid change: %d\n", attr->ia_uid); | ||
1114 | if (attr->ia_valid & ATTR_GID) | ||
1115 | mlog(0, "gid change: %d\n", attr->ia_gid); | ||
1116 | if (attr->ia_valid & ATTR_SIZE) | ||
1117 | mlog(0, "size change...\n"); | ||
1118 | if (attr->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME)) | ||
1119 | mlog(0, "time change...\n"); | ||
1120 | |||
1121 | #define OCFS2_VALID_ATTRS (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_SIZE \ | 1113 | #define OCFS2_VALID_ATTRS (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_SIZE \ |
1122 | | ATTR_GID | ATTR_UID | ATTR_MODE) | 1114 | | ATTR_GID | ATTR_UID | ATTR_MODE) |
1123 | if (!(attr->ia_valid & OCFS2_VALID_ATTRS)) { | 1115 | if (!(attr->ia_valid & OCFS2_VALID_ATTRS)) |
1124 | mlog(0, "can't handle attrs: 0x%x\n", attr->ia_valid); | ||
1125 | return 0; | 1116 | return 0; |
1126 | } | ||
1127 | 1117 | ||
1128 | status = inode_change_ok(inode, attr); | 1118 | status = inode_change_ok(inode, attr); |
1129 | if (status) | 1119 | if (status) |
@@ -1318,8 +1308,9 @@ static int __ocfs2_write_remove_suid(struct inode *inode, | |||
1318 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 1308 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
1319 | struct ocfs2_dinode *di; | 1309 | struct ocfs2_dinode *di; |
1320 | 1310 | ||
1321 | mlog(0, "(Inode %llu, mode 0%o)\n", | 1311 | trace_ocfs2_write_remove_suid( |
1322 | (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode); | 1312 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
1313 | inode->i_mode); | ||
1323 | 1314 | ||
1324 | handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); | 1315 | handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); |
1325 | if (IS_ERR(handle)) { | 1316 | if (IS_ERR(handle)) { |
@@ -1525,8 +1516,9 @@ static int ocfs2_zero_partial_clusters(struct inode *inode, | |||
1525 | * partial clusters here. There's no need to worry about | 1516 | * partial clusters here. There's no need to worry about |
1526 | * physical allocation - the zeroing code knows to skip holes. | 1517 | * physical allocation - the zeroing code knows to skip holes. |
1527 | */ | 1518 | */ |
1528 | mlog(0, "byte start: %llu, end: %llu\n", | 1519 | trace_ocfs2_zero_partial_clusters( |
1529 | (unsigned long long)start, (unsigned long long)end); | 1520 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
1521 | (unsigned long long)start, (unsigned long long)end); | ||
1530 | 1522 | ||
1531 | /* | 1523 | /* |
1532 | * If both edges are on a cluster boundary then there's no | 1524 | * If both edges are on a cluster boundary then there's no |
@@ -1550,8 +1542,8 @@ static int ocfs2_zero_partial_clusters(struct inode *inode, | |||
1550 | if (tmpend > end) | 1542 | if (tmpend > end) |
1551 | tmpend = end; | 1543 | tmpend = end; |
1552 | 1544 | ||
1553 | mlog(0, "1st range: start: %llu, tmpend: %llu\n", | 1545 | trace_ocfs2_zero_partial_clusters_range1((unsigned long long)start, |
1554 | (unsigned long long)start, (unsigned long long)tmpend); | 1546 | (unsigned long long)tmpend); |
1555 | 1547 | ||
1556 | ret = ocfs2_zero_range_for_truncate(inode, handle, start, tmpend); | 1548 | ret = ocfs2_zero_range_for_truncate(inode, handle, start, tmpend); |
1557 | if (ret) | 1549 | if (ret) |
@@ -1565,8 +1557,8 @@ static int ocfs2_zero_partial_clusters(struct inode *inode, | |||
1565 | */ | 1557 | */ |
1566 | start = end & ~(osb->s_clustersize - 1); | 1558 | start = end & ~(osb->s_clustersize - 1); |
1567 | 1559 | ||
1568 | mlog(0, "2nd range: start: %llu, end: %llu\n", | 1560 | trace_ocfs2_zero_partial_clusters_range2( |
1569 | (unsigned long long)start, (unsigned long long)end); | 1561 | (unsigned long long)start, (unsigned long long)end); |
1570 | 1562 | ||
1571 | ret = ocfs2_zero_range_for_truncate(inode, handle, start, end); | 1563 | ret = ocfs2_zero_range_for_truncate(inode, handle, start, end); |
1572 | if (ret) | 1564 | if (ret) |
@@ -1666,6 +1658,11 @@ static int ocfs2_remove_inode_range(struct inode *inode, | |||
1666 | ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh); | 1658 | ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh); |
1667 | ocfs2_init_dealloc_ctxt(&dealloc); | 1659 | ocfs2_init_dealloc_ctxt(&dealloc); |
1668 | 1660 | ||
1661 | trace_ocfs2_remove_inode_range( | ||
1662 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | ||
1663 | (unsigned long long)byte_start, | ||
1664 | (unsigned long long)byte_len); | ||
1665 | |||
1669 | if (byte_len == 0) | 1666 | if (byte_len == 0) |
1670 | return 0; | 1667 | return 0; |
1671 | 1668 | ||
@@ -1712,11 +1709,6 @@ static int ocfs2_remove_inode_range(struct inode *inode, | |||
1712 | trunc_end = (byte_start + byte_len) >> osb->s_clustersize_bits; | 1709 | trunc_end = (byte_start + byte_len) >> osb->s_clustersize_bits; |
1713 | cluster_in_el = trunc_end; | 1710 | cluster_in_el = trunc_end; |
1714 | 1711 | ||
1715 | mlog(0, "Inode: %llu, start: %llu, len: %llu, cstart: %u, cend: %u\n", | ||
1716 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | ||
1717 | (unsigned long long)byte_start, | ||
1718 | (unsigned long long)byte_len, trunc_start, trunc_end); | ||
1719 | |||
1720 | ret = ocfs2_zero_partial_clusters(inode, byte_start, byte_len); | 1712 | ret = ocfs2_zero_partial_clusters(inode, byte_start, byte_len); |
1721 | if (ret) { | 1713 | if (ret) { |
1722 | mlog_errno(ret); | 1714 | mlog_errno(ret); |
@@ -2071,7 +2063,7 @@ static int ocfs2_prepare_inode_for_write(struct file *file, | |||
2071 | int ret = 0, meta_level = 0; | 2063 | int ret = 0, meta_level = 0; |
2072 | struct dentry *dentry = file->f_path.dentry; | 2064 | struct dentry *dentry = file->f_path.dentry; |
2073 | struct inode *inode = dentry->d_inode; | 2065 | struct inode *inode = dentry->d_inode; |
2074 | loff_t saved_pos, end; | 2066 | loff_t saved_pos = 0, end; |
2075 | 2067 | ||
2076 | /* | 2068 | /* |
2077 | * We start with a read level meta lock and only jump to an ex | 2069 | * We start with a read level meta lock and only jump to an ex |
@@ -2110,12 +2102,10 @@ static int ocfs2_prepare_inode_for_write(struct file *file, | |||
2110 | 2102 | ||
2111 | /* work on a copy of ppos until we're sure that we won't have | 2103 | /* work on a copy of ppos until we're sure that we won't have |
2112 | * to recalculate it due to relocking. */ | 2104 | * to recalculate it due to relocking. */ |
2113 | if (appending) { | 2105 | if (appending) |
2114 | saved_pos = i_size_read(inode); | 2106 | saved_pos = i_size_read(inode); |
2115 | mlog(0, "O_APPEND: inode->i_size=%llu\n", saved_pos); | 2107 | else |
2116 | } else { | ||
2117 | saved_pos = *ppos; | 2108 | saved_pos = *ppos; |
2118 | } | ||
2119 | 2109 | ||
2120 | end = saved_pos + count; | 2110 | end = saved_pos + count; |
2121 | 2111 | ||
@@ -2186,6 +2176,10 @@ static int ocfs2_prepare_inode_for_write(struct file *file, | |||
2186 | *ppos = saved_pos; | 2176 | *ppos = saved_pos; |
2187 | 2177 | ||
2188 | out_unlock: | 2178 | out_unlock: |
2179 | trace_ocfs2_prepare_inode_for_write(OCFS2_I(inode)->ip_blkno, | ||
2180 | saved_pos, appending, count, | ||
2181 | direct_io, has_refcount); | ||
2182 | |||
2189 | if (meta_level >= 0) | 2183 | if (meta_level >= 0) |
2190 | ocfs2_inode_unlock(inode, meta_level); | 2184 | ocfs2_inode_unlock(inode, meta_level); |
2191 | 2185 | ||
@@ -2211,10 +2205,11 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, | |||
2211 | int full_coherency = !(osb->s_mount_opt & | 2205 | int full_coherency = !(osb->s_mount_opt & |
2212 | OCFS2_MOUNT_COHERENCY_BUFFERED); | 2206 | OCFS2_MOUNT_COHERENCY_BUFFERED); |
2213 | 2207 | ||
2214 | mlog(0, "(0x%p, %u, '%.*s')\n", file, | 2208 | trace_ocfs2_file_aio_write(inode, file, file->f_path.dentry, |
2215 | (unsigned int)nr_segs, | 2209 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
2216 | file->f_path.dentry->d_name.len, | 2210 | file->f_path.dentry->d_name.len, |
2217 | file->f_path.dentry->d_name.name); | 2211 | file->f_path.dentry->d_name.name, |
2212 | (unsigned int)nr_segs); | ||
2218 | 2213 | ||
2219 | if (iocb->ki_left == 0) | 2214 | if (iocb->ki_left == 0) |
2220 | return 0; | 2215 | return 0; |
@@ -2415,10 +2410,11 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, | |||
2415 | .u.file = out, | 2410 | .u.file = out, |
2416 | }; | 2411 | }; |
2417 | 2412 | ||
2418 | mlog(0, "(0x%p, 0x%p, %u, '%.*s')\n", out, pipe, | 2413 | |
2419 | (unsigned int)len, | 2414 | trace_ocfs2_file_splice_write(inode, out, out->f_path.dentry, |
2420 | out->f_path.dentry->d_name.len, | 2415 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
2421 | out->f_path.dentry->d_name.name); | 2416 | out->f_path.dentry->d_name.len, |
2417 | out->f_path.dentry->d_name.name, len); | ||
2422 | 2418 | ||
2423 | if (pipe->inode) | 2419 | if (pipe->inode) |
2424 | mutex_lock_nested(&pipe->inode->i_mutex, I_MUTEX_PARENT); | 2420 | mutex_lock_nested(&pipe->inode->i_mutex, I_MUTEX_PARENT); |
@@ -2474,10 +2470,10 @@ static ssize_t ocfs2_file_splice_read(struct file *in, | |||
2474 | int ret = 0, lock_level = 0; | 2470 | int ret = 0, lock_level = 0; |
2475 | struct inode *inode = in->f_path.dentry->d_inode; | 2471 | struct inode *inode = in->f_path.dentry->d_inode; |
2476 | 2472 | ||
2477 | mlog(0, "(0x%p, 0x%p, %u, '%.*s')\n", in, pipe, | 2473 | trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry, |
2478 | (unsigned int)len, | 2474 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
2479 | in->f_path.dentry->d_name.len, | 2475 | in->f_path.dentry->d_name.len, |
2480 | in->f_path.dentry->d_name.name); | 2476 | in->f_path.dentry->d_name.name, len); |
2481 | 2477 | ||
2482 | /* | 2478 | /* |
2483 | * See the comment in ocfs2_file_aio_read() | 2479 | * See the comment in ocfs2_file_aio_read() |
@@ -2504,10 +2500,11 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, | |||
2504 | struct file *filp = iocb->ki_filp; | 2500 | struct file *filp = iocb->ki_filp; |
2505 | struct inode *inode = filp->f_path.dentry->d_inode; | 2501 | struct inode *inode = filp->f_path.dentry->d_inode; |
2506 | 2502 | ||
2507 | mlog(0, "(0x%p, %u, '%.*s')\n", filp, | 2503 | trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry, |
2508 | (unsigned int)nr_segs, | 2504 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
2509 | filp->f_path.dentry->d_name.len, | 2505 | filp->f_path.dentry->d_name.len, |
2510 | filp->f_path.dentry->d_name.name); | 2506 | filp->f_path.dentry->d_name.name, nr_segs); |
2507 | |||
2511 | 2508 | ||
2512 | if (!inode) { | 2509 | if (!inode) { |
2513 | ret = -EINVAL; | 2510 | ret = -EINVAL; |
@@ -2553,8 +2550,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, | |||
2553 | ocfs2_inode_unlock(inode, lock_level); | 2550 | ocfs2_inode_unlock(inode, lock_level); |
2554 | 2551 | ||
2555 | ret = generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos); | 2552 | ret = generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos); |
2556 | if (ret == -EINVAL) | 2553 | trace_generic_file_aio_read_ret(ret); |
2557 | mlog(0, "generic_file_aio_read returned -EINVAL\n"); | ||
2558 | 2554 | ||
2559 | /* buffered aio wouldn't have proper lock coverage today */ | 2555 | /* buffered aio wouldn't have proper lock coverage today */ |
2560 | BUG_ON(ret == -EIOCBQUEUED && !(filp->f_flags & O_DIRECT)); | 2556 | BUG_ON(ret == -EIOCBQUEUED && !(filp->f_flags & O_DIRECT)); |