diff options
Diffstat (limited to 'fs/ocfs2/namei.c')
| -rw-r--r-- | fs/ocfs2/namei.c | 175 |
1 files changed, 87 insertions, 88 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index d6c25d76b537..28f2cc1080d8 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
| @@ -42,7 +42,6 @@ | |||
| 42 | #include <linux/highmem.h> | 42 | #include <linux/highmem.h> |
| 43 | #include <linux/quotaops.h> | 43 | #include <linux/quotaops.h> |
| 44 | 44 | ||
| 45 | #define MLOG_MASK_PREFIX ML_NAMEI | ||
| 46 | #include <cluster/masklog.h> | 45 | #include <cluster/masklog.h> |
| 47 | 46 | ||
| 48 | #include "ocfs2.h" | 47 | #include "ocfs2.h" |
| @@ -63,6 +62,7 @@ | |||
| 63 | #include "uptodate.h" | 62 | #include "uptodate.h" |
| 64 | #include "xattr.h" | 63 | #include "xattr.h" |
| 65 | #include "acl.h" | 64 | #include "acl.h" |
| 65 | #include "ocfs2_trace.h" | ||
| 66 | 66 | ||
| 67 | #include "buffer_head_io.h" | 67 | #include "buffer_head_io.h" |
| 68 | 68 | ||
| @@ -106,17 +106,15 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
| 106 | struct dentry *ret; | 106 | struct dentry *ret; |
| 107 | struct ocfs2_inode_info *oi; | 107 | struct ocfs2_inode_info *oi; |
| 108 | 108 | ||
| 109 | mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry, | 109 | trace_ocfs2_lookup(dir, dentry, dentry->d_name.len, |
| 110 | dentry->d_name.len, dentry->d_name.name); | 110 | dentry->d_name.name, |
| 111 | (unsigned long long)OCFS2_I(dir)->ip_blkno, 0); | ||
| 111 | 112 | ||
| 112 | if (dentry->d_name.len > OCFS2_MAX_FILENAME_LEN) { | 113 | if (dentry->d_name.len > OCFS2_MAX_FILENAME_LEN) { |
| 113 | ret = ERR_PTR(-ENAMETOOLONG); | 114 | ret = ERR_PTR(-ENAMETOOLONG); |
| 114 | goto bail; | 115 | goto bail; |
| 115 | } | 116 | } |
| 116 | 117 | ||
| 117 | mlog(0, "find name %.*s in directory %llu\n", dentry->d_name.len, | ||
| 118 | dentry->d_name.name, (unsigned long long)OCFS2_I(dir)->ip_blkno); | ||
| 119 | |||
| 120 | status = ocfs2_inode_lock_nested(dir, NULL, 0, OI_LS_PARENT); | 118 | status = ocfs2_inode_lock_nested(dir, NULL, 0, OI_LS_PARENT); |
| 121 | if (status < 0) { | 119 | if (status < 0) { |
| 122 | if (status != -ENOENT) | 120 | if (status != -ENOENT) |
| @@ -182,7 +180,7 @@ bail_unlock: | |||
| 182 | 180 | ||
| 183 | bail: | 181 | bail: |
| 184 | 182 | ||
| 185 | mlog_exit_ptr(ret); | 183 | trace_ocfs2_lookup_ret(ret); |
| 186 | 184 | ||
| 187 | return ret; | 185 | return ret; |
| 188 | } | 186 | } |
| @@ -235,9 +233,9 @@ static int ocfs2_mknod(struct inode *dir, | |||
| 235 | sigset_t oldset; | 233 | sigset_t oldset; |
| 236 | int did_block_signals = 0; | 234 | int did_block_signals = 0; |
| 237 | 235 | ||
| 238 | mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode, | 236 | trace_ocfs2_mknod(dir, dentry, dentry->d_name.len, dentry->d_name.name, |
| 239 | (unsigned long)dev, dentry->d_name.len, | 237 | (unsigned long long)OCFS2_I(dir)->ip_blkno, |
| 240 | dentry->d_name.name); | 238 | (unsigned long)dev, mode); |
| 241 | 239 | ||
| 242 | dquot_initialize(dir); | 240 | dquot_initialize(dir); |
| 243 | 241 | ||
| @@ -354,10 +352,6 @@ static int ocfs2_mknod(struct inode *dir, | |||
| 354 | goto leave; | 352 | goto leave; |
| 355 | did_quota_inode = 1; | 353 | did_quota_inode = 1; |
| 356 | 354 | ||
| 357 | mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, | ||
| 358 | inode->i_mode, (unsigned long)dev, dentry->d_name.len, | ||
| 359 | dentry->d_name.name); | ||
| 360 | |||
| 361 | /* do the real work now. */ | 355 | /* do the real work now. */ |
| 362 | status = ocfs2_mknod_locked(osb, dir, inode, dev, | 356 | status = ocfs2_mknod_locked(osb, dir, inode, dev, |
| 363 | &new_fe_bh, parent_fe_bh, handle, | 357 | &new_fe_bh, parent_fe_bh, handle, |
| @@ -436,9 +430,6 @@ leave: | |||
| 436 | if (did_block_signals) | 430 | if (did_block_signals) |
| 437 | ocfs2_unblock_signals(&oldset); | 431 | ocfs2_unblock_signals(&oldset); |
| 438 | 432 | ||
| 439 | if (status == -ENOSPC) | ||
| 440 | mlog(0, "Disk is full\n"); | ||
| 441 | |||
| 442 | brelse(new_fe_bh); | 433 | brelse(new_fe_bh); |
| 443 | brelse(parent_fe_bh); | 434 | brelse(parent_fe_bh); |
| 444 | kfree(si.name); | 435 | kfree(si.name); |
| @@ -466,7 +457,8 @@ leave: | |||
| 466 | iput(inode); | 457 | iput(inode); |
| 467 | } | 458 | } |
| 468 | 459 | ||
| 469 | mlog_exit(status); | 460 | if (status) |
| 461 | mlog_errno(status); | ||
| 470 | 462 | ||
| 471 | return status; | 463 | return status; |
| 472 | } | 464 | } |
| @@ -577,7 +569,8 @@ leave: | |||
| 577 | } | 569 | } |
| 578 | } | 570 | } |
| 579 | 571 | ||
| 580 | mlog_exit(status); | 572 | if (status) |
| 573 | mlog_errno(status); | ||
| 581 | return status; | 574 | return status; |
| 582 | } | 575 | } |
| 583 | 576 | ||
| @@ -615,10 +608,11 @@ static int ocfs2_mkdir(struct inode *dir, | |||
| 615 | { | 608 | { |
| 616 | int ret; | 609 | int ret; |
| 617 | 610 | ||
| 618 | mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode, | 611 | trace_ocfs2_mkdir(dir, dentry, dentry->d_name.len, dentry->d_name.name, |
| 619 | dentry->d_name.len, dentry->d_name.name); | 612 | OCFS2_I(dir)->ip_blkno, mode); |
| 620 | ret = ocfs2_mknod(dir, dentry, mode | S_IFDIR, 0); | 613 | ret = ocfs2_mknod(dir, dentry, mode | S_IFDIR, 0); |
| 621 | mlog_exit(ret); | 614 | if (ret) |
| 615 | mlog_errno(ret); | ||
| 622 | 616 | ||
| 623 | return ret; | 617 | return ret; |
| 624 | } | 618 | } |
| @@ -630,10 +624,11 @@ static int ocfs2_create(struct inode *dir, | |||
| 630 | { | 624 | { |
| 631 | int ret; | 625 | int ret; |
| 632 | 626 | ||
| 633 | mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode, | 627 | trace_ocfs2_create(dir, dentry, dentry->d_name.len, dentry->d_name.name, |
| 634 | dentry->d_name.len, dentry->d_name.name); | 628 | (unsigned long long)OCFS2_I(dir)->ip_blkno, mode); |
| 635 | ret = ocfs2_mknod(dir, dentry, mode | S_IFREG, 0); | 629 | ret = ocfs2_mknod(dir, dentry, mode | S_IFREG, 0); |
| 636 | mlog_exit(ret); | 630 | if (ret) |
| 631 | mlog_errno(ret); | ||
| 637 | 632 | ||
| 638 | return ret; | 633 | return ret; |
| 639 | } | 634 | } |
| @@ -652,9 +647,9 @@ static int ocfs2_link(struct dentry *old_dentry, | |||
| 652 | struct ocfs2_dir_lookup_result lookup = { NULL, }; | 647 | struct ocfs2_dir_lookup_result lookup = { NULL, }; |
| 653 | sigset_t oldset; | 648 | sigset_t oldset; |
| 654 | 649 | ||
| 655 | mlog_entry("(inode=%lu, old='%.*s' new='%.*s')\n", inode->i_ino, | 650 | trace_ocfs2_link((unsigned long long)OCFS2_I(inode)->ip_blkno, |
| 656 | old_dentry->d_name.len, old_dentry->d_name.name, | 651 | old_dentry->d_name.len, old_dentry->d_name.name, |
| 657 | dentry->d_name.len, dentry->d_name.name); | 652 | dentry->d_name.len, dentry->d_name.name); |
| 658 | 653 | ||
| 659 | if (S_ISDIR(inode->i_mode)) | 654 | if (S_ISDIR(inode->i_mode)) |
| 660 | return -EPERM; | 655 | return -EPERM; |
| @@ -757,7 +752,8 @@ out: | |||
| 757 | 752 | ||
| 758 | ocfs2_free_dir_lookup_result(&lookup); | 753 | ocfs2_free_dir_lookup_result(&lookup); |
| 759 | 754 | ||
| 760 | mlog_exit(err); | 755 | if (err) |
| 756 | mlog_errno(err); | ||
| 761 | 757 | ||
| 762 | return err; | 758 | return err; |
| 763 | } | 759 | } |
| @@ -809,19 +805,17 @@ static int ocfs2_unlink(struct inode *dir, | |||
| 809 | struct ocfs2_dir_lookup_result lookup = { NULL, }; | 805 | struct ocfs2_dir_lookup_result lookup = { NULL, }; |
| 810 | struct ocfs2_dir_lookup_result orphan_insert = { NULL, }; | 806 | struct ocfs2_dir_lookup_result orphan_insert = { NULL, }; |
| 811 | 807 | ||
| 812 | mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry, | 808 | trace_ocfs2_unlink(dir, dentry, dentry->d_name.len, |
| 813 | dentry->d_name.len, dentry->d_name.name); | 809 | dentry->d_name.name, |
| 810 | (unsigned long long)OCFS2_I(dir)->ip_blkno, | ||
| 811 | (unsigned long long)OCFS2_I(inode)->ip_blkno); | ||
| 814 | 812 | ||
| 815 | dquot_initialize(dir); | 813 | dquot_initialize(dir); |
| 816 | 814 | ||
| 817 | BUG_ON(dentry->d_parent->d_inode != dir); | 815 | BUG_ON(dentry->d_parent->d_inode != dir); |
| 818 | 816 | ||
| 819 | mlog(0, "ino = %llu\n", (unsigned long long)OCFS2_I(inode)->ip_blkno); | 817 | if (inode == osb->root_inode) |
| 820 | |||
| 821 | if (inode == osb->root_inode) { | ||
| 822 | mlog(0, "Cannot delete the root directory\n"); | ||
| 823 | return -EPERM; | 818 | return -EPERM; |
| 824 | } | ||
| 825 | 819 | ||
| 826 | status = ocfs2_inode_lock_nested(dir, &parent_node_bh, 1, | 820 | status = ocfs2_inode_lock_nested(dir, &parent_node_bh, 1, |
| 827 | OI_LS_PARENT); | 821 | OI_LS_PARENT); |
| @@ -843,9 +837,10 @@ static int ocfs2_unlink(struct inode *dir, | |||
| 843 | if (OCFS2_I(inode)->ip_blkno != blkno) { | 837 | if (OCFS2_I(inode)->ip_blkno != blkno) { |
| 844 | status = -ENOENT; | 838 | status = -ENOENT; |
| 845 | 839 | ||
| 846 | mlog(0, "ip_blkno %llu != dirent blkno %llu ip_flags = %x\n", | 840 | trace_ocfs2_unlink_noent( |
| 847 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 841 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
| 848 | (unsigned long long)blkno, OCFS2_I(inode)->ip_flags); | 842 | (unsigned long long)blkno, |
| 843 | OCFS2_I(inode)->ip_flags); | ||
| 849 | goto leave; | 844 | goto leave; |
| 850 | } | 845 | } |
| 851 | 846 | ||
| @@ -954,7 +949,8 @@ leave: | |||
| 954 | ocfs2_free_dir_lookup_result(&orphan_insert); | 949 | ocfs2_free_dir_lookup_result(&orphan_insert); |
| 955 | ocfs2_free_dir_lookup_result(&lookup); | 950 | ocfs2_free_dir_lookup_result(&lookup); |
| 956 | 951 | ||
| 957 | mlog_exit(status); | 952 | if (status) |
| 953 | mlog_errno(status); | ||
| 958 | 954 | ||
| 959 | return status; | 955 | return status; |
| 960 | } | 956 | } |
| @@ -975,9 +971,8 @@ static int ocfs2_double_lock(struct ocfs2_super *osb, | |||
| 975 | struct buffer_head **tmpbh; | 971 | struct buffer_head **tmpbh; |
| 976 | struct inode *tmpinode; | 972 | struct inode *tmpinode; |
| 977 | 973 | ||
| 978 | mlog_entry("(inode1 = %llu, inode2 = %llu)\n", | 974 | trace_ocfs2_double_lock((unsigned long long)oi1->ip_blkno, |
| 979 | (unsigned long long)oi1->ip_blkno, | 975 | (unsigned long long)oi2->ip_blkno); |
| 980 | (unsigned long long)oi2->ip_blkno); | ||
| 981 | 976 | ||
| 982 | if (*bh1) | 977 | if (*bh1) |
| 983 | *bh1 = NULL; | 978 | *bh1 = NULL; |
| @@ -988,7 +983,6 @@ static int ocfs2_double_lock(struct ocfs2_super *osb, | |||
| 988 | if (oi1->ip_blkno != oi2->ip_blkno) { | 983 | if (oi1->ip_blkno != oi2->ip_blkno) { |
| 989 | if (oi1->ip_blkno < oi2->ip_blkno) { | 984 | if (oi1->ip_blkno < oi2->ip_blkno) { |
| 990 | /* switch id1 and id2 around */ | 985 | /* switch id1 and id2 around */ |
| 991 | mlog(0, "switching them around...\n"); | ||
| 992 | tmpbh = bh2; | 986 | tmpbh = bh2; |
| 993 | bh2 = bh1; | 987 | bh2 = bh1; |
| 994 | bh1 = tmpbh; | 988 | bh1 = tmpbh; |
| @@ -1024,8 +1018,13 @@ static int ocfs2_double_lock(struct ocfs2_super *osb, | |||
| 1024 | mlog_errno(status); | 1018 | mlog_errno(status); |
| 1025 | } | 1019 | } |
| 1026 | 1020 | ||
| 1021 | trace_ocfs2_double_lock_end( | ||
| 1022 | (unsigned long long)OCFS2_I(inode1)->ip_blkno, | ||
| 1023 | (unsigned long long)OCFS2_I(inode2)->ip_blkno); | ||
| 1024 | |||
| 1027 | bail: | 1025 | bail: |
| 1028 | mlog_exit(status); | 1026 | if (status) |
| 1027 | mlog_errno(status); | ||
| 1029 | return status; | 1028 | return status; |
| 1030 | } | 1029 | } |
| 1031 | 1030 | ||
| @@ -1067,10 +1066,9 @@ static int ocfs2_rename(struct inode *old_dir, | |||
| 1067 | /* At some point it might be nice to break this function up a | 1066 | /* At some point it might be nice to break this function up a |
| 1068 | * bit. */ | 1067 | * bit. */ |
| 1069 | 1068 | ||
| 1070 | mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p, from='%.*s' to='%.*s')\n", | 1069 | trace_ocfs2_rename(old_dir, old_dentry, new_dir, new_dentry, |
| 1071 | old_dir, old_dentry, new_dir, new_dentry, | 1070 | old_dentry->d_name.len, old_dentry->d_name.name, |
| 1072 | old_dentry->d_name.len, old_dentry->d_name.name, | 1071 | new_dentry->d_name.len, new_dentry->d_name.name); |
| 1073 | new_dentry->d_name.len, new_dentry->d_name.name); | ||
| 1074 | 1072 | ||
| 1075 | dquot_initialize(old_dir); | 1073 | dquot_initialize(old_dir); |
| 1076 | dquot_initialize(new_dir); | 1074 | dquot_initialize(new_dir); |
| @@ -1227,16 +1225,15 @@ static int ocfs2_rename(struct inode *old_dir, | |||
| 1227 | if (!new_inode) { | 1225 | if (!new_inode) { |
| 1228 | status = -EACCES; | 1226 | status = -EACCES; |
| 1229 | 1227 | ||
| 1230 | mlog(0, "We found an inode for name %.*s but VFS " | 1228 | trace_ocfs2_rename_target_exists(new_dentry->d_name.len, |
| 1231 | "didn't give us one.\n", new_dentry->d_name.len, | 1229 | new_dentry->d_name.name); |
| 1232 | new_dentry->d_name.name); | ||
| 1233 | goto bail; | 1230 | goto bail; |
| 1234 | } | 1231 | } |
| 1235 | 1232 | ||
| 1236 | if (OCFS2_I(new_inode)->ip_blkno != newfe_blkno) { | 1233 | if (OCFS2_I(new_inode)->ip_blkno != newfe_blkno) { |
| 1237 | status = -EACCES; | 1234 | status = -EACCES; |
| 1238 | 1235 | ||
| 1239 | mlog(0, "Inode %llu and dir %llu disagree. flags = %x\n", | 1236 | trace_ocfs2_rename_disagree( |
| 1240 | (unsigned long long)OCFS2_I(new_inode)->ip_blkno, | 1237 | (unsigned long long)OCFS2_I(new_inode)->ip_blkno, |
| 1241 | (unsigned long long)newfe_blkno, | 1238 | (unsigned long long)newfe_blkno, |
| 1242 | OCFS2_I(new_inode)->ip_flags); | 1239 | OCFS2_I(new_inode)->ip_flags); |
| @@ -1259,8 +1256,7 @@ static int ocfs2_rename(struct inode *old_dir, | |||
| 1259 | 1256 | ||
| 1260 | newfe = (struct ocfs2_dinode *) newfe_bh->b_data; | 1257 | newfe = (struct ocfs2_dinode *) newfe_bh->b_data; |
| 1261 | 1258 | ||
| 1262 | mlog(0, "aha rename over existing... new_blkno=%llu " | 1259 | trace_ocfs2_rename_over_existing( |
| 1263 | "newfebh=%p bhblocknr=%llu\n", | ||
| 1264 | (unsigned long long)newfe_blkno, newfe_bh, newfe_bh ? | 1260 | (unsigned long long)newfe_blkno, newfe_bh, newfe_bh ? |
| 1265 | (unsigned long long)newfe_bh->b_blocknr : 0ULL); | 1261 | (unsigned long long)newfe_bh->b_blocknr : 0ULL); |
| 1266 | 1262 | ||
| @@ -1476,7 +1472,8 @@ bail: | |||
| 1476 | brelse(old_dir_bh); | 1472 | brelse(old_dir_bh); |
| 1477 | brelse(new_dir_bh); | 1473 | brelse(new_dir_bh); |
| 1478 | 1474 | ||
| 1479 | mlog_exit(status); | 1475 | if (status) |
| 1476 | mlog_errno(status); | ||
| 1480 | 1477 | ||
| 1481 | return status; | 1478 | return status; |
| 1482 | } | 1479 | } |
| @@ -1501,9 +1498,8 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, | |||
| 1501 | * write i_size + 1 bytes. */ | 1498 | * write i_size + 1 bytes. */ |
| 1502 | blocks = (bytes_left + sb->s_blocksize - 1) >> sb->s_blocksize_bits; | 1499 | blocks = (bytes_left + sb->s_blocksize - 1) >> sb->s_blocksize_bits; |
| 1503 | 1500 | ||
| 1504 | mlog_entry("i_blocks = %llu, i_size = %llu, blocks = %d\n", | 1501 | trace_ocfs2_create_symlink_data((unsigned long long)inode->i_blocks, |
| 1505 | (unsigned long long)inode->i_blocks, | 1502 | i_size_read(inode), blocks); |
| 1506 | i_size_read(inode), blocks); | ||
| 1507 | 1503 | ||
| 1508 | /* Sanity check -- make sure we're going to fit. */ | 1504 | /* Sanity check -- make sure we're going to fit. */ |
| 1509 | if (bytes_left > | 1505 | if (bytes_left > |
| @@ -1579,7 +1575,8 @@ bail: | |||
| 1579 | kfree(bhs); | 1575 | kfree(bhs); |
| 1580 | } | 1576 | } |
| 1581 | 1577 | ||
| 1582 | mlog_exit(status); | 1578 | if (status) |
| 1579 | mlog_errno(status); | ||
| 1583 | return status; | 1580 | return status; |
| 1584 | } | 1581 | } |
| 1585 | 1582 | ||
| @@ -1610,8 +1607,8 @@ static int ocfs2_symlink(struct inode *dir, | |||
| 1610 | sigset_t oldset; | 1607 | sigset_t oldset; |
| 1611 | int did_block_signals = 0; | 1608 | int did_block_signals = 0; |
| 1612 | 1609 | ||
| 1613 | mlog_entry("(0x%p, 0x%p, symname='%s' actual='%.*s')\n", dir, | 1610 | trace_ocfs2_symlink_begin(dir, dentry, symname, |
| 1614 | dentry, symname, dentry->d_name.len, dentry->d_name.name); | 1611 | dentry->d_name.len, dentry->d_name.name); |
| 1615 | 1612 | ||
| 1616 | dquot_initialize(dir); | 1613 | dquot_initialize(dir); |
| 1617 | 1614 | ||
| @@ -1713,9 +1710,10 @@ static int ocfs2_symlink(struct inode *dir, | |||
| 1713 | goto bail; | 1710 | goto bail; |
| 1714 | did_quota_inode = 1; | 1711 | did_quota_inode = 1; |
| 1715 | 1712 | ||
| 1716 | mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, | 1713 | trace_ocfs2_symlink_create(dir, dentry, dentry->d_name.len, |
| 1717 | inode->i_mode, dentry->d_name.len, | 1714 | dentry->d_name.name, |
| 1718 | dentry->d_name.name); | 1715 | (unsigned long long)OCFS2_I(dir)->ip_blkno, |
| 1716 | inode->i_mode); | ||
| 1719 | 1717 | ||
| 1720 | status = ocfs2_mknod_locked(osb, dir, inode, | 1718 | status = ocfs2_mknod_locked(osb, dir, inode, |
| 1721 | 0, &new_fe_bh, parent_fe_bh, handle, | 1719 | 0, &new_fe_bh, parent_fe_bh, handle, |
| @@ -1835,7 +1833,8 @@ bail: | |||
| 1835 | iput(inode); | 1833 | iput(inode); |
| 1836 | } | 1834 | } |
| 1837 | 1835 | ||
| 1838 | mlog_exit(status); | 1836 | if (status) |
| 1837 | mlog_errno(status); | ||
| 1839 | 1838 | ||
| 1840 | return status; | 1839 | return status; |
| 1841 | } | 1840 | } |
| @@ -1844,8 +1843,6 @@ static int ocfs2_blkno_stringify(u64 blkno, char *name) | |||
| 1844 | { | 1843 | { |
| 1845 | int status, namelen; | 1844 | int status, namelen; |
| 1846 | 1845 | ||
| 1847 | mlog_entry_void(); | ||
| 1848 | |||
| 1849 | namelen = snprintf(name, OCFS2_ORPHAN_NAMELEN + 1, "%016llx", | 1846 | namelen = snprintf(name, OCFS2_ORPHAN_NAMELEN + 1, "%016llx", |
| 1850 | (long long)blkno); | 1847 | (long long)blkno); |
| 1851 | if (namelen <= 0) { | 1848 | if (namelen <= 0) { |
| @@ -1862,12 +1859,12 @@ static int ocfs2_blkno_stringify(u64 blkno, char *name) | |||
| 1862 | goto bail; | 1859 | goto bail; |
| 1863 | } | 1860 | } |
| 1864 | 1861 | ||
| 1865 | mlog(0, "built filename '%s' for orphan dir (len=%d)\n", name, | 1862 | trace_ocfs2_blkno_stringify(blkno, name, namelen); |
| 1866 | namelen); | ||
| 1867 | 1863 | ||
| 1868 | status = 0; | 1864 | status = 0; |
| 1869 | bail: | 1865 | bail: |
| 1870 | mlog_exit(status); | 1866 | if (status < 0) |
| 1867 | mlog_errno(status); | ||
| 1871 | return status; | 1868 | return status; |
| 1872 | } | 1869 | } |
| 1873 | 1870 | ||
| @@ -1980,7 +1977,8 @@ out: | |||
| 1980 | iput(orphan_dir_inode); | 1977 | iput(orphan_dir_inode); |
| 1981 | } | 1978 | } |
| 1982 | 1979 | ||
| 1983 | mlog_exit(ret); | 1980 | if (ret) |
| 1981 | mlog_errno(ret); | ||
| 1984 | return ret; | 1982 | return ret; |
| 1985 | } | 1983 | } |
| 1986 | 1984 | ||
| @@ -1997,7 +1995,8 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, | |||
| 1997 | struct ocfs2_dinode *orphan_fe; | 1995 | struct ocfs2_dinode *orphan_fe; |
| 1998 | struct ocfs2_dinode *fe = (struct ocfs2_dinode *) fe_bh->b_data; | 1996 | struct ocfs2_dinode *fe = (struct ocfs2_dinode *) fe_bh->b_data; |
| 1999 | 1997 | ||
| 2000 | mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino); | 1998 | trace_ocfs2_orphan_add_begin( |
| 1999 | (unsigned long long)OCFS2_I(inode)->ip_blkno); | ||
| 2001 | 2000 | ||
| 2002 | status = ocfs2_read_inode_block(orphan_dir_inode, &orphan_dir_bh); | 2001 | status = ocfs2_read_inode_block(orphan_dir_inode, &orphan_dir_bh); |
| 2003 | if (status < 0) { | 2002 | if (status < 0) { |
| @@ -2056,13 +2055,14 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, | |||
| 2056 | 2055 | ||
| 2057 | ocfs2_journal_dirty(handle, fe_bh); | 2056 | ocfs2_journal_dirty(handle, fe_bh); |
| 2058 | 2057 | ||
| 2059 | mlog(0, "Inode %llu orphaned in slot %d\n", | 2058 | trace_ocfs2_orphan_add_end((unsigned long long)OCFS2_I(inode)->ip_blkno, |
| 2060 | (unsigned long long)OCFS2_I(inode)->ip_blkno, osb->slot_num); | 2059 | osb->slot_num); |
| 2061 | 2060 | ||
| 2062 | leave: | 2061 | leave: |
| 2063 | brelse(orphan_dir_bh); | 2062 | brelse(orphan_dir_bh); |
| 2064 | 2063 | ||
| 2065 | mlog_exit(status); | 2064 | if (status) |
| 2065 | mlog_errno(status); | ||
| 2066 | return status; | 2066 | return status; |
| 2067 | } | 2067 | } |
| 2068 | 2068 | ||
| @@ -2078,17 +2078,15 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, | |||
| 2078 | int status = 0; | 2078 | int status = 0; |
| 2079 | struct ocfs2_dir_lookup_result lookup = { NULL, }; | 2079 | struct ocfs2_dir_lookup_result lookup = { NULL, }; |
| 2080 | 2080 | ||
| 2081 | mlog_entry_void(); | ||
| 2082 | |||
| 2083 | status = ocfs2_blkno_stringify(OCFS2_I(inode)->ip_blkno, name); | 2081 | status = ocfs2_blkno_stringify(OCFS2_I(inode)->ip_blkno, name); |
| 2084 | if (status < 0) { | 2082 | if (status < 0) { |
| 2085 | mlog_errno(status); | 2083 | mlog_errno(status); |
| 2086 | goto leave; | 2084 | goto leave; |
| 2087 | } | 2085 | } |
| 2088 | 2086 | ||
| 2089 | mlog(0, "removing '%s' from orphan dir %llu (namelen=%d)\n", | 2087 | trace_ocfs2_orphan_del( |
| 2090 | name, (unsigned long long)OCFS2_I(orphan_dir_inode)->ip_blkno, | 2088 | (unsigned long long)OCFS2_I(orphan_dir_inode)->ip_blkno, |
| 2091 | OCFS2_ORPHAN_NAMELEN); | 2089 | name, OCFS2_ORPHAN_NAMELEN); |
| 2092 | 2090 | ||
| 2093 | /* find it's spot in the orphan directory */ | 2091 | /* find it's spot in the orphan directory */ |
| 2094 | status = ocfs2_find_entry(name, OCFS2_ORPHAN_NAMELEN, orphan_dir_inode, | 2092 | status = ocfs2_find_entry(name, OCFS2_ORPHAN_NAMELEN, orphan_dir_inode, |
| @@ -2124,7 +2122,8 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, | |||
| 2124 | leave: | 2122 | leave: |
| 2125 | ocfs2_free_dir_lookup_result(&lookup); | 2123 | ocfs2_free_dir_lookup_result(&lookup); |
| 2126 | 2124 | ||
| 2127 | mlog_exit(status); | 2125 | if (status) |
| 2126 | mlog_errno(status); | ||
| 2128 | return status; | 2127 | return status; |
| 2129 | } | 2128 | } |
| 2130 | 2129 | ||
| @@ -2321,9 +2320,6 @@ leave: | |||
| 2321 | iput(orphan_dir); | 2320 | iput(orphan_dir); |
| 2322 | } | 2321 | } |
| 2323 | 2322 | ||
| 2324 | if (status == -ENOSPC) | ||
| 2325 | mlog(0, "Disk is full\n"); | ||
| 2326 | |||
| 2327 | if ((status < 0) && inode) { | 2323 | if ((status < 0) && inode) { |
| 2328 | clear_nlink(inode); | 2324 | clear_nlink(inode); |
| 2329 | iput(inode); | 2325 | iput(inode); |
| @@ -2358,8 +2354,10 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir, | |||
| 2358 | struct buffer_head *di_bh = NULL; | 2354 | struct buffer_head *di_bh = NULL; |
| 2359 | struct ocfs2_dir_lookup_result lookup = { NULL, }; | 2355 | struct ocfs2_dir_lookup_result lookup = { NULL, }; |
| 2360 | 2356 | ||
| 2361 | mlog_entry("(0x%p, 0x%p, %.*s')\n", dir, dentry, | 2357 | trace_ocfs2_mv_orphaned_inode_to_new(dir, dentry, |
| 2362 | dentry->d_name.len, dentry->d_name.name); | 2358 | dentry->d_name.len, dentry->d_name.name, |
| 2359 | (unsigned long long)OCFS2_I(dir)->ip_blkno, | ||
| 2360 | (unsigned long long)OCFS2_I(inode)->ip_blkno); | ||
| 2363 | 2361 | ||
| 2364 | status = ocfs2_inode_lock(dir, &parent_di_bh, 1); | 2362 | status = ocfs2_inode_lock(dir, &parent_di_bh, 1); |
| 2365 | if (status < 0) { | 2363 | if (status < 0) { |
| @@ -2476,7 +2474,8 @@ leave: | |||
| 2476 | 2474 | ||
| 2477 | ocfs2_free_dir_lookup_result(&lookup); | 2475 | ocfs2_free_dir_lookup_result(&lookup); |
| 2478 | 2476 | ||
| 2479 | mlog_exit(status); | 2477 | if (status) |
| 2478 | mlog_errno(status); | ||
| 2480 | 2479 | ||
| 2481 | return status; | 2480 | return status; |
| 2482 | } | 2481 | } |
