diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-28 16:03:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-28 16:03:31 -0400 |
commit | 03e4970c10151c5fb25ddd7e9a142d63c6a8d058 (patch) | |
tree | 393447b9d0a6ebc64689d6e793e80ad549b97e35 /fs/ocfs2/xattr.c | |
parent | 1788c208aab15f9d9d1d24cff0d0c64b5c73bbee (diff) | |
parent | 272b62c1f0f6f742046e45b50b6fec98860208a0 (diff) |
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: (39 commits)
Treat writes as new when holes span across page boundaries
fs,ocfs2: Move o2net_get_func_run_time under CONFIG_OCFS2_FS_STATS.
ocfs2/dlm: Move kmalloc() outside the spinlock
ocfs2: Make the left masklogs compat.
ocfs2: Remove masklog ML_AIO.
ocfs2: Remove masklog ML_UPTODATE.
ocfs2: Remove masklog ML_BH_IO.
ocfs2: Remove masklog ML_JOURNAL.
ocfs2: Remove masklog ML_EXPORT.
ocfs2: Remove masklog ML_DCACHE.
ocfs2: Remove masklog ML_NAMEI.
ocfs2: Remove mlog(0) from fs/ocfs2/dir.c
ocfs2: remove NAMEI from symlink.c
ocfs2: Remove masklog ML_QUOTA.
ocfs2: Remove mlog(0) from quota_local.c.
ocfs2: Remove masklog ML_RESERVATIONS.
ocfs2: Remove masklog ML_XATTR.
ocfs2: Remove masklog ML_SUPER.
ocfs2: Remove mlog(0) from fs/ocfs2/heartbeat.c
ocfs2: Remove mlog(0) from fs/ocfs2/slot_map.c
...
Fix up trivial conflict in fs/ocfs2/super.c
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 155 |
1 files changed, 75 insertions, 80 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 6bb602486c6b..57a215dc2d9b 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/string.h> | 37 | #include <linux/string.h> |
38 | #include <linux/security.h> | 38 | #include <linux/security.h> |
39 | 39 | ||
40 | #define MLOG_MASK_PREFIX ML_XATTR | ||
41 | #include <cluster/masklog.h> | 40 | #include <cluster/masklog.h> |
42 | 41 | ||
43 | #include "ocfs2.h" | 42 | #include "ocfs2.h" |
@@ -57,6 +56,7 @@ | |||
57 | #include "xattr.h" | 56 | #include "xattr.h" |
58 | #include "refcounttree.h" | 57 | #include "refcounttree.h" |
59 | #include "acl.h" | 58 | #include "acl.h" |
59 | #include "ocfs2_trace.h" | ||
60 | 60 | ||
61 | struct ocfs2_xattr_def_value_root { | 61 | struct ocfs2_xattr_def_value_root { |
62 | struct ocfs2_xattr_value_root xv; | 62 | struct ocfs2_xattr_value_root xv; |
@@ -474,8 +474,7 @@ static int ocfs2_validate_xattr_block(struct super_block *sb, | |||
474 | struct ocfs2_xattr_block *xb = | 474 | struct ocfs2_xattr_block *xb = |
475 | (struct ocfs2_xattr_block *)bh->b_data; | 475 | (struct ocfs2_xattr_block *)bh->b_data; |
476 | 476 | ||
477 | mlog(0, "Validating xattr block %llu\n", | 477 | trace_ocfs2_validate_xattr_block((unsigned long long)bh->b_blocknr); |
478 | (unsigned long long)bh->b_blocknr); | ||
479 | 478 | ||
480 | BUG_ON(!buffer_uptodate(bh)); | 479 | BUG_ON(!buffer_uptodate(bh)); |
481 | 480 | ||
@@ -715,11 +714,11 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
715 | u32 prev_clusters, logical_start = le32_to_cpu(vb->vb_xv->xr_clusters); | 714 | u32 prev_clusters, logical_start = le32_to_cpu(vb->vb_xv->xr_clusters); |
716 | struct ocfs2_extent_tree et; | 715 | struct ocfs2_extent_tree et; |
717 | 716 | ||
718 | mlog(0, "(clusters_to_add for xattr= %u)\n", clusters_to_add); | ||
719 | |||
720 | ocfs2_init_xattr_value_extent_tree(&et, INODE_CACHE(inode), vb); | 717 | ocfs2_init_xattr_value_extent_tree(&et, INODE_CACHE(inode), vb); |
721 | 718 | ||
722 | while (clusters_to_add) { | 719 | while (clusters_to_add) { |
720 | trace_ocfs2_xattr_extend_allocation(clusters_to_add); | ||
721 | |||
723 | status = vb->vb_access(handle, INODE_CACHE(inode), vb->vb_bh, | 722 | status = vb->vb_access(handle, INODE_CACHE(inode), vb->vb_bh, |
724 | OCFS2_JOURNAL_ACCESS_WRITE); | 723 | OCFS2_JOURNAL_ACCESS_WRITE); |
725 | if (status < 0) { | 724 | if (status < 0) { |
@@ -754,8 +753,6 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
754 | */ | 753 | */ |
755 | BUG_ON(why == RESTART_META); | 754 | BUG_ON(why == RESTART_META); |
756 | 755 | ||
757 | mlog(0, "restarting xattr value extension for %u" | ||
758 | " clusters,.\n", clusters_to_add); | ||
759 | credits = ocfs2_calc_extend_credits(inode->i_sb, | 756 | credits = ocfs2_calc_extend_credits(inode->i_sb, |
760 | &vb->vb_xv->xr_list, | 757 | &vb->vb_xv->xr_list, |
761 | clusters_to_add); | 758 | clusters_to_add); |
@@ -3246,8 +3243,8 @@ static int ocfs2_init_xattr_set_ctxt(struct inode *inode, | |||
3246 | } | 3243 | } |
3247 | 3244 | ||
3248 | meta_add += extra_meta; | 3245 | meta_add += extra_meta; |
3249 | mlog(0, "Set xattr %s, reserve meta blocks = %d, clusters = %d, " | 3246 | trace_ocfs2_init_xattr_set_ctxt(xi->xi_name, meta_add, |
3250 | "credits = %d\n", xi->xi_name, meta_add, clusters_add, *credits); | 3247 | clusters_add, *credits); |
3251 | 3248 | ||
3252 | if (meta_add) { | 3249 | if (meta_add) { |
3253 | ret = ocfs2_reserve_new_metadata_blocks(osb, meta_add, | 3250 | ret = ocfs2_reserve_new_metadata_blocks(osb, meta_add, |
@@ -3887,8 +3884,10 @@ static int ocfs2_xattr_bucket_find(struct inode *inode, | |||
3887 | 3884 | ||
3888 | if (found) { | 3885 | if (found) { |
3889 | xs->here = &xs->header->xh_entries[index]; | 3886 | xs->here = &xs->header->xh_entries[index]; |
3890 | mlog(0, "find xattr %s in bucket %llu, entry = %u\n", name, | 3887 | trace_ocfs2_xattr_bucket_find(OCFS2_I(inode)->ip_blkno, |
3891 | (unsigned long long)bucket_blkno(xs->bucket), index); | 3888 | name, name_index, name_hash, |
3889 | (unsigned long long)bucket_blkno(xs->bucket), | ||
3890 | index); | ||
3892 | } else | 3891 | } else |
3893 | ret = -ENODATA; | 3892 | ret = -ENODATA; |
3894 | 3893 | ||
@@ -3915,8 +3914,10 @@ static int ocfs2_xattr_index_block_find(struct inode *inode, | |||
3915 | if (le16_to_cpu(el->l_next_free_rec) == 0) | 3914 | if (le16_to_cpu(el->l_next_free_rec) == 0) |
3916 | return -ENODATA; | 3915 | return -ENODATA; |
3917 | 3916 | ||
3918 | mlog(0, "find xattr %s, hash = %u, index = %d in xattr tree\n", | 3917 | trace_ocfs2_xattr_index_block_find(OCFS2_I(inode)->ip_blkno, |
3919 | name, name_hash, name_index); | 3918 | name, name_index, name_hash, |
3919 | (unsigned long long)root_bh->b_blocknr, | ||
3920 | -1); | ||
3920 | 3921 | ||
3921 | ret = ocfs2_xattr_get_rec(inode, name_hash, &p_blkno, &first_hash, | 3922 | ret = ocfs2_xattr_get_rec(inode, name_hash, &p_blkno, &first_hash, |
3922 | &num_clusters, el); | 3923 | &num_clusters, el); |
@@ -3927,9 +3928,10 @@ static int ocfs2_xattr_index_block_find(struct inode *inode, | |||
3927 | 3928 | ||
3928 | BUG_ON(p_blkno == 0 || num_clusters == 0 || first_hash > name_hash); | 3929 | BUG_ON(p_blkno == 0 || num_clusters == 0 || first_hash > name_hash); |
3929 | 3930 | ||
3930 | mlog(0, "find xattr extent rec %u clusters from %llu, the first hash " | 3931 | trace_ocfs2_xattr_index_block_find_rec(OCFS2_I(inode)->ip_blkno, |
3931 | "in the rec is %u\n", num_clusters, (unsigned long long)p_blkno, | 3932 | name, name_index, first_hash, |
3932 | first_hash); | 3933 | (unsigned long long)p_blkno, |
3934 | num_clusters); | ||
3933 | 3935 | ||
3934 | ret = ocfs2_xattr_bucket_find(inode, name_index, name, name_hash, | 3936 | ret = ocfs2_xattr_bucket_find(inode, name_index, name, name_hash, |
3935 | p_blkno, first_hash, num_clusters, xs); | 3937 | p_blkno, first_hash, num_clusters, xs); |
@@ -3955,8 +3957,9 @@ static int ocfs2_iterate_xattr_buckets(struct inode *inode, | |||
3955 | return -ENOMEM; | 3957 | return -ENOMEM; |
3956 | } | 3958 | } |
3957 | 3959 | ||
3958 | mlog(0, "iterating xattr buckets in %u clusters starting from %llu\n", | 3960 | trace_ocfs2_iterate_xattr_buckets( |
3959 | clusters, (unsigned long long)blkno); | 3961 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
3962 | (unsigned long long)blkno, clusters); | ||
3960 | 3963 | ||
3961 | for (i = 0; i < num_buckets; i++, blkno += bucket->bu_blocks) { | 3964 | for (i = 0; i < num_buckets; i++, blkno += bucket->bu_blocks) { |
3962 | ret = ocfs2_read_xattr_bucket(bucket, blkno); | 3965 | ret = ocfs2_read_xattr_bucket(bucket, blkno); |
@@ -3972,8 +3975,7 @@ static int ocfs2_iterate_xattr_buckets(struct inode *inode, | |||
3972 | if (i == 0) | 3975 | if (i == 0) |
3973 | num_buckets = le16_to_cpu(bucket_xh(bucket)->xh_num_buckets); | 3976 | num_buckets = le16_to_cpu(bucket_xh(bucket)->xh_num_buckets); |
3974 | 3977 | ||
3975 | mlog(0, "iterating xattr bucket %llu, first hash %u\n", | 3978 | trace_ocfs2_iterate_xattr_bucket((unsigned long long)blkno, |
3976 | (unsigned long long)blkno, | ||
3977 | le32_to_cpu(bucket_xh(bucket)->xh_entries[0].xe_name_hash)); | 3979 | le32_to_cpu(bucket_xh(bucket)->xh_entries[0].xe_name_hash)); |
3978 | if (func) { | 3980 | if (func) { |
3979 | ret = func(inode, bucket, para); | 3981 | ret = func(inode, bucket, para); |
@@ -4173,9 +4175,9 @@ static void ocfs2_cp_xattr_block_to_bucket(struct inode *inode, | |||
4173 | char *src = xb_bh->b_data; | 4175 | char *src = xb_bh->b_data; |
4174 | char *target = bucket_block(bucket, blks - 1); | 4176 | char *target = bucket_block(bucket, blks - 1); |
4175 | 4177 | ||
4176 | mlog(0, "cp xattr from block %llu to bucket %llu\n", | 4178 | trace_ocfs2_cp_xattr_block_to_bucket_begin( |
4177 | (unsigned long long)xb_bh->b_blocknr, | 4179 | (unsigned long long)xb_bh->b_blocknr, |
4178 | (unsigned long long)bucket_blkno(bucket)); | 4180 | (unsigned long long)bucket_blkno(bucket)); |
4179 | 4181 | ||
4180 | for (i = 0; i < blks; i++) | 4182 | for (i = 0; i < blks; i++) |
4181 | memset(bucket_block(bucket, i), 0, blocksize); | 4183 | memset(bucket_block(bucket, i), 0, blocksize); |
@@ -4211,8 +4213,7 @@ static void ocfs2_cp_xattr_block_to_bucket(struct inode *inode, | |||
4211 | for (i = 0; i < count; i++) | 4213 | for (i = 0; i < count; i++) |
4212 | le16_add_cpu(&xh->xh_entries[i].xe_name_offset, off_change); | 4214 | le16_add_cpu(&xh->xh_entries[i].xe_name_offset, off_change); |
4213 | 4215 | ||
4214 | mlog(0, "copy entry: start = %u, size = %u, offset_change = %u\n", | 4216 | trace_ocfs2_cp_xattr_block_to_bucket_end(offset, size, off_change); |
4215 | offset, size, off_change); | ||
4216 | 4217 | ||
4217 | sort(target + offset, count, sizeof(struct ocfs2_xattr_entry), | 4218 | sort(target + offset, count, sizeof(struct ocfs2_xattr_entry), |
4218 | cmp_xe, swap_xe); | 4219 | cmp_xe, swap_xe); |
@@ -4261,8 +4262,8 @@ static int ocfs2_xattr_create_index_block(struct inode *inode, | |||
4261 | struct ocfs2_xattr_tree_root *xr; | 4262 | struct ocfs2_xattr_tree_root *xr; |
4262 | u16 xb_flags = le16_to_cpu(xb->xb_flags); | 4263 | u16 xb_flags = le16_to_cpu(xb->xb_flags); |
4263 | 4264 | ||
4264 | mlog(0, "create xattr index block for %llu\n", | 4265 | trace_ocfs2_xattr_create_index_block_begin( |
4265 | (unsigned long long)xb_bh->b_blocknr); | 4266 | (unsigned long long)xb_bh->b_blocknr); |
4266 | 4267 | ||
4267 | BUG_ON(xb_flags & OCFS2_XATTR_INDEXED); | 4268 | BUG_ON(xb_flags & OCFS2_XATTR_INDEXED); |
4268 | BUG_ON(!xs->bucket); | 4269 | BUG_ON(!xs->bucket); |
@@ -4295,8 +4296,7 @@ static int ocfs2_xattr_create_index_block(struct inode *inode, | |||
4295 | */ | 4296 | */ |
4296 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, bit_off); | 4297 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, bit_off); |
4297 | 4298 | ||
4298 | mlog(0, "allocate 1 cluster from %llu to xattr block\n", | 4299 | trace_ocfs2_xattr_create_index_block((unsigned long long)blkno); |
4299 | (unsigned long long)blkno); | ||
4300 | 4300 | ||
4301 | ret = ocfs2_init_xattr_bucket(xs->bucket, blkno); | 4301 | ret = ocfs2_init_xattr_bucket(xs->bucket, blkno); |
4302 | if (ret) { | 4302 | if (ret) { |
@@ -4400,8 +4400,7 @@ static int ocfs2_defrag_xattr_bucket(struct inode *inode, | |||
4400 | entries = (char *)xh->xh_entries; | 4400 | entries = (char *)xh->xh_entries; |
4401 | xh_free_start = le16_to_cpu(xh->xh_free_start); | 4401 | xh_free_start = le16_to_cpu(xh->xh_free_start); |
4402 | 4402 | ||
4403 | mlog(0, "adjust xattr bucket in %llu, count = %u, " | 4403 | trace_ocfs2_defrag_xattr_bucket( |
4404 | "xh_free_start = %u, xh_name_value_len = %u.\n", | ||
4405 | (unsigned long long)blkno, le16_to_cpu(xh->xh_count), | 4404 | (unsigned long long)blkno, le16_to_cpu(xh->xh_count), |
4406 | xh_free_start, le16_to_cpu(xh->xh_name_value_len)); | 4405 | xh_free_start, le16_to_cpu(xh->xh_name_value_len)); |
4407 | 4406 | ||
@@ -4503,8 +4502,9 @@ static int ocfs2_mv_xattr_bucket_cross_cluster(struct inode *inode, | |||
4503 | BUG_ON(le16_to_cpu(bucket_xh(first)->xh_num_buckets) < num_buckets); | 4502 | BUG_ON(le16_to_cpu(bucket_xh(first)->xh_num_buckets) < num_buckets); |
4504 | BUG_ON(OCFS2_XATTR_BUCKET_SIZE == OCFS2_SB(sb)->s_clustersize); | 4503 | BUG_ON(OCFS2_XATTR_BUCKET_SIZE == OCFS2_SB(sb)->s_clustersize); |
4505 | 4504 | ||
4506 | mlog(0, "move half of xattrs in cluster %llu to %llu\n", | 4505 | trace_ocfs2_mv_xattr_bucket_cross_cluster( |
4507 | (unsigned long long)last_cluster_blkno, (unsigned long long)new_blkno); | 4506 | (unsigned long long)last_cluster_blkno, |
4507 | (unsigned long long)new_blkno); | ||
4508 | 4508 | ||
4509 | ret = ocfs2_mv_xattr_buckets(inode, handle, bucket_blkno(first), | 4509 | ret = ocfs2_mv_xattr_buckets(inode, handle, bucket_blkno(first), |
4510 | last_cluster_blkno, new_blkno, | 4510 | last_cluster_blkno, new_blkno, |
@@ -4614,8 +4614,8 @@ static int ocfs2_divide_xattr_bucket(struct inode *inode, | |||
4614 | struct ocfs2_xattr_entry *xe; | 4614 | struct ocfs2_xattr_entry *xe; |
4615 | int blocksize = inode->i_sb->s_blocksize; | 4615 | int blocksize = inode->i_sb->s_blocksize; |
4616 | 4616 | ||
4617 | mlog(0, "move some of xattrs from bucket %llu to %llu\n", | 4617 | trace_ocfs2_divide_xattr_bucket_begin((unsigned long long)blk, |
4618 | (unsigned long long)blk, (unsigned long long)new_blk); | 4618 | (unsigned long long)new_blk); |
4619 | 4619 | ||
4620 | s_bucket = ocfs2_xattr_bucket_new(inode); | 4620 | s_bucket = ocfs2_xattr_bucket_new(inode); |
4621 | t_bucket = ocfs2_xattr_bucket_new(inode); | 4621 | t_bucket = ocfs2_xattr_bucket_new(inode); |
@@ -4714,9 +4714,9 @@ static int ocfs2_divide_xattr_bucket(struct inode *inode, | |||
4714 | */ | 4714 | */ |
4715 | xe = &xh->xh_entries[start]; | 4715 | xe = &xh->xh_entries[start]; |
4716 | len = sizeof(struct ocfs2_xattr_entry) * (count - start); | 4716 | len = sizeof(struct ocfs2_xattr_entry) * (count - start); |
4717 | mlog(0, "mv xattr entry len %d from %d to %d\n", len, | 4717 | trace_ocfs2_divide_xattr_bucket_move(len, |
4718 | (int)((char *)xe - (char *)xh), | 4718 | (int)((char *)xe - (char *)xh), |
4719 | (int)((char *)xh->xh_entries - (char *)xh)); | 4719 | (int)((char *)xh->xh_entries - (char *)xh)); |
4720 | memmove((char *)xh->xh_entries, (char *)xe, len); | 4720 | memmove((char *)xh->xh_entries, (char *)xe, len); |
4721 | xe = &xh->xh_entries[count - start]; | 4721 | xe = &xh->xh_entries[count - start]; |
4722 | len = sizeof(struct ocfs2_xattr_entry) * start; | 4722 | len = sizeof(struct ocfs2_xattr_entry) * start; |
@@ -4788,9 +4788,9 @@ static int ocfs2_cp_xattr_bucket(struct inode *inode, | |||
4788 | 4788 | ||
4789 | BUG_ON(s_blkno == t_blkno); | 4789 | BUG_ON(s_blkno == t_blkno); |
4790 | 4790 | ||
4791 | mlog(0, "cp bucket %llu to %llu, target is %d\n", | 4791 | trace_ocfs2_cp_xattr_bucket((unsigned long long)s_blkno, |
4792 | (unsigned long long)s_blkno, (unsigned long long)t_blkno, | 4792 | (unsigned long long)t_blkno, |
4793 | t_is_new); | 4793 | t_is_new); |
4794 | 4794 | ||
4795 | s_bucket = ocfs2_xattr_bucket_new(inode); | 4795 | s_bucket = ocfs2_xattr_bucket_new(inode); |
4796 | t_bucket = ocfs2_xattr_bucket_new(inode); | 4796 | t_bucket = ocfs2_xattr_bucket_new(inode); |
@@ -4862,8 +4862,8 @@ static int ocfs2_mv_xattr_buckets(struct inode *inode, handle_t *handle, | |||
4862 | int num_buckets = ocfs2_xattr_buckets_per_cluster(osb); | 4862 | int num_buckets = ocfs2_xattr_buckets_per_cluster(osb); |
4863 | struct ocfs2_xattr_bucket *old_first, *new_first; | 4863 | struct ocfs2_xattr_bucket *old_first, *new_first; |
4864 | 4864 | ||
4865 | mlog(0, "mv xattrs from cluster %llu to %llu\n", | 4865 | trace_ocfs2_mv_xattr_buckets((unsigned long long)last_blk, |
4866 | (unsigned long long)last_blk, (unsigned long long)to_blk); | 4866 | (unsigned long long)to_blk); |
4867 | 4867 | ||
4868 | BUG_ON(start_bucket >= num_buckets); | 4868 | BUG_ON(start_bucket >= num_buckets); |
4869 | if (start_bucket) { | 4869 | if (start_bucket) { |
@@ -5013,9 +5013,9 @@ static int ocfs2_adjust_xattr_cross_cluster(struct inode *inode, | |||
5013 | { | 5013 | { |
5014 | int ret; | 5014 | int ret; |
5015 | 5015 | ||
5016 | mlog(0, "adjust xattrs from cluster %llu len %u to %llu\n", | 5016 | trace_ocfs2_adjust_xattr_cross_cluster( |
5017 | (unsigned long long)bucket_blkno(first), prev_clusters, | 5017 | (unsigned long long)bucket_blkno(first), |
5018 | (unsigned long long)new_blk); | 5018 | (unsigned long long)new_blk, prev_clusters); |
5019 | 5019 | ||
5020 | if (ocfs2_xattr_buckets_per_cluster(OCFS2_SB(inode->i_sb)) > 1) { | 5020 | if (ocfs2_xattr_buckets_per_cluster(OCFS2_SB(inode->i_sb)) > 1) { |
5021 | ret = ocfs2_mv_xattr_bucket_cross_cluster(inode, | 5021 | ret = ocfs2_mv_xattr_bucket_cross_cluster(inode, |
@@ -5088,10 +5088,10 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
5088 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 5088 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
5089 | struct ocfs2_extent_tree et; | 5089 | struct ocfs2_extent_tree et; |
5090 | 5090 | ||
5091 | mlog(0, "Add new xattr cluster for %llu, previous xattr hash = %u, " | 5091 | trace_ocfs2_add_new_xattr_cluster_begin( |
5092 | "previous xattr blkno = %llu\n", | 5092 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
5093 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 5093 | (unsigned long long)bucket_blkno(first), |
5094 | prev_cpos, (unsigned long long)bucket_blkno(first)); | 5094 | prev_cpos, prev_clusters); |
5095 | 5095 | ||
5096 | ocfs2_init_xattr_tree_extent_tree(&et, INODE_CACHE(inode), root_bh); | 5096 | ocfs2_init_xattr_tree_extent_tree(&et, INODE_CACHE(inode), root_bh); |
5097 | 5097 | ||
@@ -5113,8 +5113,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
5113 | BUG_ON(num_bits > clusters_to_add); | 5113 | BUG_ON(num_bits > clusters_to_add); |
5114 | 5114 | ||
5115 | block = ocfs2_clusters_to_blocks(osb->sb, bit_off); | 5115 | block = ocfs2_clusters_to_blocks(osb->sb, bit_off); |
5116 | mlog(0, "Allocating %u clusters at block %u for xattr in inode %llu\n", | 5116 | trace_ocfs2_add_new_xattr_cluster((unsigned long long)block, num_bits); |
5117 | num_bits, bit_off, (unsigned long long)OCFS2_I(inode)->ip_blkno); | ||
5118 | 5117 | ||
5119 | if (bucket_blkno(first) + (prev_clusters * bpc) == block && | 5118 | if (bucket_blkno(first) + (prev_clusters * bpc) == block && |
5120 | (prev_clusters + num_bits) << osb->s_clustersize_bits <= | 5119 | (prev_clusters + num_bits) << osb->s_clustersize_bits <= |
@@ -5130,8 +5129,6 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
5130 | */ | 5129 | */ |
5131 | v_start = prev_cpos + prev_clusters; | 5130 | v_start = prev_cpos + prev_clusters; |
5132 | *num_clusters = prev_clusters + num_bits; | 5131 | *num_clusters = prev_clusters + num_bits; |
5133 | mlog(0, "Add contiguous %u clusters to previous extent rec.\n", | ||
5134 | num_bits); | ||
5135 | } else { | 5132 | } else { |
5136 | ret = ocfs2_adjust_xattr_cross_cluster(inode, | 5133 | ret = ocfs2_adjust_xattr_cross_cluster(inode, |
5137 | handle, | 5134 | handle, |
@@ -5147,8 +5144,8 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
5147 | } | 5144 | } |
5148 | } | 5145 | } |
5149 | 5146 | ||
5150 | mlog(0, "Insert %u clusters at block %llu for xattr at %u\n", | 5147 | trace_ocfs2_add_new_xattr_cluster_insert((unsigned long long)block, |
5151 | num_bits, (unsigned long long)block, v_start); | 5148 | v_start, num_bits); |
5152 | ret = ocfs2_insert_extent(handle, &et, v_start, block, | 5149 | ret = ocfs2_insert_extent(handle, &et, v_start, block, |
5153 | num_bits, 0, ctxt->meta_ac); | 5150 | num_bits, 0, ctxt->meta_ac); |
5154 | if (ret < 0) { | 5151 | if (ret < 0) { |
@@ -5183,9 +5180,9 @@ static int ocfs2_extend_xattr_bucket(struct inode *inode, | |||
5183 | u64 end_blk; | 5180 | u64 end_blk; |
5184 | u16 new_bucket = le16_to_cpu(bucket_xh(first)->xh_num_buckets); | 5181 | u16 new_bucket = le16_to_cpu(bucket_xh(first)->xh_num_buckets); |
5185 | 5182 | ||
5186 | mlog(0, "extend xattr bucket in %llu, xattr extend rec starting " | 5183 | trace_ocfs2_extend_xattr_bucket((unsigned long long)target_blk, |
5187 | "from %llu, len = %u\n", (unsigned long long)target_blk, | 5184 | (unsigned long long)bucket_blkno(first), |
5188 | (unsigned long long)bucket_blkno(first), num_clusters); | 5185 | num_clusters, new_bucket); |
5189 | 5186 | ||
5190 | /* The extent must have room for an additional bucket */ | 5187 | /* The extent must have room for an additional bucket */ |
5191 | BUG_ON(new_bucket >= | 5188 | BUG_ON(new_bucket >= |
@@ -5265,8 +5262,8 @@ static int ocfs2_add_new_xattr_bucket(struct inode *inode, | |||
5265 | /* The bucket at the front of the extent */ | 5262 | /* The bucket at the front of the extent */ |
5266 | struct ocfs2_xattr_bucket *first; | 5263 | struct ocfs2_xattr_bucket *first; |
5267 | 5264 | ||
5268 | mlog(0, "Add new xattr bucket starting from %llu\n", | 5265 | trace_ocfs2_add_new_xattr_bucket( |
5269 | (unsigned long long)bucket_blkno(target)); | 5266 | (unsigned long long)bucket_blkno(target)); |
5270 | 5267 | ||
5271 | /* The first bucket of the original extent */ | 5268 | /* The first bucket of the original extent */ |
5272 | first = ocfs2_xattr_bucket_new(inode); | 5269 | first = ocfs2_xattr_bucket_new(inode); |
@@ -5382,8 +5379,8 @@ static int ocfs2_xattr_bucket_value_truncate(struct inode *inode, | |||
5382 | * modified something. We have to assume they did, and dirty | 5379 | * modified something. We have to assume they did, and dirty |
5383 | * the whole bucket. This leaves us in a consistent state. | 5380 | * the whole bucket. This leaves us in a consistent state. |
5384 | */ | 5381 | */ |
5385 | mlog(0, "truncate %u in xattr bucket %llu to %d bytes.\n", | 5382 | trace_ocfs2_xattr_bucket_value_truncate( |
5386 | xe_off, (unsigned long long)bucket_blkno(bucket), len); | 5383 | (unsigned long long)bucket_blkno(bucket), xe_off, len); |
5387 | ret = ocfs2_xattr_value_truncate(inode, &vb, len, ctxt); | 5384 | ret = ocfs2_xattr_value_truncate(inode, &vb, len, ctxt); |
5388 | if (ret) { | 5385 | if (ret) { |
5389 | mlog_errno(ret); | 5386 | mlog_errno(ret); |
@@ -5433,8 +5430,9 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode, | |||
5433 | 5430 | ||
5434 | ocfs2_init_dealloc_ctxt(&dealloc); | 5431 | ocfs2_init_dealloc_ctxt(&dealloc); |
5435 | 5432 | ||
5436 | mlog(0, "rm xattr extent rec at %u len = %u, start from %llu\n", | 5433 | trace_ocfs2_rm_xattr_cluster( |
5437 | cpos, len, (unsigned long long)blkno); | 5434 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
5435 | (unsigned long long)blkno, cpos, len); | ||
5438 | 5436 | ||
5439 | ocfs2_remove_xattr_clusters_from_cache(INODE_CACHE(inode), blkno, | 5437 | ocfs2_remove_xattr_clusters_from_cache(INODE_CACHE(inode), blkno, |
5440 | len); | 5438 | len); |
@@ -5538,7 +5536,7 @@ static int ocfs2_xattr_set_entry_bucket(struct inode *inode, | |||
5538 | int ret; | 5536 | int ret; |
5539 | struct ocfs2_xa_loc loc; | 5537 | struct ocfs2_xa_loc loc; |
5540 | 5538 | ||
5541 | mlog_entry("Set xattr %s in xattr bucket\n", xi->xi_name); | 5539 | trace_ocfs2_xattr_set_entry_bucket(xi->xi_name); |
5542 | 5540 | ||
5543 | ocfs2_init_xattr_bucket_xa_loc(&loc, xs->bucket, | 5541 | ocfs2_init_xattr_bucket_xa_loc(&loc, xs->bucket, |
5544 | xs->not_found ? NULL : xs->here); | 5542 | xs->not_found ? NULL : xs->here); |
@@ -5570,7 +5568,6 @@ static int ocfs2_xattr_set_entry_bucket(struct inode *inode, | |||
5570 | 5568 | ||
5571 | 5569 | ||
5572 | out: | 5570 | out: |
5573 | mlog_exit(ret); | ||
5574 | return ret; | 5571 | return ret; |
5575 | } | 5572 | } |
5576 | 5573 | ||
@@ -5581,7 +5578,7 @@ static int ocfs2_xattr_set_entry_index_block(struct inode *inode, | |||
5581 | { | 5578 | { |
5582 | int ret; | 5579 | int ret; |
5583 | 5580 | ||
5584 | mlog_entry("Set xattr %s in xattr index block\n", xi->xi_name); | 5581 | trace_ocfs2_xattr_set_entry_index_block(xi->xi_name); |
5585 | 5582 | ||
5586 | ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); | 5583 | ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); |
5587 | if (!ret) | 5584 | if (!ret) |
@@ -5637,7 +5634,6 @@ static int ocfs2_xattr_set_entry_index_block(struct inode *inode, | |||
5637 | mlog_errno(ret); | 5634 | mlog_errno(ret); |
5638 | 5635 | ||
5639 | out: | 5636 | out: |
5640 | mlog_exit(ret); | ||
5641 | return ret; | 5637 | return ret; |
5642 | } | 5638 | } |
5643 | 5639 | ||
@@ -6041,9 +6037,9 @@ static int ocfs2_xattr_bucket_value_refcount(struct inode *inode, | |||
6041 | if (ocfs2_meta_ecc(OCFS2_SB(inode->i_sb))) | 6037 | if (ocfs2_meta_ecc(OCFS2_SB(inode->i_sb))) |
6042 | p = &refcount; | 6038 | p = &refcount; |
6043 | 6039 | ||
6044 | mlog(0, "refcount bucket %llu, count = %u\n", | 6040 | trace_ocfs2_xattr_bucket_value_refcount( |
6045 | (unsigned long long)bucket_blkno(bucket), | 6041 | (unsigned long long)bucket_blkno(bucket), |
6046 | le16_to_cpu(xh->xh_count)); | 6042 | le16_to_cpu(xh->xh_count)); |
6047 | for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { | 6043 | for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { |
6048 | xe = &xh->xh_entries[i]; | 6044 | xe = &xh->xh_entries[i]; |
6049 | 6045 | ||
@@ -6339,8 +6335,8 @@ static int ocfs2_reflink_xattr_header(handle_t *handle, | |||
6339 | u32 clusters, cpos, p_cluster, num_clusters; | 6335 | u32 clusters, cpos, p_cluster, num_clusters; |
6340 | unsigned int ext_flags = 0; | 6336 | unsigned int ext_flags = 0; |
6341 | 6337 | ||
6342 | mlog(0, "reflink xattr in container %llu, count = %u\n", | 6338 | trace_ocfs2_reflink_xattr_header((unsigned long long)old_bh->b_blocknr, |
6343 | (unsigned long long)old_bh->b_blocknr, le16_to_cpu(xh->xh_count)); | 6339 | le16_to_cpu(xh->xh_count)); |
6344 | 6340 | ||
6345 | last = &new_xh->xh_entries[le16_to_cpu(new_xh->xh_count)]; | 6341 | last = &new_xh->xh_entries[le16_to_cpu(new_xh->xh_count)]; |
6346 | for (i = 0, j = 0; i < le16_to_cpu(xh->xh_count); i++, j++) { | 6342 | for (i = 0, j = 0; i < le16_to_cpu(xh->xh_count); i++, j++) { |
@@ -6540,8 +6536,8 @@ static int ocfs2_create_empty_xattr_block(struct inode *inode, | |||
6540 | goto out; | 6536 | goto out; |
6541 | } | 6537 | } |
6542 | 6538 | ||
6543 | mlog(0, "create new xattr block for inode %llu, index = %d\n", | 6539 | trace_ocfs2_create_empty_xattr_block( |
6544 | (unsigned long long)fe_bh->b_blocknr, indexed); | 6540 | (unsigned long long)fe_bh->b_blocknr, indexed); |
6545 | ret = ocfs2_create_xattr_block(inode, fe_bh, &ctxt, indexed, | 6541 | ret = ocfs2_create_xattr_block(inode, fe_bh, &ctxt, indexed, |
6546 | ret_bh); | 6542 | ret_bh); |
6547 | if (ret) | 6543 | if (ret) |
@@ -6952,8 +6948,8 @@ static int ocfs2_reflink_xattr_buckets(handle_t *handle, | |||
6952 | if (ret) | 6948 | if (ret) |
6953 | mlog_errno(ret); | 6949 | mlog_errno(ret); |
6954 | 6950 | ||
6955 | mlog(0, "insert new xattr extent rec start %llu len %u to %u\n", | 6951 | trace_ocfs2_reflink_xattr_buckets((unsigned long long)new_blkno, |
6956 | (unsigned long long)new_blkno, num_clusters, reflink_cpos); | 6952 | num_clusters, reflink_cpos); |
6957 | 6953 | ||
6958 | len -= num_clusters; | 6954 | len -= num_clusters; |
6959 | blkno += ocfs2_clusters_to_blocks(inode->i_sb, num_clusters); | 6955 | blkno += ocfs2_clusters_to_blocks(inode->i_sb, num_clusters); |
@@ -6982,8 +6978,7 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode, | |||
6982 | struct ocfs2_alloc_context *data_ac = NULL; | 6978 | struct ocfs2_alloc_context *data_ac = NULL; |
6983 | struct ocfs2_extent_tree et; | 6979 | struct ocfs2_extent_tree et; |
6984 | 6980 | ||
6985 | mlog(0, "reflink xattr buckets %llu len %u\n", | 6981 | trace_ocfs2_reflink_xattr_rec((unsigned long long)blkno, len); |
6986 | (unsigned long long)blkno, len); | ||
6987 | 6982 | ||
6988 | ocfs2_init_xattr_tree_extent_tree(&et, | 6983 | ocfs2_init_xattr_tree_extent_tree(&et, |
6989 | INODE_CACHE(args->reflink->new_inode), | 6984 | INODE_CACHE(args->reflink->new_inode), |