Commit 2f73e135 authored by Tao Ma's avatar Tao Ma

ocfs2: Remove mlog(0) from fs/ocfs2/suballoc.c

This is the 3rd step to remove the debug info of DISK_ALLOC.
Signed-off-by: default avatarTao Ma <boyu.mt@taobao.com>
parent a04733d8
...@@ -40,6 +40,23 @@ DEFINE_EVENT(ocfs2__uint, name, \ ...@@ -40,6 +40,23 @@ DEFINE_EVENT(ocfs2__uint, name, \
TP_PROTO(unsigned int num), \ TP_PROTO(unsigned int num), \
TP_ARGS(num)) TP_ARGS(num))
DECLARE_EVENT_CLASS(ocfs2__ull,
TP_PROTO(unsigned long long blkno),
TP_ARGS(blkno),
TP_STRUCT__entry(
__field(unsigned long long, blkno)
),
TP_fast_assign(
__entry->blkno = blkno;
),
TP_printk("%llu", __entry->blkno)
);
#define DEFINE_OCFS2_ULL_EVENT(name) \
DEFINE_EVENT(ocfs2__ull, name, \
TP_PROTO(unsigned long long num), \
TP_ARGS(num))
DECLARE_EVENT_CLASS(ocfs2__int_int, DECLARE_EVENT_CLASS(ocfs2__int_int,
TP_PROTO(int value1, int value2), TP_PROTO(int value1, int value2),
TP_ARGS(value1, value2), TP_ARGS(value1, value2),
...@@ -59,6 +76,25 @@ DEFINE_EVENT(ocfs2__int_int, name, \ ...@@ -59,6 +76,25 @@ DEFINE_EVENT(ocfs2__int_int, name, \
TP_PROTO(int val1, int val2), \ TP_PROTO(int val1, int val2), \
TP_ARGS(val1, val2)) TP_ARGS(val1, val2))
DECLARE_EVENT_CLASS(ocfs2__uint_uint,
TP_PROTO(unsigned int value1, unsigned int value2),
TP_ARGS(value1, value2),
TP_STRUCT__entry(
__field(unsigned int, value1)
__field(unsigned int, value2)
),
TP_fast_assign(
__entry->value1 = value1;
__entry->value2 = value2;
),
TP_printk("%u %u", __entry->value1, __entry->value2)
);
#define DEFINE_OCFS2_UINT_UINT_EVENT(name) \
DEFINE_EVENT(ocfs2__uint_uint, name, \
TP_PROTO(unsigned int val1, unsigned int val2), \
TP_ARGS(val1, val2))
DECLARE_EVENT_CLASS(ocfs2__ull_uint, DECLARE_EVENT_CLASS(ocfs2__ull_uint,
TP_PROTO(unsigned long long value1, unsigned int value2), TP_PROTO(unsigned long long value1, unsigned int value2),
TP_ARGS(value1, value2), TP_ARGS(value1, value2),
...@@ -78,6 +114,49 @@ DEFINE_EVENT(ocfs2__ull_uint, name, \ ...@@ -78,6 +114,49 @@ DEFINE_EVENT(ocfs2__ull_uint, name, \
TP_PROTO(unsigned long long val1, unsigned int val2), \ TP_PROTO(unsigned long long val1, unsigned int val2), \
TP_ARGS(val1, val2)) TP_ARGS(val1, val2))
DECLARE_EVENT_CLASS(ocfs2__ull_ull,
TP_PROTO(unsigned long long value1, unsigned long long value2),
TP_ARGS(value1, value2),
TP_STRUCT__entry(
__field(unsigned long long, value1)
__field(unsigned long long, value2)
),
TP_fast_assign(
__entry->value1 = value1;
__entry->value2 = value2;
),
TP_printk("%llu %llu", __entry->value1, __entry->value2)
);
#define DEFINE_OCFS2_ULL_ULL_EVENT(name) \
DEFINE_EVENT(ocfs2__ull_ull, name, \
TP_PROTO(unsigned long long val1, unsigned long long val2), \
TP_ARGS(val1, val2))
DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint,
TP_PROTO(unsigned long long value1,
unsigned int value2, unsigned int value3),
TP_ARGS(value1, value2, value3),
TP_STRUCT__entry(
__field(unsigned long long, value1)
__field(unsigned int, value2)
__field(unsigned int, value3)
),
TP_fast_assign(
__entry->value1 = value1;
__entry->value2 = value2;
__entry->value3 = value3;
),
TP_printk("%llu %u %u", __entry->value1,
__entry->value2, __entry->value3)
);
#define DEFINE_OCFS2_ULL_UINT_UINT_EVENT(name) \
DEFINE_EVENT(ocfs2__ull_uint_uint, name, \
TP_PROTO(unsigned long long val1, \
unsigned int val2, unsigned int val3), \
TP_ARGS(val1, val2, val3))
DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint, DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint,
TP_PROTO(unsigned int value1, unsigned int value2, TP_PROTO(unsigned int value1, unsigned int value2,
unsigned int value3), unsigned int value3),
...@@ -127,6 +206,33 @@ DEFINE_EVENT(ocfs2__ull_int_int_int, name, \ ...@@ -127,6 +206,33 @@ DEFINE_EVENT(ocfs2__ull_int_int_int, name, \
int value2, int value3), \ int value2, int value3), \
TP_ARGS(ull, value1, value2, value3)) TP_ARGS(ull, value1, value2, value3))
DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint_uint,
TP_PROTO(unsigned long long ull, unsigned int value1,
unsigned int value2, unsigned int value3),
TP_ARGS(ull, value1, value2, value3),
TP_STRUCT__entry(
__field(unsigned long long, ull)
__field(unsigned int, value1)
__field(unsigned int, value2)
__field(unsigned int, value3)
),
TP_fast_assign(
__entry->ull = ull;
__entry->value1 = value1;
__entry->value2 = value2;
__entry->value3 = value3;
),
TP_printk("%llu %u %u %u",
__entry->ull, __entry->value1,
__entry->value2, __entry->value3)
);
#define DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(name) \
DEFINE_EVENT(ocfs2__ull_uint_uint_uint, name, \
TP_PROTO(unsigned long long ull, unsigned int value1, \
unsigned int value2, unsigned int value3), \
TP_ARGS(ull, value1, value2, value3))
/* Trace events for fs/ocfs2/alloc.c. */ /* Trace events for fs/ocfs2/alloc.c. */
DECLARE_EVENT_CLASS(ocfs2__btree_ops, DECLARE_EVENT_CLASS(ocfs2__btree_ops,
TP_PROTO(unsigned long long owner,\ TP_PROTO(unsigned long long owner,\
...@@ -483,6 +589,112 @@ DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_new_window); ...@@ -483,6 +589,112 @@ DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_new_window);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result); DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result);
/* End of trace events for fs/ocfs2/localalloc.c. */ /* End of trace events for fs/ocfs2/localalloc.c. */
/* Trace events for fs/ocfs2/suballoc.c. */
DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_group_descriptor);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_block_group_alloc_contig);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_block_group_alloc_discontig);
DEFINE_OCFS2_ULL_EVENT(ocfs2_block_group_alloc);
DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_reserve_suballoc_bits_nospc);
DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_reserve_suballoc_bits_no_new_group);
DEFINE_OCFS2_ULL_EVENT(ocfs2_reserve_new_inode_new_group);
DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_block_group_set_bits);
TRACE_EVENT(ocfs2_relink_block_group,
TP_PROTO(unsigned long long i_blkno, unsigned int chain,
unsigned long long bg_blkno,
unsigned long long prev_blkno),
TP_ARGS(i_blkno, chain, bg_blkno, prev_blkno),
TP_STRUCT__entry(
__field(unsigned long long, i_blkno)
__field(unsigned int, chain)
__field(unsigned long long, bg_blkno)
__field(unsigned long long, prev_blkno)
),
TP_fast_assign(
__entry->i_blkno = i_blkno;
__entry->chain = chain;
__entry->bg_blkno = bg_blkno;
__entry->prev_blkno = prev_blkno;
),
TP_printk("%llu %u %llu %llu",
__entry->i_blkno, __entry->chain, __entry->bg_blkno,
__entry->prev_blkno)
);
DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_cluster_group_search_wrong_max_bits);
DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_cluster_group_search_max_block);
DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_block_group_search_max_block);
DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_search_chain_begin);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_search_chain_succ);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_search_chain_end);
DEFINE_OCFS2_UINT_EVENT(ocfs2_claim_suballoc_bits);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_claim_new_inode_at_loc);
DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_block_group_clear_bits);
TRACE_EVENT(ocfs2_free_suballoc_bits,
TP_PROTO(unsigned long long inode, unsigned long long group,
unsigned int start_bit, unsigned int count),
TP_ARGS(inode, group, start_bit, count),
TP_STRUCT__entry(
__field(unsigned long long, inode)
__field(unsigned long long, group)
__field(unsigned int, start_bit)
__field(unsigned int, count)
),
TP_fast_assign(
__entry->inode = inode;
__entry->group = group;
__entry->start_bit = start_bit;
__entry->count = count;
),
TP_printk("%llu %llu %u %u", __entry->inode, __entry->group,
__entry->start_bit, __entry->count)
);
TRACE_EVENT(ocfs2_free_clusters,
TP_PROTO(unsigned long long bg_blkno, unsigned long long start_blk,
unsigned int start_bit, unsigned int count),
TP_ARGS(bg_blkno, start_blk, start_bit, count),
TP_STRUCT__entry(
__field(unsigned long long, bg_blkno)
__field(unsigned long long, start_blk)
__field(unsigned int, start_bit)
__field(unsigned int, count)
),
TP_fast_assign(
__entry->bg_blkno = bg_blkno;
__entry->start_blk = start_blk;
__entry->start_bit = start_bit;
__entry->count = count;
),
TP_printk("%llu %llu %u %u", __entry->bg_blkno, __entry->start_blk,
__entry->start_bit, __entry->count)
);
DEFINE_OCFS2_ULL_EVENT(ocfs2_get_suballoc_slot_bit);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_test_suballoc_bit);
DEFINE_OCFS2_ULL_EVENT(ocfs2_test_inode_bit);
/* End of trace events for fs/ocfs2/suballoc.c. */
#endif /* _TRACE_OCFS2_H */ #endif /* _TRACE_OCFS2_H */
/* This part must be outside protection */ /* This part must be outside protection */
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "super.h" #include "super.h"
#include "sysfile.h" #include "sysfile.h"
#include "uptodate.h" #include "uptodate.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
...@@ -308,7 +309,7 @@ static int ocfs2_validate_group_descriptor(struct super_block *sb, ...@@ -308,7 +309,7 @@ static int ocfs2_validate_group_descriptor(struct super_block *sb,
int rc; int rc;
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data; struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
mlog(0, "Validating group descriptor %llu\n", trace_ocfs2_validate_group_descriptor(
(unsigned long long)bh->b_blocknr); (unsigned long long)bh->b_blocknr);
BUG_ON(!buffer_uptodate(bh)); BUG_ON(!buffer_uptodate(bh));
...@@ -476,8 +477,8 @@ ocfs2_block_group_alloc_contig(struct ocfs2_super *osb, handle_t *handle, ...@@ -476,8 +477,8 @@ ocfs2_block_group_alloc_contig(struct ocfs2_super *osb, handle_t *handle,
/* setup the group */ /* setup the group */
bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off); bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off);
mlog(0, "new descriptor, record %u, at block %llu\n", trace_ocfs2_block_group_alloc_contig(
alloc_rec, (unsigned long long)bg_blkno); (unsigned long long)bg_blkno, alloc_rec);
bg_bh = sb_getblk(osb->sb, bg_blkno); bg_bh = sb_getblk(osb->sb, bg_blkno);
if (!bg_bh) { if (!bg_bh) {
...@@ -656,8 +657,8 @@ ocfs2_block_group_alloc_discontig(handle_t *handle, ...@@ -656,8 +657,8 @@ ocfs2_block_group_alloc_discontig(handle_t *handle,
/* setup the group */ /* setup the group */
bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off); bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off);
mlog(0, "new descriptor, record %u, at block %llu\n", trace_ocfs2_block_group_alloc_discontig(
alloc_rec, (unsigned long long)bg_blkno); (unsigned long long)bg_blkno, alloc_rec);
bg_bh = sb_getblk(osb->sb, bg_blkno); bg_bh = sb_getblk(osb->sb, bg_blkno);
if (!bg_bh) { if (!bg_bh) {
...@@ -727,7 +728,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb, ...@@ -727,7 +728,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb,
} }
if (last_alloc_group && *last_alloc_group != 0) { if (last_alloc_group && *last_alloc_group != 0) {
mlog(0, "use old allocation group %llu for block group alloc\n", trace_ocfs2_block_group_alloc(
(unsigned long long)*last_alloc_group); (unsigned long long)*last_alloc_group);
ac->ac_last_group = *last_alloc_group; ac->ac_last_group = *last_alloc_group;
} }
...@@ -851,15 +852,14 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb, ...@@ -851,15 +852,14 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb,
if (bits_wanted > free_bits) { if (bits_wanted > free_bits) {
/* cluster bitmap never grows */ /* cluster bitmap never grows */
if (ocfs2_is_cluster_bitmap(alloc_inode)) { if (ocfs2_is_cluster_bitmap(alloc_inode)) {
mlog(0, "Disk Full: wanted=%u, free_bits=%u\n", trace_ocfs2_reserve_suballoc_bits_nospc(bits_wanted,
bits_wanted, free_bits); free_bits);
status = -ENOSPC; status = -ENOSPC;
goto bail; goto bail;
} }
if (!(flags & ALLOC_NEW_GROUP)) { if (!(flags & ALLOC_NEW_GROUP)) {
mlog(0, "Alloc File %u Full: wanted=%u, free_bits=%u, " trace_ocfs2_reserve_suballoc_bits_no_new_group(
"and we don't alloc a new group for it.\n",
slot, bits_wanted, free_bits); slot, bits_wanted, free_bits);
status = -ENOSPC; status = -ENOSPC;
goto bail; goto bail;
...@@ -1117,8 +1117,8 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb, ...@@ -1117,8 +1117,8 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb,
spin_lock(&osb->osb_lock); spin_lock(&osb->osb_lock);
osb->osb_inode_alloc_group = alloc_group; osb->osb_inode_alloc_group = alloc_group;
spin_unlock(&osb->osb_lock); spin_unlock(&osb->osb_lock);
mlog(0, "after reservation, new allocation group is " trace_ocfs2_reserve_new_inode_new_group(
"%llu\n", (unsigned long long)alloc_group); (unsigned long long)alloc_group);
/* /*
* Some inodes must be freed by us, so try to allocate * Some inodes must be freed by us, so try to allocate
...@@ -1360,8 +1360,7 @@ static inline int ocfs2_block_group_set_bits(handle_t *handle, ...@@ -1360,8 +1360,7 @@ static inline int ocfs2_block_group_set_bits(handle_t *handle,
BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg)); BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
BUG_ON(le16_to_cpu(bg->bg_free_bits_count) < num_bits); BUG_ON(le16_to_cpu(bg->bg_free_bits_count) < num_bits);
mlog(0, "block_group_set_bits: off = %u, num = %u\n", bit_off, trace_ocfs2_block_group_set_bits(bit_off, num_bits);
num_bits);
if (ocfs2_is_cluster_bitmap(alloc_inode)) if (ocfs2_is_cluster_bitmap(alloc_inode))
journal_type = OCFS2_JOURNAL_ACCESS_UNDO; journal_type = OCFS2_JOURNAL_ACCESS_UNDO;
...@@ -1434,7 +1433,7 @@ static int ocfs2_relink_block_group(handle_t *handle, ...@@ -1434,7 +1433,7 @@ static int ocfs2_relink_block_group(handle_t *handle,
BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg)); BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(prev_bg)); BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(prev_bg));
mlog(0, "Suballoc %llu, chain %u, move group %llu to top, prev = %llu\n", trace_ocfs2_relink_block_group(
(unsigned long long)le64_to_cpu(fe->i_blkno), chain, (unsigned long long)le64_to_cpu(fe->i_blkno), chain,
(unsigned long long)le64_to_cpu(bg->bg_blkno), (unsigned long long)le64_to_cpu(bg->bg_blkno),
(unsigned long long)le64_to_cpu(prev_bg->bg_blkno)); (unsigned long long)le64_to_cpu(prev_bg->bg_blkno));
...@@ -1523,7 +1522,7 @@ static int ocfs2_cluster_group_search(struct inode *inode, ...@@ -1523,7 +1522,7 @@ static int ocfs2_cluster_group_search(struct inode *inode,
if ((gd_cluster_off + max_bits) > if ((gd_cluster_off + max_bits) >
OCFS2_I(inode)->ip_clusters) { OCFS2_I(inode)->ip_clusters) {
max_bits = OCFS2_I(inode)->ip_clusters - gd_cluster_off; max_bits = OCFS2_I(inode)->ip_clusters - gd_cluster_off;
mlog(0, "Desc %llu, bg_bits %u, clusters %u, use %u\n", trace_ocfs2_cluster_group_search_wrong_max_bits(
(unsigned long long)le64_to_cpu(gd->bg_blkno), (unsigned long long)le64_to_cpu(gd->bg_blkno),
le16_to_cpu(gd->bg_bits), le16_to_cpu(gd->bg_bits),
OCFS2_I(inode)->ip_clusters, max_bits); OCFS2_I(inode)->ip_clusters, max_bits);
...@@ -1540,7 +1539,7 @@ static int ocfs2_cluster_group_search(struct inode *inode, ...@@ -1540,7 +1539,7 @@ static int ocfs2_cluster_group_search(struct inode *inode,
gd_cluster_off + gd_cluster_off +
res->sr_bit_offset + res->sr_bit_offset +
res->sr_bits); res->sr_bits);
mlog(0, "Checking %llu against %llu\n", trace_ocfs2_cluster_group_search_max_block(
(unsigned long long)blkoff, (unsigned long long)blkoff,
(unsigned long long)max_block); (unsigned long long)max_block);
if (blkoff > max_block) if (blkoff > max_block)
...@@ -1586,7 +1585,7 @@ static int ocfs2_block_group_search(struct inode *inode, ...@@ -1586,7 +1585,7 @@ static int ocfs2_block_group_search(struct inode *inode,
if (!ret && max_block) { if (!ret && max_block) {
blkoff = le64_to_cpu(bg->bg_blkno) + blkoff = le64_to_cpu(bg->bg_blkno) +
res->sr_bit_offset + res->sr_bits; res->sr_bit_offset + res->sr_bits;
mlog(0, "Checking %llu against %llu\n", trace_ocfs2_block_group_search_max_block(
(unsigned long long)blkoff, (unsigned long long)blkoff,
(unsigned long long)max_block); (unsigned long long)max_block);
if (blkoff > max_block) if (blkoff > max_block)
...@@ -1754,9 +1753,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, ...@@ -1754,9 +1753,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
struct ocfs2_group_desc *bg; struct ocfs2_group_desc *bg;
chain = ac->ac_chain; chain = ac->ac_chain;
mlog(0, "trying to alloc %u bits from chain %u, inode %llu\n", trace_ocfs2_search_chain_begin(
bits_wanted, chain, (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno,
(unsigned long long)OCFS2_I(alloc_inode)->ip_blkno); bits_wanted, chain);
status = ocfs2_read_group_descriptor(alloc_inode, fe, status = ocfs2_read_group_descriptor(alloc_inode, fe,
le64_to_cpu(cl->cl_recs[chain].c_blkno), le64_to_cpu(cl->cl_recs[chain].c_blkno),
...@@ -1797,8 +1796,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, ...@@ -1797,8 +1796,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
goto bail; goto bail;
} }
mlog(0, "alloc succeeds: we give %u bits from block group %llu\n", trace_ocfs2_search_chain_succ(
res->sr_bits, (unsigned long long)le64_to_cpu(bg->bg_blkno)); (unsigned long long)le64_to_cpu(bg->bg_blkno), res->sr_bits);
res->sr_bg_blkno = le64_to_cpu(bg->bg_blkno); res->sr_bg_blkno = le64_to_cpu(bg->bg_blkno);
...@@ -1859,8 +1858,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, ...@@ -1859,8 +1858,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
goto bail; goto bail;
} }
mlog(0, "Allocated %u bits from suballocator %llu\n", res->sr_bits, trace_ocfs2_search_chain_end(
(unsigned long long)le64_to_cpu(fe->i_blkno)); (unsigned long long)le64_to_cpu(fe->i_blkno),
res->sr_bits);
out_loc_only: out_loc_only:
*bits_left = le16_to_cpu(bg->bg_free_bits_count); *bits_left = le16_to_cpu(bg->bg_free_bits_count);
...@@ -1942,8 +1942,7 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac, ...@@ -1942,8 +1942,7 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
goto bail; goto bail;
} }
mlog(0, "Search of victim chain %u came up with nothing, " trace_ocfs2_claim_suballoc_bits(victim);
"trying all chains now.\n", victim);
/* If we didn't pick a good victim, then just default to /* If we didn't pick a good victim, then just default to
* searching each chain in order. Don't allow chain relinking * searching each chain in order. Don't allow chain relinking
...@@ -2171,8 +2170,8 @@ int ocfs2_claim_new_inode_at_loc(handle_t *handle, ...@@ -2171,8 +2170,8 @@ int ocfs2_claim_new_inode_at_loc(handle_t *handle,
goto out; goto out;
} }
mlog(0, "Allocated %u bits from suballocator %llu\n", res->sr_bits, trace_ocfs2_claim_new_inode_at_loc((unsigned long long)di_blkno,
(unsigned long long)di_blkno); res->sr_bits);
atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs); atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs);
...@@ -2393,7 +2392,7 @@ static int ocfs2_block_group_clear_bits(handle_t *handle, ...@@ -2393,7 +2392,7 @@ static int ocfs2_block_group_clear_bits(handle_t *handle,
* ocfs2_read_group_descriptor(). Any corruption is a code bug. */ * ocfs2_read_group_descriptor(). Any corruption is a code bug. */
BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg)); BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
mlog(0, "off = %u, num = %u\n", bit_off, num_bits); trace_ocfs2_block_group_clear_bits(bit_off, num_bits);
BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode)); BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode));
status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode),
...@@ -2466,9 +2465,10 @@ static int _ocfs2_free_suballoc_bits(handle_t *handle, ...@@ -2466,9 +2465,10 @@ static int _ocfs2_free_suballoc_bits(handle_t *handle,
BUG_ON(!OCFS2_IS_VALID_DINODE(fe)); BUG_ON(!OCFS2_IS_VALID_DINODE(fe));
BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl));
mlog(0, "%llu: freeing %u bits from group %llu, starting at %u\n", trace_ocfs2_free_suballoc_bits(
(unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count, (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno,
(unsigned long long)bg_blkno, start_bit); (unsigned long long)bg_blkno,
start_bit, count);
status = ocfs2_read_group_descriptor(alloc_inode, fe, bg_blkno, status = ocfs2_read_group_descriptor(alloc_inode, fe, bg_blkno,
&group_bh); &group_bh);
...@@ -2560,10 +2560,9 @@ static int _ocfs2_free_clusters(handle_t *handle, ...@@ -2560,10 +2560,9 @@ static int _ocfs2_free_clusters(handle_t *handle,
ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno, ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno,
&bg_start_bit); &bg_start_bit);
mlog(0, "want to free %u clusters starting at block %llu\n", trace_ocfs2_free_clusters((unsigned long long)bg_blkno,
num_clusters, (unsigned long long)start_blk); (unsigned long long)start_blk,
mlog(0, "bg_blkno = %llu, bg_start_bit = %u\n", bg_start_bit, num_clusters);
(unsigned long long)bg_blkno, bg_start_bit);
status = _ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh, status = _ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh,
bg_start_bit, bg_blkno, bg_start_bit, bg_blkno,
...@@ -2748,7 +2747,7 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno, ...@@ -2748,7 +2747,7 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno,
struct buffer_head *inode_bh = NULL; struct buffer_head *inode_bh = NULL;
struct ocfs2_dinode *inode_fe; struct ocfs2_dinode *inode_fe;
mlog(0, "blkno: %llu\n", (unsigned long long)blkno); trace_ocfs2_get_suballoc_slot_bit((unsigned long long)blkno);
/* dirty read disk */ /* dirty read disk */
status = ocfs2_read_blocks_sync(osb, blkno, 1, &inode_bh); status = ocfs2_read_blocks_sync(osb, blkno, 1, &inode_bh);
...@@ -2809,7 +2808,7 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb, ...@@ -2809,7 +2808,7 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
u64 bg_blkno; u64 bg_blkno;
int status; int status;
mlog(0, "blkno: %llu bit: %u\n", (unsigned long long)blkno, trace_ocfs2_test_suballoc_bit((unsigned long long)blkno,
(unsigned int)bit); (unsigned int)bit);
alloc_di = (struct ocfs2_dinode *)alloc_bh->b_data; alloc_di = (struct ocfs2_dinode *)alloc_bh->b_data;
...@@ -2863,7 +2862,7 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res) ...@@ -2863,7 +2862,7 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
struct inode *inode_alloc_inode; struct inode *inode_alloc_inode;
struct buffer_head *alloc_bh = NULL; struct buffer_head *alloc_bh = NULL;
mlog(0, "blkno: %llu", (unsigned long long)blkno); trace_ocfs2_test_inode_bit((unsigned long long)blkno);
status = ocfs2_get_suballoc_slot_bit(osb, blkno, &suballoc_slot, status = ocfs2_get_suballoc_slot_bit(osb, blkno, &suballoc_slot,
&group_blkno, &suballoc_bit); &group_blkno, &suballoc_bit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment