提交 03e4970c 编写于 作者: L Linus Torvalds

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
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h> #include <linux/string.h>
#define MLOG_MASK_PREFIX ML_INODE
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
......
此差异已折叠。
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/mpage.h> #include <linux/mpage.h>
#include <linux/quotaops.h> #include <linux/quotaops.h>
#define MLOG_MASK_PREFIX ML_FILE_IO
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -45,6 +44,7 @@ ...@@ -45,6 +44,7 @@
#include "super.h" #include "super.h"
#include "symlink.h" #include "symlink.h"
#include "refcounttree.h" #include "refcounttree.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
...@@ -59,8 +59,9 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock, ...@@ -59,8 +59,9 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
void *kaddr; void *kaddr;
mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode, trace_ocfs2_symlink_get_block(
(unsigned long long)iblock, bh_result, create); (unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)iblock, bh_result, create);
BUG_ON(ocfs2_inode_is_fast_symlink(inode)); BUG_ON(ocfs2_inode_is_fast_symlink(inode));
...@@ -123,7 +124,6 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock, ...@@ -123,7 +124,6 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
bail: bail:
brelse(bh); brelse(bh);
mlog_exit(err);
return err; return err;
} }
...@@ -136,8 +136,8 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock, ...@@ -136,8 +136,8 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock,
u64 p_blkno, count, past_eof; u64 p_blkno, count, past_eof;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode, trace_ocfs2_get_block((unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)iblock, bh_result, create); (unsigned long long)iblock, bh_result, create);
if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE) if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE)
mlog(ML_NOTICE, "get_block on system inode 0x%p (%lu)\n", mlog(ML_NOTICE, "get_block on system inode 0x%p (%lu)\n",
...@@ -199,8 +199,9 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock, ...@@ -199,8 +199,9 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock,
} }
past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode)); past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode));
mlog(0, "Inode %lu, past_eof = %llu\n", inode->i_ino,
(unsigned long long)past_eof); trace_ocfs2_get_block_end((unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)past_eof);
if (create && (iblock >= past_eof)) if (create && (iblock >= past_eof))
set_buffer_new(bh_result); set_buffer_new(bh_result);
...@@ -208,7 +209,6 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock, ...@@ -208,7 +209,6 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock,
if (err < 0) if (err < 0)
err = -EIO; err = -EIO;
mlog_exit(err);
return err; return err;
} }
...@@ -278,7 +278,8 @@ static int ocfs2_readpage(struct file *file, struct page *page) ...@@ -278,7 +278,8 @@ static int ocfs2_readpage(struct file *file, struct page *page)
loff_t start = (loff_t)page->index << PAGE_CACHE_SHIFT; loff_t start = (loff_t)page->index << PAGE_CACHE_SHIFT;
int ret, unlock = 1; int ret, unlock = 1;
mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0)); trace_ocfs2_readpage((unsigned long long)oi->ip_blkno,
(page ? page->index : 0));
ret = ocfs2_inode_lock_with_page(inode, NULL, 0, page); ret = ocfs2_inode_lock_with_page(inode, NULL, 0, page);
if (ret != 0) { if (ret != 0) {
...@@ -323,7 +324,6 @@ static int ocfs2_readpage(struct file *file, struct page *page) ...@@ -323,7 +324,6 @@ static int ocfs2_readpage(struct file *file, struct page *page)
out: out:
if (unlock) if (unlock)
unlock_page(page); unlock_page(page);
mlog_exit(ret);
return ret; return ret;
} }
...@@ -396,15 +396,11 @@ static int ocfs2_readpages(struct file *filp, struct address_space *mapping, ...@@ -396,15 +396,11 @@ static int ocfs2_readpages(struct file *filp, struct address_space *mapping,
*/ */
static int ocfs2_writepage(struct page *page, struct writeback_control *wbc) static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)
{ {
int ret; trace_ocfs2_writepage(
(unsigned long long)OCFS2_I(page->mapping->host)->ip_blkno,
mlog_entry("(0x%p)\n", page); page->index);
ret = block_write_full_page(page, ocfs2_get_block, wbc);
mlog_exit(ret); return block_write_full_page(page, ocfs2_get_block, wbc);
return ret;
} }
/* Taken from ext3. We don't necessarily need the full blown /* Taken from ext3. We don't necessarily need the full blown
...@@ -450,7 +446,8 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block) ...@@ -450,7 +446,8 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
int err = 0; int err = 0;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
mlog_entry("(block = %llu)\n", (unsigned long long)block); trace_ocfs2_bmap((unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)block);
/* We don't need to lock journal system files, since they aren't /* We don't need to lock journal system files, since they aren't
* accessed concurrently from multiple nodes. * accessed concurrently from multiple nodes.
...@@ -484,8 +481,6 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block) ...@@ -484,8 +481,6 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
bail: bail:
status = err ? 0 : p_blkno; status = err ? 0 : p_blkno;
mlog_exit((int)status);
return status; return status;
} }
...@@ -616,9 +611,6 @@ static ssize_t ocfs2_direct_IO(int rw, ...@@ -616,9 +611,6 @@ static ssize_t ocfs2_direct_IO(int rw,
{ {
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host;
int ret;
mlog_entry_void();
/* /*
* Fallback to buffered I/O if we see an inode without * Fallback to buffered I/O if we see an inode without
...@@ -631,13 +623,10 @@ static ssize_t ocfs2_direct_IO(int rw, ...@@ -631,13 +623,10 @@ static ssize_t ocfs2_direct_IO(int rw,
if (i_size_read(inode) <= offset) if (i_size_read(inode) <= offset)
return 0; return 0;
ret = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev,
iov, offset, nr_segs, iov, offset, nr_segs,
ocfs2_direct_IO_get_blocks, ocfs2_direct_IO_get_blocks,
ocfs2_dio_end_io, NULL, 0); ocfs2_dio_end_io, NULL, 0);
mlog_exit(ret);
return ret;
} }
static void ocfs2_figure_cluster_boundaries(struct ocfs2_super *osb, static void ocfs2_figure_cluster_boundaries(struct ocfs2_super *osb,
...@@ -1026,6 +1015,12 @@ static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno, ...@@ -1026,6 +1015,12 @@ static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno,
ocfs2_figure_cluster_boundaries(OCFS2_SB(inode->i_sb), cpos, ocfs2_figure_cluster_boundaries(OCFS2_SB(inode->i_sb), cpos,
&cluster_start, &cluster_end); &cluster_start, &cluster_end);
/* treat the write as new if the a hole/lseek spanned across
* the page boundary.
*/
new = new | ((i_size_read(inode) <= page_offset(page)) &&
(page_offset(page) <= user_pos));
if (page == wc->w_target_page) { if (page == wc->w_target_page) {
map_from = user_pos & (PAGE_CACHE_SIZE - 1); map_from = user_pos & (PAGE_CACHE_SIZE - 1);
map_to = map_from + user_len; map_to = map_from + user_len;
...@@ -1534,9 +1529,9 @@ static int ocfs2_try_to_write_inline_data(struct address_space *mapping, ...@@ -1534,9 +1529,9 @@ static int ocfs2_try_to_write_inline_data(struct address_space *mapping,
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_dinode *di = NULL; struct ocfs2_dinode *di = NULL;
mlog(0, "Inode %llu, write of %u bytes at off %llu. features: 0x%x\n", trace_ocfs2_try_to_write_inline_data((unsigned long long)oi->ip_blkno,
(unsigned long long)oi->ip_blkno, len, (unsigned long long)pos, len, (unsigned long long)pos,
oi->ip_dyn_features); oi->ip_dyn_features);
/* /*
* Handle inodes which already have inline data 1st. * Handle inodes which already have inline data 1st.
...@@ -1739,6 +1734,13 @@ int ocfs2_write_begin_nolock(struct file *filp, ...@@ -1739,6 +1734,13 @@ int ocfs2_write_begin_nolock(struct file *filp,
di = (struct ocfs2_dinode *)wc->w_di_bh->b_data; di = (struct ocfs2_dinode *)wc->w_di_bh->b_data;
trace_ocfs2_write_begin_nolock(
(unsigned long long)OCFS2_I(inode)->ip_blkno,
(long long)i_size_read(inode),
le32_to_cpu(di->i_clusters),
pos, len, flags, mmap_page,
clusters_to_alloc, extents_to_split);
/* /*
* We set w_target_from, w_target_to here so that * We set w_target_from, w_target_to here so that
* ocfs2_write_end() knows which range in the target page to * ocfs2_write_end() knows which range in the target page to
...@@ -1751,12 +1753,6 @@ int ocfs2_write_begin_nolock(struct file *filp, ...@@ -1751,12 +1753,6 @@ int ocfs2_write_begin_nolock(struct file *filp,
* ocfs2_lock_allocators(). It greatly over-estimates * ocfs2_lock_allocators(). It greatly over-estimates
* the work to be done. * the work to be done.
*/ */
mlog(0, "extend inode %llu, i_size = %lld, di->i_clusters = %u,"
" clusters_to_add = %u, extents_to_split = %u\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno,
(long long)i_size_read(inode), le32_to_cpu(di->i_clusters),
clusters_to_alloc, extents_to_split);
ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode),
wc->w_di_bh); wc->w_di_bh);
ret = ocfs2_lock_allocators(inode, &et, ret = ocfs2_lock_allocators(inode, &et,
...@@ -1938,8 +1934,8 @@ static void ocfs2_write_end_inline(struct inode *inode, loff_t pos, ...@@ -1938,8 +1934,8 @@ static void ocfs2_write_end_inline(struct inode *inode, loff_t pos,
memcpy(di->id2.i_data.id_data + pos, kaddr + pos, *copied); memcpy(di->id2.i_data.id_data + pos, kaddr + pos, *copied);
kunmap_atomic(kaddr, KM_USER0); kunmap_atomic(kaddr, KM_USER0);
mlog(0, "Data written to inode at offset %llu. " trace_ocfs2_write_end_inline(
"id_count = %u, copied = %u, i_dyn_features = 0x%x\n", (unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)pos, *copied, (unsigned long long)pos, *copied,
le16_to_cpu(di->id2.i_data.id_count), le16_to_cpu(di->id2.i_data.id_count),
le16_to_cpu(di->i_dyn_features)); le16_to_cpu(di->i_dyn_features));
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
#include "inode.h" #include "inode.h"
#include "journal.h" #include "journal.h"
#include "uptodate.h" #include "uptodate.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
#include "ocfs2_trace.h"
/* /*
* Bits on bh->b_state used by ocfs2. * Bits on bh->b_state used by ocfs2.
...@@ -55,8 +55,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, ...@@ -55,8 +55,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
{ {
int ret = 0; int ret = 0;
mlog_entry("(bh->b_blocknr = %llu, ci=%p)\n", trace_ocfs2_write_block((unsigned long long)bh->b_blocknr, ci);
(unsigned long long)bh->b_blocknr, ci);
BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO); BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO);
BUG_ON(buffer_jbd(bh)); BUG_ON(buffer_jbd(bh));
...@@ -66,6 +65,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, ...@@ -66,6 +65,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
* can get modified during recovery even if read-only. */ * can get modified during recovery even if read-only. */
if (ocfs2_is_hard_readonly(osb)) { if (ocfs2_is_hard_readonly(osb)) {
ret = -EROFS; ret = -EROFS;
mlog_errno(ret);
goto out; goto out;
} }
...@@ -91,11 +91,11 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, ...@@ -91,11 +91,11 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
* uptodate. */ * uptodate. */
ret = -EIO; ret = -EIO;
put_bh(bh); put_bh(bh);
mlog_errno(ret);
} }
ocfs2_metadata_cache_io_unlock(ci); ocfs2_metadata_cache_io_unlock(ci);
out: out:
mlog_exit(ret);
return ret; return ret;
} }
...@@ -106,10 +106,10 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block, ...@@ -106,10 +106,10 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
unsigned int i; unsigned int i;
struct buffer_head *bh; struct buffer_head *bh;
if (!nr) { trace_ocfs2_read_blocks_sync((unsigned long long)block, nr);
mlog(ML_BH_IO, "No buffers will be read!\n");
if (!nr)
goto bail; goto bail;
}
for (i = 0 ; i < nr ; i++) { for (i = 0 ; i < nr ; i++) {
if (bhs[i] == NULL) { if (bhs[i] == NULL) {
...@@ -123,10 +123,8 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block, ...@@ -123,10 +123,8 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
bh = bhs[i]; bh = bhs[i];
if (buffer_jbd(bh)) { if (buffer_jbd(bh)) {
mlog(ML_BH_IO, trace_ocfs2_read_blocks_sync_jbd(
"trying to sync read a jbd " (unsigned long long)bh->b_blocknr);
"managed bh (blocknr = %llu), skipping\n",
(unsigned long long)bh->b_blocknr);
continue; continue;
} }
...@@ -186,8 +184,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, ...@@ -186,8 +184,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
struct buffer_head *bh; struct buffer_head *bh;
struct super_block *sb = ocfs2_metadata_cache_get_super(ci); struct super_block *sb = ocfs2_metadata_cache_get_super(ci);
mlog_entry("(ci=%p, block=(%llu), nr=(%d), flags=%d)\n", trace_ocfs2_read_blocks_begin(ci, (unsigned long long)block, nr, flags);
ci, (unsigned long long)block, nr, flags);
BUG_ON(!ci); BUG_ON(!ci);
BUG_ON((flags & OCFS2_BH_READAHEAD) && BUG_ON((flags & OCFS2_BH_READAHEAD) &&
...@@ -207,7 +204,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, ...@@ -207,7 +204,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
} }
if (nr == 0) { if (nr == 0) {
mlog(ML_BH_IO, "No buffers will be read!\n");
status = 0; status = 0;
goto bail; goto bail;
} }
...@@ -251,8 +247,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, ...@@ -251,8 +247,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
*/ */
if (!ignore_cache && !ocfs2_buffer_uptodate(ci, bh)) { if (!ignore_cache && !ocfs2_buffer_uptodate(ci, bh)) {
mlog(ML_UPTODATE, trace_ocfs2_read_blocks_from_disk(
"bh (%llu), owner %llu not uptodate\n",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
(unsigned long long)ocfs2_metadata_cache_owner(ci)); (unsigned long long)ocfs2_metadata_cache_owner(ci));
/* We're using ignore_cache here to say /* We're using ignore_cache here to say
...@@ -260,11 +255,10 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, ...@@ -260,11 +255,10 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
ignore_cache = 1; ignore_cache = 1;
} }
trace_ocfs2_read_blocks_bh((unsigned long long)bh->b_blocknr,
ignore_cache, buffer_jbd(bh), buffer_dirty(bh));
if (buffer_jbd(bh)) { if (buffer_jbd(bh)) {
if (ignore_cache)
mlog(ML_BH_IO, "trying to sync read a jbd "
"managed bh (blocknr = %llu)\n",
(unsigned long long)bh->b_blocknr);
continue; continue;
} }
...@@ -272,9 +266,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, ...@@ -272,9 +266,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
if (buffer_dirty(bh)) { if (buffer_dirty(bh)) {
/* This should probably be a BUG, or /* This should probably be a BUG, or
* at least return an error. */ * at least return an error. */
mlog(ML_BH_IO, "asking me to sync read a dirty "
"buffer! (blocknr = %llu)\n",
(unsigned long long)bh->b_blocknr);
continue; continue;
} }
...@@ -367,14 +358,11 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, ...@@ -367,14 +358,11 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
} }
ocfs2_metadata_cache_io_unlock(ci); ocfs2_metadata_cache_io_unlock(ci);
mlog(ML_BH_IO, "block=(%llu), nr=(%d), cached=%s, flags=0x%x\n", trace_ocfs2_read_blocks_end((unsigned long long)block, nr,
(unsigned long long)block, nr, flags, ignore_cache);
((flags & OCFS2_BH_IGNORE_CACHE) || ignore_cache) ? "no" : "yes",
flags);
bail: bail:
mlog_exit(status);
return status; return status;
} }
...@@ -408,13 +396,12 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb, ...@@ -408,13 +396,12 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
int ret = 0; int ret = 0;
struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data; struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;
mlog_entry_void();
BUG_ON(buffer_jbd(bh)); BUG_ON(buffer_jbd(bh));
ocfs2_check_super_or_backup(osb->sb, bh->b_blocknr); ocfs2_check_super_or_backup(osb->sb, bh->b_blocknr);
if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) { if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) {
ret = -EROFS; ret = -EROFS;
mlog_errno(ret);
goto out; goto out;
} }
...@@ -434,9 +421,9 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb, ...@@ -434,9 +421,9 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
if (!buffer_uptodate(bh)) { if (!buffer_uptodate(bh)) {
ret = -EIO; ret = -EIO;
put_bh(bh); put_bh(bh);
mlog_errno(ret);
} }
out: out:
mlog_exit(ret);
return ret; return ret;
} }
...@@ -1654,8 +1654,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg) ...@@ -1654,8 +1654,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
struct o2hb_disk_slot *slot; struct o2hb_disk_slot *slot;
struct o2hb_disk_heartbeat_block *hb_block; struct o2hb_disk_heartbeat_block *hb_block;
mlog_entry_void();
ret = o2hb_read_slots(reg, reg->hr_blocks); ret = o2hb_read_slots(reg, reg->hr_blocks);
if (ret) { if (ret) {
mlog_errno(ret); mlog_errno(ret);
...@@ -1677,7 +1675,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg) ...@@ -1677,7 +1675,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
} }
out: out:
mlog_exit(ret);
return ret; return ret;
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
struct mlog_bits mlog_and_bits = MLOG_BITS_RHS(MLOG_INITIAL_AND_MASK); struct mlog_bits mlog_and_bits = MLOG_BITS_RHS(MLOG_INITIAL_AND_MASK);
EXPORT_SYMBOL_GPL(mlog_and_bits); EXPORT_SYMBOL_GPL(mlog_and_bits);
struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(MLOG_INITIAL_NOT_MASK); struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(0);
EXPORT_SYMBOL_GPL(mlog_not_bits); EXPORT_SYMBOL_GPL(mlog_not_bits);
static ssize_t mlog_mask_show(u64 mask, char *buf) static ssize_t mlog_mask_show(u64 mask, char *buf)
...@@ -80,8 +80,6 @@ struct mlog_attribute { ...@@ -80,8 +80,6 @@ struct mlog_attribute {
} }
static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = { static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
define_mask(ENTRY),
define_mask(EXIT),
define_mask(TCP), define_mask(TCP),
define_mask(MSG), define_mask(MSG),
define_mask(SOCKET), define_mask(SOCKET),
...@@ -93,27 +91,11 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = { ...@@ -93,27 +91,11 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
define_mask(DLM_THREAD), define_mask(DLM_THREAD),
define_mask(DLM_MASTER), define_mask(DLM_MASTER),
define_mask(DLM_RECOVERY), define_mask(DLM_RECOVERY),
define_mask(AIO),
define_mask(JOURNAL),
define_mask(DISK_ALLOC),
define_mask(SUPER),
define_mask(FILE_IO),
define_mask(EXTENT_MAP),
define_mask(DLM_GLUE), define_mask(DLM_GLUE),
define_mask(BH_IO),
define_mask(UPTODATE),
define_mask(NAMEI),
define_mask(INODE),
define_mask(VOTE), define_mask(VOTE),
define_mask(DCACHE),
define_mask(CONN), define_mask(CONN),
define_mask(QUORUM), define_mask(QUORUM),
define_mask(EXPORT),
define_mask(XATTR),
define_mask(QUOTA),
define_mask(REFCOUNT),
define_mask(BASTS), define_mask(BASTS),
define_mask(RESERVATIONS),
define_mask(CLUSTER), define_mask(CLUSTER),
define_mask(ERROR), define_mask(ERROR),
define_mask(NOTICE), define_mask(NOTICE),
......
...@@ -82,41 +82,23 @@ ...@@ -82,41 +82,23 @@
/* bits that are frequently given and infrequently matched in the low word */ /* bits that are frequently given and infrequently matched in the low word */
/* NOTE: If you add a flag, you need to also update masklog.c! */ /* NOTE: If you add a flag, you need to also update masklog.c! */
#define ML_ENTRY 0x0000000000000001ULL /* func call entry */ #define ML_TCP 0x0000000000000001ULL /* net cluster/tcp.c */
#define ML_EXIT 0x0000000000000002ULL /* func call exit */ #define ML_MSG 0x0000000000000002ULL /* net network messages */
#define ML_TCP 0x0000000000000004ULL /* net cluster/tcp.c */ #define ML_SOCKET 0x0000000000000004ULL /* net socket lifetime */
#define ML_MSG 0x0000000000000008ULL /* net network messages */ #define ML_HEARTBEAT 0x0000000000000008ULL /* hb all heartbeat tracking */
#define ML_SOCKET 0x0000000000000010ULL /* net socket lifetime */ #define ML_HB_BIO 0x0000000000000010ULL /* hb io tracing */
#define ML_HEARTBEAT 0x0000000000000020ULL /* hb all heartbeat tracking */ #define ML_DLMFS 0x0000000000000020ULL /* dlm user dlmfs */
#define ML_HB_BIO 0x0000000000000040ULL /* hb io tracing */ #define ML_DLM 0x0000000000000040ULL /* dlm general debugging */
#define ML_DLMFS 0x0000000000000080ULL /* dlm user dlmfs */ #define ML_DLM_DOMAIN 0x0000000000000080ULL /* dlm domain debugging */
#define ML_DLM 0x0000000000000100ULL /* dlm general debugging */ #define ML_DLM_THREAD 0x0000000000000100ULL /* dlm domain thread */
#define ML_DLM_DOMAIN 0x0000000000000200ULL /* dlm domain debugging */ #define ML_DLM_MASTER 0x0000000000000200ULL /* dlm master functions */
#define ML_DLM_THREAD 0x0000000000000400ULL /* dlm domain thread */ #define ML_DLM_RECOVERY 0x0000000000000400ULL /* dlm master functions */
#define ML_DLM_MASTER 0x0000000000000800ULL /* dlm master functions */ #define ML_DLM_GLUE 0x0000000000000800ULL /* ocfs2 dlm glue layer */
#define ML_DLM_RECOVERY 0x0000000000001000ULL /* dlm master functions */ #define ML_VOTE 0x0000000000001000ULL /* ocfs2 node messaging */
#define ML_AIO 0x0000000000002000ULL /* ocfs2 aio read and write */ #define ML_CONN 0x0000000000002000ULL /* net connection management */
#define ML_JOURNAL 0x0000000000004000ULL /* ocfs2 journalling functions */ #define ML_QUORUM 0x0000000000004000ULL /* net connection quorum */
#define ML_DISK_ALLOC 0x0000000000008000ULL /* ocfs2 disk allocation */ #define ML_BASTS 0x0000000000008000ULL /* dlmglue asts and basts */
#define ML_SUPER 0x0000000000010000ULL /* ocfs2 mount / umount */ #define ML_CLUSTER 0x0000000000010000ULL /* cluster stack */
#define ML_FILE_IO 0x0000000000020000ULL /* ocfs2 file I/O */
#define ML_EXTENT_MAP 0x0000000000040000ULL /* ocfs2 extent map caching */
#define ML_DLM_GLUE 0x0000000000080000ULL /* ocfs2 dlm glue layer */
#define ML_BH_IO 0x0000000000100000ULL /* ocfs2 buffer I/O */
#define ML_UPTODATE 0x0000000000200000ULL /* ocfs2 caching sequence #'s */
#define ML_NAMEI 0x0000000000400000ULL /* ocfs2 directory / namespace */
#define ML_INODE 0x0000000000800000ULL /* ocfs2 inode manipulation */
#define ML_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */
#define ML_DCACHE 0x0000000002000000ULL /* ocfs2 dcache operations */
#define ML_CONN 0x0000000004000000ULL /* net connection management */
#define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */
#define ML_EXPORT 0x0000000010000000ULL /* ocfs2 export operations */
#define ML_XATTR 0x0000000020000000ULL /* ocfs2 extended attributes */
#define ML_QUOTA 0x0000000040000000ULL /* ocfs2 quota operations */
#define ML_REFCOUNT 0x0000000080000000ULL /* refcount tree operations */
#define ML_BASTS 0x0000000100000000ULL /* dlmglue asts and basts */
#define ML_RESERVATIONS 0x0000000200000000ULL /* ocfs2 alloc reservations */
#define ML_CLUSTER 0x0000000400000000ULL /* cluster stack */
/* bits that are infrequently given and frequently matched in the high word */ /* bits that are infrequently given and frequently matched in the high word */
#define ML_ERROR 0x1000000000000000ULL /* sent to KERN_ERR */ #define ML_ERROR 0x1000000000000000ULL /* sent to KERN_ERR */
...@@ -124,7 +106,6 @@ ...@@ -124,7 +106,6 @@
#define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */ #define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */
#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE) #define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE)
#define MLOG_INITIAL_NOT_MASK (ML_ENTRY|ML_EXIT)
#ifndef MLOG_MASK_PREFIX #ifndef MLOG_MASK_PREFIX
#define MLOG_MASK_PREFIX 0 #define MLOG_MASK_PREFIX 0
#endif #endif
...@@ -222,58 +203,6 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits; ...@@ -222,58 +203,6 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
mlog(ML_ERROR, "status = %lld\n", (long long)_st); \ mlog(ML_ERROR, "status = %lld\n", (long long)_st); \
} while (0) } while (0)
#if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
#define mlog_entry(fmt, args...) do { \
mlog(ML_ENTRY, "ENTRY:" fmt , ##args); \
} while (0)
#define mlog_entry_void() do { \
mlog(ML_ENTRY, "ENTRY:\n"); \
} while (0)
/*
* We disable this for sparse.
*/
#if !defined(__CHECKER__)
#define mlog_exit(st) do { \
if (__builtin_types_compatible_p(typeof(st), unsigned long)) \
mlog(ML_EXIT, "EXIT: %lu\n", (unsigned long) (st)); \
else if (__builtin_types_compatible_p(typeof(st), signed long)) \
mlog(ML_EXIT, "EXIT: %ld\n", (signed long) (st)); \
else if (__builtin_types_compatible_p(typeof(st), unsigned int) \
|| __builtin_types_compatible_p(typeof(st), unsigned short) \
|| __builtin_types_compatible_p(typeof(st), unsigned char)) \
mlog(ML_EXIT, "EXIT: %u\n", (unsigned int) (st)); \
else if (__builtin_types_compatible_p(typeof(st), signed int) \
|| __builtin_types_compatible_p(typeof(st), signed short) \
|| __builtin_types_compatible_p(typeof(st), signed char)) \
mlog(ML_EXIT, "EXIT: %d\n", (signed int) (st)); \
else if (__builtin_types_compatible_p(typeof(st), long long)) \
mlog(ML_EXIT, "EXIT: %lld\n", (long long) (st)); \
else \
mlog(ML_EXIT, "EXIT: %llu\n", (unsigned long long) (st)); \
} while (0)
#else
#define mlog_exit(st) do { \
mlog(ML_EXIT, "EXIT: %lld\n", (long long) (st)); \
} while (0)
#endif
#define mlog_exit_ptr(ptr) do { \
mlog(ML_EXIT, "EXIT: %p\n", ptr); \
} while (0)
#define mlog_exit_void() do { \
mlog(ML_EXIT, "EXIT\n"); \
} while (0)
#else
#define mlog_entry(...) do { } while (0)
#define mlog_entry_void(...) do { } while (0)
#define mlog_exit(...) do { } while (0)
#define mlog_exit_ptr(...) do { } while (0)
#define mlog_exit_void(...) do { } while (0)
#endif /* defined(CONFIG_OCFS2_DEBUG_MASKLOG) */
#define mlog_bug_on_msg(cond, fmt, args...) do { \ #define mlog_bug_on_msg(cond, fmt, args...) do { \
if (cond) { \ if (cond) { \
mlog(ML_ERROR, "bug expression: " #cond "\n"); \ mlog(ML_ERROR, "bug expression: " #cond "\n"); \
......
...@@ -210,10 +210,6 @@ static inline void o2net_set_func_stop_time(struct o2net_sock_container *sc) ...@@ -210,10 +210,6 @@ static inline void o2net_set_func_stop_time(struct o2net_sock_container *sc)
sc->sc_tv_func_stop = ktime_get(); sc->sc_tv_func_stop = ktime_get();
} }
static ktime_t o2net_get_func_run_time(struct o2net_sock_container *sc)
{
return ktime_sub(sc->sc_tv_func_stop, sc->sc_tv_func_start);
}
#else /* CONFIG_DEBUG_FS */ #else /* CONFIG_DEBUG_FS */
# define o2net_init_nst(a, b, c, d, e) # define o2net_init_nst(a, b, c, d, e)
# define o2net_set_nst_sock_time(a) # define o2net_set_nst_sock_time(a)
...@@ -227,10 +223,14 @@ static ktime_t o2net_get_func_run_time(struct o2net_sock_container *sc) ...@@ -227,10 +223,14 @@ static ktime_t o2net_get_func_run_time(struct o2net_sock_container *sc)
# define o2net_set_advance_stop_time(a) # define o2net_set_advance_stop_time(a)
# define o2net_set_func_start_time(a) # define o2net_set_func_start_time(a)
# define o2net_set_func_stop_time(a) # define o2net_set_func_stop_time(a)
# define o2net_get_func_run_time(a) (ktime_t)0
#endif /* CONFIG_DEBUG_FS */ #endif /* CONFIG_DEBUG_FS */
#ifdef CONFIG_OCFS2_FS_STATS #ifdef CONFIG_OCFS2_FS_STATS
static ktime_t o2net_get_func_run_time(struct o2net_sock_container *sc)
{
return ktime_sub(sc->sc_tv_func_stop, sc->sc_tv_func_start);
}
static void o2net_update_send_stats(struct o2net_send_tracking *nst, static void o2net_update_send_stats(struct o2net_send_tracking *nst,
struct o2net_sock_container *sc) struct o2net_sock_container *sc)
{ {
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/namei.h> #include <linux/namei.h>
#define MLOG_MASK_PREFIX ML_DCACHE
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -39,6 +38,7 @@ ...@@ -39,6 +38,7 @@
#include "file.h" #include "file.h"
#include "inode.h" #include "inode.h"
#include "super.h" #include "super.h"
#include "ocfs2_trace.h"
void ocfs2_dentry_attach_gen(struct dentry *dentry) void ocfs2_dentry_attach_gen(struct dentry *dentry)
{ {
...@@ -62,8 +62,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry, ...@@ -62,8 +62,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
inode = dentry->d_inode; inode = dentry->d_inode;
osb = OCFS2_SB(dentry->d_sb); osb = OCFS2_SB(dentry->d_sb);
mlog_entry("(0x%p, '%.*s')\n", dentry, trace_ocfs2_dentry_revalidate(dentry, dentry->d_name.len,
dentry->d_name.len, dentry->d_name.name); dentry->d_name.name);
/* For a negative dentry - /* For a negative dentry -
* check the generation number of the parent and compare with the * check the generation number of the parent and compare with the
...@@ -73,9 +73,10 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry, ...@@ -73,9 +73,10 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
unsigned long gen = (unsigned long) dentry->d_fsdata; unsigned long gen = (unsigned long) dentry->d_fsdata;
unsigned long pgen = unsigned long pgen =
OCFS2_I(dentry->d_parent->d_inode)->ip_dir_lock_gen; OCFS2_I(dentry->d_parent->d_inode)->ip_dir_lock_gen;
mlog(0, "negative dentry: %.*s parent gen: %lu "
"dentry gen: %lu\n", trace_ocfs2_dentry_revalidate_negative(dentry->d_name.len,
dentry->d_name.len, dentry->d_name.name, pgen, gen); dentry->d_name.name,
pgen, gen);
if (gen != pgen) if (gen != pgen)
goto bail; goto bail;
goto valid; goto valid;
...@@ -90,8 +91,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry, ...@@ -90,8 +91,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
/* did we or someone else delete this inode? */ /* did we or someone else delete this inode? */
if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) { if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) {
spin_unlock(&OCFS2_I(inode)->ip_lock); spin_unlock(&OCFS2_I(inode)->ip_lock);
mlog(0, "inode (%llu) deleted, returning false\n", trace_ocfs2_dentry_revalidate_delete(
(unsigned long long)OCFS2_I(inode)->ip_blkno); (unsigned long long)OCFS2_I(inode)->ip_blkno);
goto bail; goto bail;
} }
spin_unlock(&OCFS2_I(inode)->ip_lock); spin_unlock(&OCFS2_I(inode)->ip_lock);
...@@ -101,10 +102,9 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry, ...@@ -101,10 +102,9 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
* inode nlink hits zero, it never goes back. * inode nlink hits zero, it never goes back.
*/ */
if (inode->i_nlink == 0) { if (inode->i_nlink == 0) {
mlog(0, "Inode %llu orphaned, returning false " trace_ocfs2_dentry_revalidate_orphaned(
"dir = %d\n", (unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)OCFS2_I(inode)->ip_blkno, S_ISDIR(inode->i_mode));
S_ISDIR(inode->i_mode));
goto bail; goto bail;
} }
...@@ -113,9 +113,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry, ...@@ -113,9 +113,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
* redo it. * redo it.
*/ */
if (!dentry->d_fsdata) { if (!dentry->d_fsdata) {
mlog(0, "Inode %llu doesn't have dentry lock, " trace_ocfs2_dentry_revalidate_nofsdata(
"returning false\n", (unsigned long long)OCFS2_I(inode)->ip_blkno);
(unsigned long long)OCFS2_I(inode)->ip_blkno);
goto bail; goto bail;
} }
...@@ -123,8 +122,7 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry, ...@@ -123,8 +122,7 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
ret = 1; ret = 1;
bail: bail:
mlog_exit(ret); trace_ocfs2_dentry_revalidate_ret(ret);
return ret; return ret;
} }
...@@ -181,8 +179,8 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode, ...@@ -181,8 +179,8 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode,
spin_lock(&dentry->d_lock); spin_lock(&dentry->d_lock);
if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) { if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
mlog(0, "dentry found: %.*s\n", trace_ocfs2_find_local_alias(dentry->d_name.len,
dentry->d_name.len, dentry->d_name.name); dentry->d_name.name);
dget_dlock(dentry); dget_dlock(dentry);
spin_unlock(&dentry->d_lock); spin_unlock(&dentry->d_lock);
...@@ -240,9 +238,8 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry, ...@@ -240,9 +238,8 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry,
struct dentry *alias; struct dentry *alias;
struct ocfs2_dentry_lock *dl = dentry->d_fsdata; struct ocfs2_dentry_lock *dl = dentry->d_fsdata;
mlog(0, "Attach \"%.*s\", parent %llu, fsdata: %p\n", trace_ocfs2_dentry_attach_lock(dentry->d_name.len, dentry->d_name.name,
dentry->d_name.len, dentry->d_name.name, (unsigned long long)parent_blkno, dl);
(unsigned long long)parent_blkno, dl);
/* /*
* Negative dentry. We ignore these for now. * Negative dentry. We ignore these for now.
...@@ -292,7 +289,9 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry, ...@@ -292,7 +289,9 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry,
(unsigned long long)parent_blkno, (unsigned long long)parent_blkno,
(unsigned long long)dl->dl_parent_blkno); (unsigned long long)dl->dl_parent_blkno);
mlog(0, "Found: %s\n", dl->dl_lockres.l_name); trace_ocfs2_dentry_attach_lock_found(dl->dl_lockres.l_name,
(unsigned long long)parent_blkno,
(unsigned long long)OCFS2_I(inode)->ip_blkno);
goto out_attach; goto out_attach;
} }
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <linux/quotaops.h> #include <linux/quotaops.h>
#include <linux/sort.h> #include <linux/sort.h>
#define MLOG_MASK_PREFIX ML_NAMEI
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -61,6 +60,7 @@ ...@@ -61,6 +60,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"
...@@ -322,21 +322,23 @@ static int ocfs2_check_dir_entry(struct inode * dir, ...@@ -322,21 +322,23 @@ static int ocfs2_check_dir_entry(struct inode * dir,
const char *error_msg = NULL; const char *error_msg = NULL;
const int rlen = le16_to_cpu(de->rec_len); const int rlen = le16_to_cpu(de->rec_len);
if (rlen < OCFS2_DIR_REC_LEN(1)) if (unlikely(rlen < OCFS2_DIR_REC_LEN(1)))
error_msg = "rec_len is smaller than minimal"; error_msg = "rec_len is smaller than minimal";
else if (rlen % 4 != 0) else if (unlikely(rlen % 4 != 0))
error_msg = "rec_len % 4 != 0"; error_msg = "rec_len % 4 != 0";
else if (rlen < OCFS2_DIR_REC_LEN(de->name_len)) else if (unlikely(rlen < OCFS2_DIR_REC_LEN(de->name_len)))
error_msg = "rec_len is too small for name_len"; error_msg = "rec_len is too small for name_len";
else if (((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize) else if (unlikely(
((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize))
error_msg = "directory entry across blocks"; error_msg = "directory entry across blocks";
if (error_msg != NULL) if (unlikely(error_msg != NULL))
mlog(ML_ERROR, "bad entry in directory #%llu: %s - " mlog(ML_ERROR, "bad entry in directory #%llu: %s - "
"offset=%lu, inode=%llu, rec_len=%d, name_len=%d\n", "offset=%lu, inode=%llu, rec_len=%d, name_len=%d\n",
(unsigned long long)OCFS2_I(dir)->ip_blkno, error_msg, (unsigned long long)OCFS2_I(dir)->ip_blkno, error_msg,
offset, (unsigned long long)le64_to_cpu(de->inode), rlen, offset, (unsigned long long)le64_to_cpu(de->inode), rlen,
de->name_len); de->name_len);
return error_msg == NULL ? 1 : 0; return error_msg == NULL ? 1 : 0;
} }
...@@ -367,8 +369,6 @@ static inline int ocfs2_search_dirblock(struct buffer_head *bh, ...@@ -367,8 +369,6 @@ static inline int ocfs2_search_dirblock(struct buffer_head *bh,
int de_len; int de_len;
int ret = 0; int ret = 0;
mlog_entry_void();
de_buf = first_de; de_buf = first_de;
dlimit = de_buf + bytes; dlimit = de_buf + bytes;
...@@ -402,7 +402,7 @@ static inline int ocfs2_search_dirblock(struct buffer_head *bh, ...@@ -402,7 +402,7 @@ static inline int ocfs2_search_dirblock(struct buffer_head *bh,
} }
bail: bail:
mlog_exit(ret); trace_ocfs2_search_dirblock(ret);
return ret; return ret;
} }
...@@ -447,8 +447,7 @@ static int ocfs2_validate_dir_block(struct super_block *sb, ...@@ -447,8 +447,7 @@ static int ocfs2_validate_dir_block(struct super_block *sb,
* We don't validate dirents here, that's handled * We don't validate dirents here, that's handled
* in-place when the code walks them. * in-place when the code walks them.
*/ */
mlog(0, "Validating dirblock %llu\n", trace_ocfs2_validate_dir_block((unsigned long long)bh->b_blocknr);
(unsigned long long)bh->b_blocknr);
BUG_ON(!buffer_uptodate(bh)); BUG_ON(!buffer_uptodate(bh));
...@@ -706,8 +705,6 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, ...@@ -706,8 +705,6 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,
int num = 0; int num = 0;
int nblocks, i, err; int nblocks, i, err;
mlog_entry_void();
sb = dir->i_sb; sb = dir->i_sb;
nblocks = i_size_read(dir) >> sb->s_blocksize_bits; nblocks = i_size_read(dir) >> sb->s_blocksize_bits;
...@@ -788,7 +785,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, ...@@ -788,7 +785,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,
for (; ra_ptr < ra_max; ra_ptr++) for (; ra_ptr < ra_max; ra_ptr++)
brelse(bh_use[ra_ptr]); brelse(bh_use[ra_ptr]);
mlog_exit_ptr(ret); trace_ocfs2_find_entry_el(ret);
return ret; return ret;
} }
...@@ -950,11 +947,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen, ...@@ -950,11 +947,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen,
goto out; goto out;
} }
mlog(0, "Dir %llu: name: \"%.*s\", lookup of hash: %u.0x%x " trace_ocfs2_dx_dir_search((unsigned long long)OCFS2_I(dir)->ip_blkno,
"returns: %llu\n", namelen, name, hinfo->major_hash,
(unsigned long long)OCFS2_I(dir)->ip_blkno, hinfo->minor_hash, (unsigned long long)phys);
namelen, name, hinfo->major_hash, hinfo->minor_hash,
(unsigned long long)phys);
ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh); ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh);
if (ret) { if (ret) {
...@@ -964,9 +959,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen, ...@@ -964,9 +959,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen,
dx_leaf = (struct ocfs2_dx_leaf *) dx_leaf_bh->b_data; dx_leaf = (struct ocfs2_dx_leaf *) dx_leaf_bh->b_data;
mlog(0, "leaf info: num_used: %d, count: %d\n", trace_ocfs2_dx_dir_search_leaf_info(
le16_to_cpu(dx_leaf->dl_list.de_num_used), le16_to_cpu(dx_leaf->dl_list.de_num_used),
le16_to_cpu(dx_leaf->dl_list.de_count)); le16_to_cpu(dx_leaf->dl_list.de_count));
entry_list = &dx_leaf->dl_list; entry_list = &dx_leaf->dl_list;
...@@ -1166,8 +1161,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir, ...@@ -1166,8 +1161,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
int i, status = -ENOENT; int i, status = -ENOENT;
ocfs2_journal_access_func access = ocfs2_journal_access_db; ocfs2_journal_access_func access = ocfs2_journal_access_db;
mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);
if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
access = ocfs2_journal_access_di; access = ocfs2_journal_access_di;
...@@ -1202,7 +1195,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir, ...@@ -1202,7 +1195,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
de = (struct ocfs2_dir_entry *)((char *)de + le16_to_cpu(de->rec_len)); de = (struct ocfs2_dir_entry *)((char *)de + le16_to_cpu(de->rec_len));
} }
bail: bail:
mlog_exit(status);
return status; return status;
} }
...@@ -1348,8 +1340,8 @@ static int ocfs2_delete_entry_dx(handle_t *handle, struct inode *dir, ...@@ -1348,8 +1340,8 @@ static int ocfs2_delete_entry_dx(handle_t *handle, struct inode *dir,
} }
} }
mlog(0, "Dir %llu: delete entry at index: %d\n", trace_ocfs2_delete_entry_dx((unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)OCFS2_I(dir)->ip_blkno, index); index);
ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry, ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry,
leaf_bh, leaf_bh->b_data, leaf_bh->b_size); leaf_bh, leaf_bh->b_data, leaf_bh->b_size);
...@@ -1632,8 +1624,6 @@ int __ocfs2_add_entry(handle_t *handle, ...@@ -1632,8 +1624,6 @@ int __ocfs2_add_entry(handle_t *handle,
struct buffer_head *insert_bh = lookup->dl_leaf_bh; struct buffer_head *insert_bh = lookup->dl_leaf_bh;
char *data_start = insert_bh->b_data; char *data_start = insert_bh->b_data;
mlog_entry_void();
if (!namelen) if (!namelen)
return -EINVAL; return -EINVAL;
...@@ -1765,8 +1755,9 @@ int __ocfs2_add_entry(handle_t *handle, ...@@ -1765,8 +1755,9 @@ int __ocfs2_add_entry(handle_t *handle,
* from ever getting here. */ * from ever getting here. */
retval = -ENOSPC; retval = -ENOSPC;
bail: bail:
if (retval)
mlog_errno(retval);
mlog_exit(retval);
return retval; return retval;
} }
...@@ -2028,8 +2019,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) ...@@ -2028,8 +2019,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
struct inode *inode = filp->f_path.dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
int lock_level = 0; int lock_level = 0;
mlog_entry("dirino=%llu\n", trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno);
(unsigned long long)OCFS2_I(inode)->ip_blkno);
error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level); error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level);
if (lock_level && error >= 0) { if (lock_level && error >= 0) {
...@@ -2051,9 +2041,10 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) ...@@ -2051,9 +2041,10 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
dirent, filldir, NULL); dirent, filldir, NULL);
ocfs2_inode_unlock(inode, lock_level); ocfs2_inode_unlock(inode, lock_level);
if (error)
mlog_errno(error);
bail_nolock: bail_nolock:
mlog_exit(error);
return error; return error;
} }
...@@ -2069,8 +2060,8 @@ int ocfs2_find_files_on_disk(const char *name, ...@@ -2069,8 +2060,8 @@ int ocfs2_find_files_on_disk(const char *name,
{ {
int status = -ENOENT; int status = -ENOENT;
mlog(0, "name=%.*s, blkno=%p, inode=%llu\n", namelen, name, blkno, trace_ocfs2_find_files_on_disk(namelen, name, blkno,
(unsigned long long)OCFS2_I(inode)->ip_blkno); (unsigned long long)OCFS2_I(inode)->ip_blkno);
status = ocfs2_find_entry(name, namelen, inode, lookup); status = ocfs2_find_entry(name, namelen, inode, lookup);
if (status) if (status)
...@@ -2114,8 +2105,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir, ...@@ -2114,8 +2105,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
int ret; int ret;
struct ocfs2_dir_lookup_result lookup = { NULL, }; struct ocfs2_dir_lookup_result lookup = { NULL, };
mlog_entry("dir %llu, name '%.*s'\n", trace_ocfs2_check_dir_for_entry(
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name);
ret = -EEXIST; ret = -EEXIST;
if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0)
...@@ -2125,7 +2116,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir, ...@@ -2125,7 +2116,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
bail: bail:
ocfs2_free_dir_lookup_result(&lookup); ocfs2_free_dir_lookup_result(&lookup);
mlog_exit(ret); if (ret)
mlog_errno(ret);
return ret; return ret;
} }
...@@ -2324,8 +2316,6 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb, ...@@ -2324,8 +2316,6 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb,
struct buffer_head *new_bh = NULL; struct buffer_head *new_bh = NULL;
struct ocfs2_dir_entry *de; struct ocfs2_dir_entry *de;
mlog_entry_void();
if (ocfs2_new_dir_wants_trailer(inode)) if (ocfs2_new_dir_wants_trailer(inode))
size = ocfs2_dir_trailer_blk_off(parent->i_sb); size = ocfs2_dir_trailer_blk_off(parent->i_sb);
...@@ -2380,7 +2370,6 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb, ...@@ -2380,7 +2370,6 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb,
bail: bail:
brelse(new_bh); brelse(new_bh);
mlog_exit(status);
return status; return status;
} }
...@@ -2409,9 +2398,9 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, ...@@ -2409,9 +2398,9 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb,
goto out; goto out;
} }
mlog(0, "Dir %llu, attach new index block: %llu\n", trace_ocfs2_dx_dir_attach_index(
(unsigned long long)OCFS2_I(dir)->ip_blkno, (unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)dr_blkno); (unsigned long long)dr_blkno);
dx_root_bh = sb_getblk(osb->sb, dr_blkno); dx_root_bh = sb_getblk(osb->sb, dr_blkno);
if (dx_root_bh == NULL) { if (dx_root_bh == NULL) {
...@@ -2511,11 +2500,10 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb, ...@@ -2511,11 +2500,10 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb,
dx_leaf->dl_list.de_count = dx_leaf->dl_list.de_count =
cpu_to_le16(ocfs2_dx_entries_per_leaf(osb->sb)); cpu_to_le16(ocfs2_dx_entries_per_leaf(osb->sb));
mlog(0, trace_ocfs2_dx_dir_format_cluster(
"Dir %llu, format dx_leaf: %llu, entry count: %u\n", (unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)OCFS2_I(dir)->ip_blkno, (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, le16_to_cpu(dx_leaf->dl_list.de_count));
le16_to_cpu(dx_leaf->dl_list.de_count));
ocfs2_journal_dirty(handle, bh); ocfs2_journal_dirty(handle, bh);
} }
...@@ -2759,12 +2747,11 @@ static void ocfs2_dx_dir_index_root_block(struct inode *dir, ...@@ -2759,12 +2747,11 @@ static void ocfs2_dx_dir_index_root_block(struct inode *dir,
ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo); ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo);
mlog(0, trace_ocfs2_dx_dir_index_root_block(
"dir: %llu, major: 0x%x minor: 0x%x, index: %u, name: %.*s\n", (unsigned long long)dir->i_ino,
(unsigned long long)dir->i_ino, hinfo.major_hash, hinfo.major_hash, hinfo.minor_hash,
hinfo.minor_hash, de->name_len, de->name,
le16_to_cpu(dx_root->dr_entries.de_num_used), le16_to_cpu(dx_root->dr_entries.de_num_used));
de->name_len, de->name);
ocfs2_dx_entry_list_insert(&dx_root->dr_entries, &hinfo, ocfs2_dx_entry_list_insert(&dx_root->dr_entries, &hinfo,
dirent_blk); dirent_blk);
...@@ -3235,7 +3222,6 @@ static int ocfs2_do_extend_dir(struct super_block *sb, ...@@ -3235,7 +3222,6 @@ static int ocfs2_do_extend_dir(struct super_block *sb,
bail: bail:
if (did_quota && status < 0) if (did_quota && status < 0)
dquot_free_space_nodirty(dir, ocfs2_clusters_to_bytes(sb, 1)); dquot_free_space_nodirty(dir, ocfs2_clusters_to_bytes(sb, 1));
mlog_exit(status);
return status; return status;
} }
...@@ -3270,8 +3256,6 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb, ...@@ -3270,8 +3256,6 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
struct ocfs2_extent_tree et; struct ocfs2_extent_tree et;
struct buffer_head *dx_root_bh = lookup->dl_dx_root_bh; struct buffer_head *dx_root_bh = lookup->dl_dx_root_bh;
mlog_entry_void();
if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
/* /*
* This would be a code error as an inline directory should * This would be a code error as an inline directory should
...@@ -3320,8 +3304,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb, ...@@ -3320,8 +3304,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
down_write(&OCFS2_I(dir)->ip_alloc_sem); down_write(&OCFS2_I(dir)->ip_alloc_sem);
drop_alloc_sem = 1; drop_alloc_sem = 1;
dir_i_size = i_size_read(dir); dir_i_size = i_size_read(dir);
mlog(0, "extending dir %llu (i_size = %lld)\n", trace_ocfs2_extend_dir((unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size); dir_i_size);
/* dir->i_size is always block aligned. */ /* dir->i_size is always block aligned. */
spin_lock(&OCFS2_I(dir)->ip_lock); spin_lock(&OCFS2_I(dir)->ip_lock);
...@@ -3436,7 +3420,6 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb, ...@@ -3436,7 +3420,6 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
brelse(new_bh); brelse(new_bh);
mlog_exit(status);
return status; return status;
} }
...@@ -3583,8 +3566,9 @@ static int ocfs2_find_dir_space_el(struct inode *dir, const char *name, ...@@ -3583,8 +3566,9 @@ static int ocfs2_find_dir_space_el(struct inode *dir, const char *name,
status = 0; status = 0;
bail: bail:
brelse(bh); brelse(bh);
if (status)
mlog_errno(status);
mlog_exit(status);
return status; return status;
} }
...@@ -3815,9 +3799,9 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, ...@@ -3815,9 +3799,9 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir,
struct ocfs2_dx_root_block *dx_root; struct ocfs2_dx_root_block *dx_root;
struct ocfs2_dx_leaf *tmp_dx_leaf = NULL; struct ocfs2_dx_leaf *tmp_dx_leaf = NULL;
mlog(0, "DX Dir: %llu, rebalance leaf leaf_blkno: %llu insert: %u\n", trace_ocfs2_dx_dir_rebalance((unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)OCFS2_I(dir)->ip_blkno, (unsigned long long)leaf_blkno,
(unsigned long long)leaf_blkno, insert_hash); insert_hash);
ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh);
...@@ -3897,8 +3881,7 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, ...@@ -3897,8 +3881,7 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir,
goto out_commit; goto out_commit;
} }
mlog(0, "Split leaf (%u) at %u, insert major hash is %u\n", trace_ocfs2_dx_dir_rebalance_split(leaf_cpos, split_hash, insert_hash);
leaf_cpos, split_hash, insert_hash);
/* /*
* We have to carefully order operations here. There are items * We have to carefully order operations here. There are items
...@@ -4355,8 +4338,8 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb, ...@@ -4355,8 +4338,8 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb,
unsigned int blocks_wanted = 1; unsigned int blocks_wanted = 1;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
mlog(0, "getting ready to insert namelen %d into dir %llu\n", trace_ocfs2_prepare_dir_for_insert(
namelen, (unsigned long long)OCFS2_I(dir)->ip_blkno); (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen);
if (!namelen) { if (!namelen) {
ret = -EINVAL; ret = -EINVAL;
......
...@@ -128,8 +128,8 @@ static enum dlm_status __dlmconvert_master(struct dlm_ctxt *dlm, ...@@ -128,8 +128,8 @@ static enum dlm_status __dlmconvert_master(struct dlm_ctxt *dlm,
assert_spin_locked(&res->spinlock); assert_spin_locked(&res->spinlock);
mlog_entry("type=%d, convert_type=%d, new convert_type=%d\n", mlog(0, "type=%d, convert_type=%d, new convert_type=%d\n",
lock->ml.type, lock->ml.convert_type, type); lock->ml.type, lock->ml.convert_type, type);
spin_lock(&lock->spinlock); spin_lock(&lock->spinlock);
...@@ -353,7 +353,7 @@ static enum dlm_status dlm_send_remote_convert_request(struct dlm_ctxt *dlm, ...@@ -353,7 +353,7 @@ static enum dlm_status dlm_send_remote_convert_request(struct dlm_ctxt *dlm,
struct kvec vec[2]; struct kvec vec[2];
size_t veclen = 1; size_t veclen = 1;
mlog_entry("%.*s\n", res->lockname.len, res->lockname.name); mlog(0, "%.*s\n", res->lockname.len, res->lockname.name);
memset(&convert, 0, sizeof(struct dlm_convert_lock)); memset(&convert, 0, sizeof(struct dlm_convert_lock));
convert.node_idx = dlm->node_num; convert.node_idx = dlm->node_num;
......
...@@ -188,7 +188,7 @@ struct dlm_lock_resource * __dlm_lookup_lockres_full(struct dlm_ctxt *dlm, ...@@ -188,7 +188,7 @@ struct dlm_lock_resource * __dlm_lookup_lockres_full(struct dlm_ctxt *dlm,
struct hlist_head *bucket; struct hlist_head *bucket;
struct hlist_node *list; struct hlist_node *list;
mlog_entry("%.*s\n", len, name); mlog(0, "%.*s\n", len, name);
assert_spin_locked(&dlm->spinlock); assert_spin_locked(&dlm->spinlock);
...@@ -222,7 +222,7 @@ struct dlm_lock_resource * __dlm_lookup_lockres(struct dlm_ctxt *dlm, ...@@ -222,7 +222,7 @@ struct dlm_lock_resource * __dlm_lookup_lockres(struct dlm_ctxt *dlm,
{ {
struct dlm_lock_resource *res = NULL; struct dlm_lock_resource *res = NULL;
mlog_entry("%.*s\n", len, name); mlog(0, "%.*s\n", len, name);
assert_spin_locked(&dlm->spinlock); assert_spin_locked(&dlm->spinlock);
...@@ -531,7 +531,7 @@ static int dlm_exit_domain_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -531,7 +531,7 @@ static int dlm_exit_domain_handler(struct o2net_msg *msg, u32 len, void *data,
unsigned int node; unsigned int node;
struct dlm_exit_domain *exit_msg = (struct dlm_exit_domain *) msg->buf; struct dlm_exit_domain *exit_msg = (struct dlm_exit_domain *) msg->buf;
mlog_entry("%p %u %p", msg, len, data); mlog(0, "%p %u %p", msg, len, data);
if (!dlm_grab(dlm)) if (!dlm_grab(dlm))
return 0; return 0;
...@@ -926,9 +926,10 @@ static int dlm_assert_joined_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -926,9 +926,10 @@ static int dlm_assert_joined_handler(struct o2net_msg *msg, u32 len, void *data,
} }
static int dlm_match_regions(struct dlm_ctxt *dlm, static int dlm_match_regions(struct dlm_ctxt *dlm,
struct dlm_query_region *qr) struct dlm_query_region *qr,
char *local, int locallen)
{ {
char *local = NULL, *remote = qr->qr_regions; char *remote = qr->qr_regions;
char *l, *r; char *l, *r;
int localnr, i, j, foundit; int localnr, i, j, foundit;
int status = 0; int status = 0;
...@@ -957,13 +958,8 @@ static int dlm_match_regions(struct dlm_ctxt *dlm, ...@@ -957,13 +958,8 @@ static int dlm_match_regions(struct dlm_ctxt *dlm,
r += O2HB_MAX_REGION_NAME_LEN; r += O2HB_MAX_REGION_NAME_LEN;
} }
local = kmalloc(sizeof(qr->qr_regions), GFP_ATOMIC); localnr = min(O2NM_MAX_REGIONS, locallen/O2HB_MAX_REGION_NAME_LEN);
if (!local) { localnr = o2hb_get_all_regions(local, (u8)localnr);
status = -ENOMEM;
goto bail;
}
localnr = o2hb_get_all_regions(local, O2NM_MAX_REGIONS);
/* compare local regions with remote */ /* compare local regions with remote */
l = local; l = local;
...@@ -1012,8 +1008,6 @@ static int dlm_match_regions(struct dlm_ctxt *dlm, ...@@ -1012,8 +1008,6 @@ static int dlm_match_regions(struct dlm_ctxt *dlm,
} }
bail: bail:
kfree(local);
return status; return status;
} }
...@@ -1075,6 +1069,7 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len, ...@@ -1075,6 +1069,7 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
{ {
struct dlm_query_region *qr; struct dlm_query_region *qr;
struct dlm_ctxt *dlm = NULL; struct dlm_ctxt *dlm = NULL;
char *local = NULL;
int status = 0; int status = 0;
int locked = 0; int locked = 0;
...@@ -1083,6 +1078,13 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len, ...@@ -1083,6 +1078,13 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
mlog(0, "Node %u queries hb regions on domain %s\n", qr->qr_node, mlog(0, "Node %u queries hb regions on domain %s\n", qr->qr_node,
qr->qr_domain); qr->qr_domain);
/* buffer used in dlm_mast_regions() */
local = kmalloc(sizeof(qr->qr_regions), GFP_KERNEL);
if (!local) {
status = -ENOMEM;
goto bail;
}
status = -EINVAL; status = -EINVAL;
spin_lock(&dlm_domain_lock); spin_lock(&dlm_domain_lock);
...@@ -1112,13 +1114,15 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len, ...@@ -1112,13 +1114,15 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
goto bail; goto bail;
} }
status = dlm_match_regions(dlm, qr); status = dlm_match_regions(dlm, qr, local, sizeof(qr->qr_regions));
bail: bail:
if (locked) if (locked)
spin_unlock(&dlm->spinlock); spin_unlock(&dlm->spinlock);
spin_unlock(&dlm_domain_lock); spin_unlock(&dlm_domain_lock);
kfree(local);
return status; return status;
} }
...@@ -1553,7 +1557,7 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm) ...@@ -1553,7 +1557,7 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm)
struct domain_join_ctxt *ctxt; struct domain_join_ctxt *ctxt;
enum dlm_query_join_response_code response = JOIN_DISALLOW; enum dlm_query_join_response_code response = JOIN_DISALLOW;
mlog_entry("%p", dlm); mlog(0, "%p", dlm);
ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
if (!ctxt) { if (!ctxt) {
......
...@@ -128,7 +128,7 @@ static enum dlm_status dlmlock_master(struct dlm_ctxt *dlm, ...@@ -128,7 +128,7 @@ static enum dlm_status dlmlock_master(struct dlm_ctxt *dlm,
int call_ast = 0, kick_thread = 0; int call_ast = 0, kick_thread = 0;
enum dlm_status status = DLM_NORMAL; enum dlm_status status = DLM_NORMAL;
mlog_entry("type=%d\n", lock->ml.type); mlog(0, "type=%d\n", lock->ml.type);
spin_lock(&res->spinlock); spin_lock(&res->spinlock);
/* if called from dlm_create_lock_handler, need to /* if called from dlm_create_lock_handler, need to
...@@ -227,8 +227,8 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm, ...@@ -227,8 +227,8 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm,
enum dlm_status status = DLM_DENIED; enum dlm_status status = DLM_DENIED;
int lockres_changed = 1; int lockres_changed = 1;
mlog_entry("type=%d\n", lock->ml.type); mlog(0, "type=%d, lockres %.*s, flags = 0x%x\n",
mlog(0, "lockres %.*s, flags = 0x%x\n", res->lockname.len, lock->ml.type, res->lockname.len,
res->lockname.name, flags); res->lockname.name, flags);
spin_lock(&res->spinlock); spin_lock(&res->spinlock);
...@@ -308,8 +308,6 @@ static enum dlm_status dlm_send_remote_lock_request(struct dlm_ctxt *dlm, ...@@ -308,8 +308,6 @@ static enum dlm_status dlm_send_remote_lock_request(struct dlm_ctxt *dlm,
int tmpret, status = 0; int tmpret, status = 0;
enum dlm_status ret; enum dlm_status ret;
mlog_entry_void();
memset(&create, 0, sizeof(create)); memset(&create, 0, sizeof(create));
create.node_idx = dlm->node_num; create.node_idx = dlm->node_num;
create.requested_type = lock->ml.type; create.requested_type = lock->ml.type;
...@@ -477,8 +475,6 @@ int dlm_create_lock_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -477,8 +475,6 @@ int dlm_create_lock_handler(struct o2net_msg *msg, u32 len, void *data,
BUG_ON(!dlm); BUG_ON(!dlm);
mlog_entry_void();
if (!dlm_grab(dlm)) if (!dlm_grab(dlm))
return DLM_REJECTED; return DLM_REJECTED;
......
...@@ -426,8 +426,6 @@ static void dlm_mle_release(struct kref *kref) ...@@ -426,8 +426,6 @@ static void dlm_mle_release(struct kref *kref)
struct dlm_master_list_entry *mle; struct dlm_master_list_entry *mle;
struct dlm_ctxt *dlm; struct dlm_ctxt *dlm;
mlog_entry_void();
mle = container_of(kref, struct dlm_master_list_entry, mle_refs); mle = container_of(kref, struct dlm_master_list_entry, mle_refs);
dlm = mle->dlm; dlm = mle->dlm;
...@@ -3120,8 +3118,6 @@ static int dlm_add_migration_mle(struct dlm_ctxt *dlm, ...@@ -3120,8 +3118,6 @@ static int dlm_add_migration_mle(struct dlm_ctxt *dlm,
*oldmle = NULL; *oldmle = NULL;
mlog_entry_void();
assert_spin_locked(&dlm->spinlock); assert_spin_locked(&dlm->spinlock);
assert_spin_locked(&dlm->master_lock); assert_spin_locked(&dlm->master_lock);
...@@ -3261,7 +3257,7 @@ void dlm_clean_master_list(struct dlm_ctxt *dlm, u8 dead_node) ...@@ -3261,7 +3257,7 @@ void dlm_clean_master_list(struct dlm_ctxt *dlm, u8 dead_node)
struct hlist_node *list; struct hlist_node *list;
unsigned int i; unsigned int i;
mlog_entry("dlm=%s, dead node=%u\n", dlm->name, dead_node); mlog(0, "dlm=%s, dead node=%u\n", dlm->name, dead_node);
top: top:
assert_spin_locked(&dlm->spinlock); assert_spin_locked(&dlm->spinlock);
......
...@@ -727,7 +727,6 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node) ...@@ -727,7 +727,6 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node)
if (destroy) if (destroy)
dlm_destroy_recovery_area(dlm, dead_node); dlm_destroy_recovery_area(dlm, dead_node);
mlog_exit(status);
return status; return status;
} }
...@@ -1496,9 +1495,9 @@ int dlm_mig_lockres_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -1496,9 +1495,9 @@ int dlm_mig_lockres_handler(struct o2net_msg *msg, u32 len, void *data,
kfree(buf); kfree(buf);
if (item) if (item)
kfree(item); kfree(item);
mlog_errno(ret);
} }
mlog_exit(ret);
return ret; return ret;
} }
...@@ -1567,7 +1566,6 @@ static void dlm_mig_lockres_worker(struct dlm_work_item *item, void *data) ...@@ -1567,7 +1566,6 @@ static void dlm_mig_lockres_worker(struct dlm_work_item *item, void *data)
dlm_lockres_put(res); dlm_lockres_put(res);
} }
kfree(data); kfree(data);
mlog_exit(ret);
} }
...@@ -1986,7 +1984,6 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, ...@@ -1986,7 +1984,6 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
dlm_lock_put(newlock); dlm_lock_put(newlock);
} }
mlog_exit(ret);
return ret; return ret;
} }
...@@ -2083,8 +2080,6 @@ static void dlm_finish_local_lockres_recovery(struct dlm_ctxt *dlm, ...@@ -2083,8 +2080,6 @@ static void dlm_finish_local_lockres_recovery(struct dlm_ctxt *dlm,
struct hlist_head *bucket; struct hlist_head *bucket;
struct dlm_lock_resource *res, *next; struct dlm_lock_resource *res, *next;
mlog_entry_void();
assert_spin_locked(&dlm->spinlock); assert_spin_locked(&dlm->spinlock);
list_for_each_entry_safe(res, next, &dlm->reco.resources, recovering) { list_for_each_entry_safe(res, next, &dlm->reco.resources, recovering) {
...@@ -2607,8 +2602,6 @@ static int dlm_send_begin_reco_message(struct dlm_ctxt *dlm, u8 dead_node) ...@@ -2607,8 +2602,6 @@ static int dlm_send_begin_reco_message(struct dlm_ctxt *dlm, u8 dead_node)
int nodenum; int nodenum;
int status; int status;
mlog_entry("%u\n", dead_node);
mlog(0, "%s: dead node is %u\n", dlm->name, dead_node); mlog(0, "%s: dead node is %u\n", dlm->name, dead_node);
spin_lock(&dlm->spinlock); spin_lock(&dlm->spinlock);
......
...@@ -317,7 +317,7 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm, ...@@ -317,7 +317,7 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm,
struct kvec vec[2]; struct kvec vec[2];
size_t veclen = 1; size_t veclen = 1;
mlog_entry("%.*s\n", res->lockname.len, res->lockname.name); mlog(0, "%.*s\n", res->lockname.len, res->lockname.name);
if (owner == dlm->node_num) { if (owner == dlm->node_num) {
/* ended up trying to contact ourself. this means /* ended up trying to contact ourself. this means
...@@ -588,8 +588,6 @@ enum dlm_status dlmunlock(struct dlm_ctxt *dlm, struct dlm_lockstatus *lksb, ...@@ -588,8 +588,6 @@ enum dlm_status dlmunlock(struct dlm_ctxt *dlm, struct dlm_lockstatus *lksb,
struct dlm_lock *lock = NULL; struct dlm_lock *lock = NULL;
int call_ast, is_master; int call_ast, is_master;
mlog_entry_void();
if (!lksb) { if (!lksb) {
dlm_error(DLM_BADARGS); dlm_error(DLM_BADARGS);
return DLM_BADARGS; return DLM_BADARGS;
......
此差异已折叠。
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/types.h> #include <linux/types.h>
#define MLOG_MASK_PREFIX ML_EXPORT
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -40,6 +39,7 @@ ...@@ -40,6 +39,7 @@
#include "buffer_head_io.h" #include "buffer_head_io.h"
#include "suballoc.h" #include "suballoc.h"
#include "ocfs2_trace.h"
struct ocfs2_inode_handle struct ocfs2_inode_handle
{ {
...@@ -56,10 +56,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -56,10 +56,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
int status, set; int status, set;
struct dentry *result; struct dentry *result;
mlog_entry("(0x%p, 0x%p)\n", sb, handle); trace_ocfs2_get_dentry_begin(sb, handle, (unsigned long long)blkno);
if (blkno == 0) { if (blkno == 0) {
mlog(0, "nfs wants inode with blkno: 0\n");
result = ERR_PTR(-ESTALE); result = ERR_PTR(-ESTALE);
goto bail; goto bail;
} }
...@@ -83,6 +82,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -83,6 +82,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
} }
status = ocfs2_test_inode_bit(osb, blkno, &set); status = ocfs2_test_inode_bit(osb, blkno, &set);
trace_ocfs2_get_dentry_test_bit(status, set);
if (status < 0) { if (status < 0) {
if (status == -EINVAL) { if (status == -EINVAL) {
/* /*
...@@ -90,18 +90,14 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -90,18 +90,14 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
* as an inode, we return -ESTALE to be * as an inode, we return -ESTALE to be
* nice * nice
*/ */
mlog(0, "test inode bit failed %d\n", status);
status = -ESTALE; status = -ESTALE;
} else { } else
mlog(ML_ERROR, "test inode bit failed %d\n", status); mlog(ML_ERROR, "test inode bit failed %d\n", status);
}
goto unlock_nfs_sync; goto unlock_nfs_sync;
} }
/* If the inode allocator bit is clear, this inode must be stale */ /* If the inode allocator bit is clear, this inode must be stale */
if (!set) { if (!set) {
mlog(0, "inode %llu suballoc bit is clear\n",
(unsigned long long)blkno);
status = -ESTALE; status = -ESTALE;
goto unlock_nfs_sync; goto unlock_nfs_sync;
} }
...@@ -114,8 +110,8 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -114,8 +110,8 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
check_err: check_err:
if (status < 0) { if (status < 0) {
if (status == -ESTALE) { if (status == -ESTALE) {
mlog(0, "stale inode ino: %llu generation: %u\n", trace_ocfs2_get_dentry_stale((unsigned long long)blkno,
(unsigned long long)blkno, handle->ih_generation); handle->ih_generation);
} }
result = ERR_PTR(status); result = ERR_PTR(status);
goto bail; goto bail;
...@@ -130,8 +126,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -130,8 +126,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
check_gen: check_gen:
if (handle->ih_generation != inode->i_generation) { if (handle->ih_generation != inode->i_generation) {
iput(inode); iput(inode);
mlog(0, "stale inode ino: %llu generation: %u\n", trace_ocfs2_get_dentry_generation((unsigned long long)blkno,
(unsigned long long)blkno, handle->ih_generation); handle->ih_generation,
inode->i_generation);
result = ERR_PTR(-ESTALE); result = ERR_PTR(-ESTALE);
goto bail; goto bail;
} }
...@@ -141,7 +138,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -141,7 +138,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
mlog_errno(PTR_ERR(result)); mlog_errno(PTR_ERR(result));
bail: bail:
mlog_exit_ptr(result); trace_ocfs2_get_dentry_end(result);
return result; return result;
} }
...@@ -152,11 +149,8 @@ static struct dentry *ocfs2_get_parent(struct dentry *child) ...@@ -152,11 +149,8 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
struct dentry *parent; struct dentry *parent;
struct inode *dir = child->d_inode; struct inode *dir = child->d_inode;
mlog_entry("(0x%p, '%.*s')\n", child, trace_ocfs2_get_parent(child, child->d_name.len, child->d_name.name,
child->d_name.len, child->d_name.name); (unsigned long long)OCFS2_I(dir)->ip_blkno);
mlog(0, "find parent of directory %llu\n",
(unsigned long long)OCFS2_I(dir)->ip_blkno);
status = ocfs2_inode_lock(dir, NULL, 0); status = ocfs2_inode_lock(dir, NULL, 0);
if (status < 0) { if (status < 0) {
...@@ -178,7 +172,7 @@ static struct dentry *ocfs2_get_parent(struct dentry *child) ...@@ -178,7 +172,7 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
ocfs2_inode_unlock(dir, 0); ocfs2_inode_unlock(dir, 0);
bail: bail:
mlog_exit_ptr(parent); trace_ocfs2_get_parent_end(parent);
return parent; return parent;
} }
...@@ -193,9 +187,9 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len, ...@@ -193,9 +187,9 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
u32 generation; u32 generation;
__le32 *fh = (__force __le32 *) fh_in; __le32 *fh = (__force __le32 *) fh_in;
mlog_entry("(0x%p, '%.*s', 0x%p, %d, %d)\n", dentry, trace_ocfs2_encode_fh_begin(dentry, dentry->d_name.len,
dentry->d_name.len, dentry->d_name.name, dentry->d_name.name,
fh, len, connectable); fh, len, connectable);
if (connectable && (len < 6)) { if (connectable && (len < 6)) {
*max_len = 6; *max_len = 6;
...@@ -210,8 +204,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len, ...@@ -210,8 +204,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
blkno = OCFS2_I(inode)->ip_blkno; blkno = OCFS2_I(inode)->ip_blkno;
generation = inode->i_generation; generation = inode->i_generation;
mlog(0, "Encoding fh: blkno: %llu, generation: %u\n", trace_ocfs2_encode_fh_self((unsigned long long)blkno, generation);
(unsigned long long)blkno, generation);
len = 3; len = 3;
fh[0] = cpu_to_le32((u32)(blkno >> 32)); fh[0] = cpu_to_le32((u32)(blkno >> 32));
...@@ -236,14 +229,14 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len, ...@@ -236,14 +229,14 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
len = 6; len = 6;
type = 2; type = 2;
mlog(0, "Encoding parent: blkno: %llu, generation: %u\n", trace_ocfs2_encode_fh_parent((unsigned long long)blkno,
(unsigned long long)blkno, generation); generation);
} }
*max_len = len; *max_len = len;
bail: bail:
mlog_exit(type); trace_ocfs2_encode_fh_type(type);
return type; return type;
} }
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/fiemap.h> #include <linux/fiemap.h>
#define MLOG_MASK_PREFIX ML_EXTENT_MAP
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -39,6 +38,7 @@ ...@@ -39,6 +38,7 @@
#include "inode.h" #include "inode.h"
#include "super.h" #include "super.h"
#include "symlink.h" #include "symlink.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
...@@ -841,10 +841,9 @@ int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr, ...@@ -841,10 +841,9 @@ int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr,
u64 p_block, p_count; u64 p_block, p_count;
int i, count, done = 0; int i, count, done = 0;
mlog_entry("(inode = %p, v_block = %llu, nr = %d, bhs = %p, " trace_ocfs2_read_virt_blocks(
"flags = %x, validate = %p)\n", inode, (unsigned long long)v_block, nr, bhs, flags,
inode, (unsigned long long)v_block, nr, bhs, flags, validate);
validate);
if (((v_block + nr - 1) << inode->i_sb->s_blocksize_bits) >= if (((v_block + nr - 1) << inode->i_sb->s_blocksize_bits) >=
i_size_read(inode)) { i_size_read(inode)) {
...@@ -897,7 +896,6 @@ int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr, ...@@ -897,7 +896,6 @@ int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr,
} }
out: out:
mlog_exit(rc);
return rc; return rc;
} }
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <linux/quotaops.h> #include <linux/quotaops.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#define MLOG_MASK_PREFIX ML_INODE
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -61,6 +60,7 @@ ...@@ -61,6 +60,7 @@
#include "acl.h" #include "acl.h"
#include "quota.h" #include "quota.h"
#include "refcounttree.h" #include "refcounttree.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
...@@ -99,8 +99,10 @@ static int ocfs2_file_open(struct inode *inode, struct file *file) ...@@ -99,8 +99,10 @@ static int ocfs2_file_open(struct inode *inode, struct file *file)
int mode = file->f_flags; int mode = file->f_flags;
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
mlog_entry("(0x%p, 0x%p, '%.*s')\n", inode, file, trace_ocfs2_file_open(inode, file, file->f_path.dentry,
file->f_path.dentry->d_name.len, file->f_path.dentry->d_name.name); (unsigned long long)OCFS2_I(inode)->ip_blkno,
file->f_path.dentry->d_name.len,
file->f_path.dentry->d_name.name, mode);
if (file->f_mode & FMODE_WRITE) if (file->f_mode & FMODE_WRITE)
dquot_initialize(inode); dquot_initialize(inode);
...@@ -135,7 +137,6 @@ static int ocfs2_file_open(struct inode *inode, struct file *file) ...@@ -135,7 +137,6 @@ static int ocfs2_file_open(struct inode *inode, struct file *file)
} }
leave: leave:
mlog_exit(status);
return status; return status;
} }
...@@ -143,19 +144,19 @@ static int ocfs2_file_release(struct inode *inode, struct file *file) ...@@ -143,19 +144,19 @@ static int ocfs2_file_release(struct inode *inode, struct file *file)
{ {
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
mlog_entry("(0x%p, 0x%p, '%.*s')\n", inode, file,
file->f_path.dentry->d_name.len,
file->f_path.dentry->d_name.name);
spin_lock(&oi->ip_lock); spin_lock(&oi->ip_lock);
if (!--oi->ip_open_count) if (!--oi->ip_open_count)
oi->ip_flags &= ~OCFS2_INODE_OPEN_DIRECT; oi->ip_flags &= ~OCFS2_INODE_OPEN_DIRECT;
trace_ocfs2_file_release(inode, file, file->f_path.dentry,
oi->ip_blkno,
file->f_path.dentry->d_name.len,
file->f_path.dentry->d_name.name,
oi->ip_open_count);
spin_unlock(&oi->ip_lock); spin_unlock(&oi->ip_lock);
ocfs2_free_file_private(inode, file); ocfs2_free_file_private(inode, file);
mlog_exit(0);
return 0; return 0;
} }
...@@ -177,9 +178,11 @@ static int ocfs2_sync_file(struct file *file, int datasync) ...@@ -177,9 +178,11 @@ static int ocfs2_sync_file(struct file *file, int datasync)
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
mlog_entry("(0x%p, %d, 0x%p, '%.*s')\n", file, datasync, trace_ocfs2_sync_file(inode, file, file->f_path.dentry,
file->f_path.dentry, file->f_path.dentry->d_name.len, OCFS2_I(inode)->ip_blkno,
file->f_path.dentry->d_name.name); file->f_path.dentry->d_name.len,
file->f_path.dentry->d_name.name,
(unsigned long long)datasync);
if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) { if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) {
/* /*
...@@ -195,7 +198,8 @@ static int ocfs2_sync_file(struct file *file, int datasync) ...@@ -195,7 +198,8 @@ static int ocfs2_sync_file(struct file *file, int datasync)
err = jbd2_journal_force_commit(journal); err = jbd2_journal_force_commit(journal);
bail: bail:
mlog_exit(err); if (err)
mlog_errno(err);
return (err < 0) ? -EIO : 0; return (err < 0) ? -EIO : 0;
} }
...@@ -251,8 +255,6 @@ int ocfs2_update_inode_atime(struct inode *inode, ...@@ -251,8 +255,6 @@ int ocfs2_update_inode_atime(struct inode *inode,
handle_t *handle; handle_t *handle;
struct ocfs2_dinode *di = (struct ocfs2_dinode *) bh->b_data; struct ocfs2_dinode *di = (struct ocfs2_dinode *) bh->b_data;
mlog_entry_void();
handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
if (IS_ERR(handle)) { if (IS_ERR(handle)) {
ret = PTR_ERR(handle); ret = PTR_ERR(handle);
...@@ -280,7 +282,6 @@ int ocfs2_update_inode_atime(struct inode *inode, ...@@ -280,7 +282,6 @@ int ocfs2_update_inode_atime(struct inode *inode,
out_commit: out_commit:
ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
out: out:
mlog_exit(ret);
return ret; return ret;
} }
...@@ -291,7 +292,6 @@ static int ocfs2_set_inode_size(handle_t *handle, ...@@ -291,7 +292,6 @@ static int ocfs2_set_inode_size(handle_t *handle,
{ {
int status; int status;
mlog_entry_void();
i_size_write(inode, new_i_size); i_size_write(inode, new_i_size);
inode->i_blocks = ocfs2_inode_sector_count(inode); inode->i_blocks = ocfs2_inode_sector_count(inode);
inode->i_ctime = inode->i_mtime = CURRENT_TIME; inode->i_ctime = inode->i_mtime = CURRENT_TIME;
...@@ -303,7 +303,6 @@ static int ocfs2_set_inode_size(handle_t *handle, ...@@ -303,7 +303,6 @@ static int ocfs2_set_inode_size(handle_t *handle,
} }
bail: bail:
mlog_exit(status);
return status; return status;
} }
...@@ -375,8 +374,6 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, ...@@ -375,8 +374,6 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb,
struct ocfs2_dinode *di; struct ocfs2_dinode *di;
u64 cluster_bytes; u64 cluster_bytes;
mlog_entry_void();
/* /*
* We need to CoW the cluster contains the offset if it is reflinked * We need to CoW the cluster contains the offset if it is reflinked
* since we will call ocfs2_zero_range_for_truncate later which will * since we will call ocfs2_zero_range_for_truncate later which will
...@@ -429,8 +426,6 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, ...@@ -429,8 +426,6 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb,
out_commit: out_commit:
ocfs2_commit_trans(osb, handle); ocfs2_commit_trans(osb, handle);
out: out:
mlog_exit(status);
return status; return status;
} }
...@@ -442,14 +437,14 @@ static int ocfs2_truncate_file(struct inode *inode, ...@@ -442,14 +437,14 @@ static int ocfs2_truncate_file(struct inode *inode,
struct ocfs2_dinode *fe = NULL; struct ocfs2_dinode *fe = NULL;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
mlog_entry("(inode = %llu, new_i_size = %llu\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)new_i_size);
/* We trust di_bh because it comes from ocfs2_inode_lock(), which /* We trust di_bh because it comes from ocfs2_inode_lock(), which
* already validated it */ * already validated it */
fe = (struct ocfs2_dinode *) di_bh->b_data; fe = (struct ocfs2_dinode *) di_bh->b_data;
trace_ocfs2_truncate_file((unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)le64_to_cpu(fe->i_size),
(unsigned long long)new_i_size);
mlog_bug_on_msg(le64_to_cpu(fe->i_size) != i_size_read(inode), mlog_bug_on_msg(le64_to_cpu(fe->i_size) != i_size_read(inode),
"Inode %llu, inode i_size = %lld != di " "Inode %llu, inode i_size = %lld != di "
"i_size = %llu, i_flags = 0x%x\n", "i_size = %llu, i_flags = 0x%x\n",
...@@ -459,19 +454,14 @@ static int ocfs2_truncate_file(struct inode *inode, ...@@ -459,19 +454,14 @@ static int ocfs2_truncate_file(struct inode *inode,
le32_to_cpu(fe->i_flags)); le32_to_cpu(fe->i_flags));
if (new_i_size > le64_to_cpu(fe->i_size)) { if (new_i_size > le64_to_cpu(fe->i_size)) {
mlog(0, "asked to truncate file with size (%llu) to size (%llu)!\n", trace_ocfs2_truncate_file_error(
(unsigned long long)le64_to_cpu(fe->i_size), (unsigned long long)le64_to_cpu(fe->i_size),
(unsigned long long)new_i_size); (unsigned long long)new_i_size);
status = -EINVAL; status = -EINVAL;
mlog_errno(status); mlog_errno(status);
goto bail; goto bail;
} }
mlog(0, "inode %llu, i_size = %llu, new_i_size = %llu\n",
(unsigned long long)le64_to_cpu(fe->i_blkno),
(unsigned long long)le64_to_cpu(fe->i_size),
(unsigned long long)new_i_size);
/* lets handle the simple truncate cases before doing any more /* lets handle the simple truncate cases before doing any more
* cluster locking. */ * cluster locking. */
if (new_i_size == le64_to_cpu(fe->i_size)) if (new_i_size == le64_to_cpu(fe->i_size))
...@@ -525,7 +515,6 @@ static int ocfs2_truncate_file(struct inode *inode, ...@@ -525,7 +515,6 @@ static int ocfs2_truncate_file(struct inode *inode,
if (!status && OCFS2_I(inode)->ip_clusters == 0) if (!status && OCFS2_I(inode)->ip_clusters == 0)
status = ocfs2_try_remove_refcount_tree(inode, di_bh); status = ocfs2_try_remove_refcount_tree(inode, di_bh);
mlog_exit(status);
return status; return status;
} }
...@@ -578,8 +567,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, ...@@ -578,8 +567,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
struct ocfs2_extent_tree et; struct ocfs2_extent_tree et;
int did_quota = 0; int did_quota = 0;
mlog_entry("(clusters_to_add = %u)\n", clusters_to_add);
/* /*
* This function only exists for file systems which don't * This function only exists for file systems which don't
* support holes. * support holes.
...@@ -596,11 +583,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, ...@@ -596,11 +583,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
restart_all: restart_all:
BUG_ON(le32_to_cpu(fe->i_clusters) != OCFS2_I(inode)->ip_clusters); BUG_ON(le32_to_cpu(fe->i_clusters) != OCFS2_I(inode)->ip_clusters);
mlog(0, "extend inode %llu, i_size = %lld, di->i_clusters = %u, "
"clusters_to_add = %u\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno,
(long long)i_size_read(inode), le32_to_cpu(fe->i_clusters),
clusters_to_add);
ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), bh); ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), bh);
status = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0, status = ocfs2_lock_allocators(inode, &et, clusters_to_add, 0,
&data_ac, &meta_ac); &data_ac, &meta_ac);
...@@ -620,6 +602,12 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, ...@@ -620,6 +602,12 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
} }
restarted_transaction: restarted_transaction:
trace_ocfs2_extend_allocation(
(unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)i_size_read(inode),
le32_to_cpu(fe->i_clusters), clusters_to_add,
why, restart_func);
status = dquot_alloc_space_nodirty(inode, status = dquot_alloc_space_nodirty(inode,
ocfs2_clusters_to_bytes(osb->sb, clusters_to_add)); ocfs2_clusters_to_bytes(osb->sb, clusters_to_add));
if (status) if (status)
...@@ -666,13 +654,11 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, ...@@ -666,13 +654,11 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
if (why != RESTART_NONE && clusters_to_add) { if (why != RESTART_NONE && clusters_to_add) {
if (why == RESTART_META) { if (why == RESTART_META) {
mlog(0, "restarting function.\n");
restart_func = 1; restart_func = 1;
status = 0; status = 0;
} else { } else {
BUG_ON(why != RESTART_TRANS); BUG_ON(why != RESTART_TRANS);
mlog(0, "restarting transaction.\n");
/* TODO: This can be more intelligent. */ /* TODO: This can be more intelligent. */
credits = ocfs2_calc_extend_credits(osb->sb, credits = ocfs2_calc_extend_credits(osb->sb,
&fe->id2.i_list, &fe->id2.i_list,
...@@ -689,11 +675,11 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, ...@@ -689,11 +675,11 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
} }
} }
mlog(0, "fe: i_clusters = %u, i_size=%llu\n", trace_ocfs2_extend_allocation_end(OCFS2_I(inode)->ip_blkno,
le32_to_cpu(fe->i_clusters), le32_to_cpu(fe->i_clusters),
(unsigned long long)le64_to_cpu(fe->i_size)); (unsigned long long)le64_to_cpu(fe->i_size),
mlog(0, "inode: ip_clusters=%u, i_size=%lld\n", OCFS2_I(inode)->ip_clusters,
OCFS2_I(inode)->ip_clusters, (long long)i_size_read(inode)); (unsigned long long)i_size_read(inode));
leave: leave:
if (status < 0 && did_quota) if (status < 0 && did_quota)
...@@ -718,7 +704,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, ...@@ -718,7 +704,6 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
brelse(bh); brelse(bh);
bh = NULL; bh = NULL;
mlog_exit(status);
return status; return status;
} }
...@@ -785,10 +770,11 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, ...@@ -785,10 +770,11 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from,
if (!zero_to) if (!zero_to)
zero_to = PAGE_CACHE_SIZE; zero_to = PAGE_CACHE_SIZE;
mlog(0, trace_ocfs2_write_zero_page(
"abs_from = %llu, abs_to = %llu, index = %lu, zero_from = %u, zero_to = %u\n", (unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)abs_from, (unsigned long long)abs_to, (unsigned long long)abs_from,
index, zero_from, zero_to); (unsigned long long)abs_to,
index, zero_from, zero_to);
/* We know that zero_from is block aligned */ /* We know that zero_from is block aligned */
for (block_start = zero_from; block_start < zero_to; for (block_start = zero_from; block_start < zero_to;
...@@ -928,9 +914,10 @@ static int ocfs2_zero_extend_range(struct inode *inode, u64 range_start, ...@@ -928,9 +914,10 @@ static int ocfs2_zero_extend_range(struct inode *inode, u64 range_start,
u64 next_pos; u64 next_pos;
u64 zero_pos = range_start; u64 zero_pos = range_start;
mlog(0, "range_start = %llu, range_end = %llu\n", trace_ocfs2_zero_extend_range(
(unsigned long long)range_start, (unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)range_end); (unsigned long long)range_start,
(unsigned long long)range_end);
BUG_ON(range_start >= range_end); BUG_ON(range_start >= range_end);
while (zero_pos < range_end) { while (zero_pos < range_end) {
...@@ -962,9 +949,9 @@ int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh, ...@@ -962,9 +949,9 @@ int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh,
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
zero_start = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode)); zero_start = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode));
mlog(0, "zero_start %llu for i_size %llu\n", trace_ocfs2_zero_extend((unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)zero_start, (unsigned long long)zero_start,
(unsigned long long)i_size_read(inode)); (unsigned long long)i_size_read(inode));
while (zero_start < zero_to_size) { while (zero_start < zero_to_size) {
ret = ocfs2_zero_extend_get_range(inode, di_bh, zero_start, ret = ocfs2_zero_extend_get_range(inode, di_bh, zero_start,
zero_to_size, zero_to_size,
...@@ -1113,30 +1100,20 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -1113,30 +1100,20 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
struct dquot *transfer_to[MAXQUOTAS] = { }; struct dquot *transfer_to[MAXQUOTAS] = { };
int qtype; int qtype;
mlog_entry("(0x%p, '%.*s')\n", dentry, trace_ocfs2_setattr(inode, dentry,
dentry->d_name.len, dentry->d_name.name); (unsigned long long)OCFS2_I(inode)->ip_blkno,
dentry->d_name.len, dentry->d_name.name,
attr->ia_valid, attr->ia_mode,
attr->ia_uid, attr->ia_gid);
/* ensuring we don't even attempt to truncate a symlink */ /* ensuring we don't even attempt to truncate a symlink */
if (S_ISLNK(inode->i_mode)) if (S_ISLNK(inode->i_mode))
attr->ia_valid &= ~ATTR_SIZE; attr->ia_valid &= ~ATTR_SIZE;
if (attr->ia_valid & ATTR_MODE)
mlog(0, "mode change: %d\n", attr->ia_mode);
if (attr->ia_valid & ATTR_UID)
mlog(0, "uid change: %d\n", attr->ia_uid);
if (attr->ia_valid & ATTR_GID)
mlog(0, "gid change: %d\n", attr->ia_gid);
if (attr->ia_valid & ATTR_SIZE)
mlog(0, "size change...\n");
if (attr->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME))
mlog(0, "time change...\n");
#define OCFS2_VALID_ATTRS (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_SIZE \ #define OCFS2_VALID_ATTRS (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_SIZE \
| ATTR_GID | ATTR_UID | ATTR_MODE) | ATTR_GID | ATTR_UID | ATTR_MODE)
if (!(attr->ia_valid & OCFS2_VALID_ATTRS)) { if (!(attr->ia_valid & OCFS2_VALID_ATTRS))
mlog(0, "can't handle attrs: 0x%x\n", attr->ia_valid);
return 0; return 0;
}
status = inode_change_ok(inode, attr); status = inode_change_ok(inode, attr);
if (status) if (status)
...@@ -1274,7 +1251,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -1274,7 +1251,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
mlog_errno(status); mlog_errno(status);
} }
mlog_exit(status);
return status; return status;
} }
...@@ -1287,8 +1263,6 @@ int ocfs2_getattr(struct vfsmount *mnt, ...@@ -1287,8 +1263,6 @@ int ocfs2_getattr(struct vfsmount *mnt,
struct ocfs2_super *osb = sb->s_fs_info; struct ocfs2_super *osb = sb->s_fs_info;
int err; int err;
mlog_entry_void();
err = ocfs2_inode_revalidate(dentry); err = ocfs2_inode_revalidate(dentry);
if (err) { if (err) {
if (err != -ENOENT) if (err != -ENOENT)
...@@ -1302,8 +1276,6 @@ int ocfs2_getattr(struct vfsmount *mnt, ...@@ -1302,8 +1276,6 @@ int ocfs2_getattr(struct vfsmount *mnt,
stat->blksize = osb->s_clustersize; stat->blksize = osb->s_clustersize;
bail: bail:
mlog_exit(err);
return err; return err;
} }
...@@ -1314,8 +1286,6 @@ int ocfs2_permission(struct inode *inode, int mask, unsigned int flags) ...@@ -1314,8 +1286,6 @@ int ocfs2_permission(struct inode *inode, int mask, unsigned int flags)
if (flags & IPERM_FLAG_RCU) if (flags & IPERM_FLAG_RCU)
return -ECHILD; return -ECHILD;
mlog_entry_void();
ret = ocfs2_inode_lock(inode, NULL, 0); ret = ocfs2_inode_lock(inode, NULL, 0);
if (ret) { if (ret) {
if (ret != -ENOENT) if (ret != -ENOENT)
...@@ -1327,7 +1297,6 @@ int ocfs2_permission(struct inode *inode, int mask, unsigned int flags) ...@@ -1327,7 +1297,6 @@ int ocfs2_permission(struct inode *inode, int mask, unsigned int flags)
ocfs2_inode_unlock(inode, 0); ocfs2_inode_unlock(inode, 0);
out: out:
mlog_exit(ret);
return ret; return ret;
} }
...@@ -1339,8 +1308,9 @@ static int __ocfs2_write_remove_suid(struct inode *inode, ...@@ -1339,8 +1308,9 @@ static int __ocfs2_write_remove_suid(struct inode *inode,
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_dinode *di; struct ocfs2_dinode *di;
mlog_entry("(Inode %llu, mode 0%o)\n", trace_ocfs2_write_remove_suid(
(unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_mode); (unsigned long long)OCFS2_I(inode)->ip_blkno,
inode->i_mode);
handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
if (IS_ERR(handle)) { if (IS_ERR(handle)) {
...@@ -1368,7 +1338,6 @@ static int __ocfs2_write_remove_suid(struct inode *inode, ...@@ -1368,7 +1338,6 @@ static int __ocfs2_write_remove_suid(struct inode *inode,
out_trans: out_trans:
ocfs2_commit_trans(osb, handle); ocfs2_commit_trans(osb, handle);
out: out:
mlog_exit(ret);
return ret; return ret;
} }
...@@ -1547,8 +1516,9 @@ static int ocfs2_zero_partial_clusters(struct inode *inode, ...@@ -1547,8 +1516,9 @@ static int ocfs2_zero_partial_clusters(struct inode *inode,
* partial clusters here. There's no need to worry about * partial clusters here. There's no need to worry about
* physical allocation - the zeroing code knows to skip holes. * physical allocation - the zeroing code knows to skip holes.
*/ */
mlog(0, "byte start: %llu, end: %llu\n", trace_ocfs2_zero_partial_clusters(
(unsigned long long)start, (unsigned long long)end); (unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)start, (unsigned long long)end);
/* /*
* If both edges are on a cluster boundary then there's no * If both edges are on a cluster boundary then there's no
...@@ -1572,8 +1542,8 @@ static int ocfs2_zero_partial_clusters(struct inode *inode, ...@@ -1572,8 +1542,8 @@ static int ocfs2_zero_partial_clusters(struct inode *inode,
if (tmpend > end) if (tmpend > end)
tmpend = end; tmpend = end;
mlog(0, "1st range: start: %llu, tmpend: %llu\n", trace_ocfs2_zero_partial_clusters_range1((unsigned long long)start,
(unsigned long long)start, (unsigned long long)tmpend); (unsigned long long)tmpend);
ret = ocfs2_zero_range_for_truncate(inode, handle, start, tmpend); ret = ocfs2_zero_range_for_truncate(inode, handle, start, tmpend);
if (ret) if (ret)
...@@ -1587,8 +1557,8 @@ static int ocfs2_zero_partial_clusters(struct inode *inode, ...@@ -1587,8 +1557,8 @@ static int ocfs2_zero_partial_clusters(struct inode *inode,
*/ */
start = end & ~(osb->s_clustersize - 1); start = end & ~(osb->s_clustersize - 1);
mlog(0, "2nd range: start: %llu, end: %llu\n", trace_ocfs2_zero_partial_clusters_range2(
(unsigned long long)start, (unsigned long long)end); (unsigned long long)start, (unsigned long long)end);
ret = ocfs2_zero_range_for_truncate(inode, handle, start, end); ret = ocfs2_zero_range_for_truncate(inode, handle, start, end);
if (ret) if (ret)
...@@ -1688,6 +1658,11 @@ static int ocfs2_remove_inode_range(struct inode *inode, ...@@ -1688,6 +1658,11 @@ static int ocfs2_remove_inode_range(struct inode *inode,
ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh); ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh);
ocfs2_init_dealloc_ctxt(&dealloc); ocfs2_init_dealloc_ctxt(&dealloc);
trace_ocfs2_remove_inode_range(
(unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)byte_start,
(unsigned long long)byte_len);
if (byte_len == 0) if (byte_len == 0)
return 0; return 0;
...@@ -1734,11 +1709,6 @@ static int ocfs2_remove_inode_range(struct inode *inode, ...@@ -1734,11 +1709,6 @@ static int ocfs2_remove_inode_range(struct inode *inode,
trunc_end = (byte_start + byte_len) >> osb->s_clustersize_bits; trunc_end = (byte_start + byte_len) >> osb->s_clustersize_bits;
cluster_in_el = trunc_end; cluster_in_el = trunc_end;
mlog(0, "Inode: %llu, start: %llu, len: %llu, cstart: %u, cend: %u\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)byte_start,
(unsigned long long)byte_len, trunc_start, trunc_end);
ret = ocfs2_zero_partial_clusters(inode, byte_start, byte_len); ret = ocfs2_zero_partial_clusters(inode, byte_start, byte_len);
if (ret) { if (ret) {
mlog_errno(ret); mlog_errno(ret);
...@@ -2093,7 +2063,7 @@ static int ocfs2_prepare_inode_for_write(struct file *file, ...@@ -2093,7 +2063,7 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
int ret = 0, meta_level = 0; int ret = 0, meta_level = 0;
struct dentry *dentry = file->f_path.dentry; struct dentry *dentry = file->f_path.dentry;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
loff_t saved_pos, end; loff_t saved_pos = 0, end;
/* /*
* We start with a read level meta lock and only jump to an ex * We start with a read level meta lock and only jump to an ex
...@@ -2132,12 +2102,10 @@ static int ocfs2_prepare_inode_for_write(struct file *file, ...@@ -2132,12 +2102,10 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
/* work on a copy of ppos until we're sure that we won't have /* work on a copy of ppos until we're sure that we won't have
* to recalculate it due to relocking. */ * to recalculate it due to relocking. */
if (appending) { if (appending)
saved_pos = i_size_read(inode); saved_pos = i_size_read(inode);
mlog(0, "O_APPEND: inode->i_size=%llu\n", saved_pos); else
} else {
saved_pos = *ppos; saved_pos = *ppos;
}
end = saved_pos + count; end = saved_pos + count;
...@@ -2208,6 +2176,10 @@ static int ocfs2_prepare_inode_for_write(struct file *file, ...@@ -2208,6 +2176,10 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
*ppos = saved_pos; *ppos = saved_pos;
out_unlock: out_unlock:
trace_ocfs2_prepare_inode_for_write(OCFS2_I(inode)->ip_blkno,
saved_pos, appending, count,
direct_io, has_refcount);
if (meta_level >= 0) if (meta_level >= 0)
ocfs2_inode_unlock(inode, meta_level); ocfs2_inode_unlock(inode, meta_level);
...@@ -2233,10 +2205,11 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, ...@@ -2233,10 +2205,11 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
int full_coherency = !(osb->s_mount_opt & int full_coherency = !(osb->s_mount_opt &
OCFS2_MOUNT_COHERENCY_BUFFERED); OCFS2_MOUNT_COHERENCY_BUFFERED);
mlog_entry("(0x%p, %u, '%.*s')\n", file, trace_ocfs2_file_aio_write(inode, file, file->f_path.dentry,
(unsigned int)nr_segs, (unsigned long long)OCFS2_I(inode)->ip_blkno,
file->f_path.dentry->d_name.len, file->f_path.dentry->d_name.len,
file->f_path.dentry->d_name.name); file->f_path.dentry->d_name.name,
(unsigned int)nr_segs);
if (iocb->ki_left == 0) if (iocb->ki_left == 0)
return 0; return 0;
...@@ -2402,7 +2375,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, ...@@ -2402,7 +2375,6 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
if (written) if (written)
ret = written; ret = written;
mlog_exit(ret);
return ret; return ret;
} }
...@@ -2438,10 +2410,11 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, ...@@ -2438,10 +2410,11 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe,
.u.file = out, .u.file = out,
}; };
mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", out, pipe,
(unsigned int)len, trace_ocfs2_file_splice_write(inode, out, out->f_path.dentry,
out->f_path.dentry->d_name.len, (unsigned long long)OCFS2_I(inode)->ip_blkno,
out->f_path.dentry->d_name.name); out->f_path.dentry->d_name.len,
out->f_path.dentry->d_name.name, len);
if (pipe->inode) if (pipe->inode)
mutex_lock_nested(&pipe->inode->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&pipe->inode->i_mutex, I_MUTEX_PARENT);
...@@ -2485,7 +2458,6 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, ...@@ -2485,7 +2458,6 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe,
balance_dirty_pages_ratelimited_nr(mapping, nr_pages); balance_dirty_pages_ratelimited_nr(mapping, nr_pages);
} }
mlog_exit(ret);
return ret; return ret;
} }
...@@ -2498,10 +2470,10 @@ static ssize_t ocfs2_file_splice_read(struct file *in, ...@@ -2498,10 +2470,10 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
int ret = 0, lock_level = 0; int ret = 0, lock_level = 0;
struct inode *inode = in->f_path.dentry->d_inode; struct inode *inode = in->f_path.dentry->d_inode;
mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", in, pipe, trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry,
(unsigned int)len, (unsigned long long)OCFS2_I(inode)->ip_blkno,
in->f_path.dentry->d_name.len, in->f_path.dentry->d_name.len,
in->f_path.dentry->d_name.name); in->f_path.dentry->d_name.name, len);
/* /*
* See the comment in ocfs2_file_aio_read() * See the comment in ocfs2_file_aio_read()
...@@ -2516,7 +2488,6 @@ static ssize_t ocfs2_file_splice_read(struct file *in, ...@@ -2516,7 +2488,6 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
ret = generic_file_splice_read(in, ppos, pipe, len, flags); ret = generic_file_splice_read(in, ppos, pipe, len, flags);
bail: bail:
mlog_exit(ret);
return ret; return ret;
} }
...@@ -2529,10 +2500,11 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, ...@@ -2529,10 +2500,11 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
struct file *filp = iocb->ki_filp; struct file *filp = iocb->ki_filp;
struct inode *inode = filp->f_path.dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
mlog_entry("(0x%p, %u, '%.*s')\n", filp, trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry,
(unsigned int)nr_segs, (unsigned long long)OCFS2_I(inode)->ip_blkno,
filp->f_path.dentry->d_name.len, filp->f_path.dentry->d_name.len,
filp->f_path.dentry->d_name.name); filp->f_path.dentry->d_name.name, nr_segs);
if (!inode) { if (!inode) {
ret = -EINVAL; ret = -EINVAL;
...@@ -2578,8 +2550,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, ...@@ -2578,8 +2550,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
ocfs2_inode_unlock(inode, lock_level); ocfs2_inode_unlock(inode, lock_level);
ret = generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos); ret = generic_file_aio_read(iocb, iov, nr_segs, iocb->ki_pos);
if (ret == -EINVAL) trace_generic_file_aio_read_ret(ret);
mlog(0, "generic_file_aio_read returned -EINVAL\n");
/* buffered aio wouldn't have proper lock coverage today */ /* buffered aio wouldn't have proper lock coverage today */
BUG_ON(ret == -EIOCBQUEUED && !(filp->f_flags & O_DIRECT)); BUG_ON(ret == -EIOCBQUEUED && !(filp->f_flags & O_DIRECT));
...@@ -2597,7 +2568,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, ...@@ -2597,7 +2568,6 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
} }
if (rw_level != -1) if (rw_level != -1)
ocfs2_rw_unlock(inode, rw_level); ocfs2_rw_unlock(inode, rw_level);
mlog_exit(ret);
return ret; return ret;
} }
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#define MLOG_MASK_PREFIX ML_SUPER
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -37,6 +36,7 @@ ...@@ -37,6 +36,7 @@
#include "heartbeat.h" #include "heartbeat.h"
#include "inode.h" #include "inode.h"
#include "journal.h" #include "journal.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
...@@ -66,7 +66,7 @@ void ocfs2_do_node_down(int node_num, void *data) ...@@ -66,7 +66,7 @@ void ocfs2_do_node_down(int node_num, void *data)
BUG_ON(osb->node_num == node_num); BUG_ON(osb->node_num == node_num);
mlog(0, "ocfs2: node down event for %d\n", node_num); trace_ocfs2_do_node_down(node_num);
if (!osb->cconn) { if (!osb->cconn) {
/* /*
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <asm/byteorder.h> #include <asm/byteorder.h>
#define MLOG_MASK_PREFIX ML_INODE
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -53,6 +52,7 @@ ...@@ -53,6 +52,7 @@
#include "uptodate.h" #include "uptodate.h"
#include "xattr.h" #include "xattr.h"
#include "refcounttree.h" #include "refcounttree.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
...@@ -131,7 +131,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, ...@@ -131,7 +131,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
struct super_block *sb = osb->sb; struct super_block *sb = osb->sb;
struct ocfs2_find_inode_args args; struct ocfs2_find_inode_args args;
mlog_entry("(blkno = %llu)\n", (unsigned long long)blkno); trace_ocfs2_iget_begin((unsigned long long)blkno, flags,
sysfile_type);
/* Ok. By now we've either got the offsets passed to us by the /* Ok. By now we've either got the offsets passed to us by the
* caller, or we just pulled them off the bh. Lets do some * caller, or we just pulled them off the bh. Lets do some
...@@ -152,16 +153,16 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, ...@@ -152,16 +153,16 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
/* inode was *not* in the inode cache. 2.6.x requires /* inode was *not* in the inode cache. 2.6.x requires
* us to do our own read_inode call and unlock it * us to do our own read_inode call and unlock it
* afterwards. */ * afterwards. */
if (inode && inode->i_state & I_NEW) {
mlog(0, "Inode was not in inode cache, reading it.\n");
ocfs2_read_locked_inode(inode, &args);
unlock_new_inode(inode);
}
if (inode == NULL) { if (inode == NULL) {
inode = ERR_PTR(-ENOMEM); inode = ERR_PTR(-ENOMEM);
mlog_errno(PTR_ERR(inode)); mlog_errno(PTR_ERR(inode));
goto bail; goto bail;
} }
trace_ocfs2_iget5_locked(inode->i_state);
if (inode->i_state & I_NEW) {
ocfs2_read_locked_inode(inode, &args);
unlock_new_inode(inode);
}
if (is_bad_inode(inode)) { if (is_bad_inode(inode)) {
iput(inode); iput(inode);
inode = ERR_PTR(-ESTALE); inode = ERR_PTR(-ESTALE);
...@@ -170,9 +171,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, ...@@ -170,9 +171,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
bail: bail:
if (!IS_ERR(inode)) { if (!IS_ERR(inode)) {
mlog(0, "returning inode with number %llu\n", trace_ocfs2_iget_end(inode,
(unsigned long long)OCFS2_I(inode)->ip_blkno); (unsigned long long)OCFS2_I(inode)->ip_blkno);
mlog_exit_ptr(inode);
} }
return inode; return inode;
...@@ -192,18 +192,17 @@ static int ocfs2_find_actor(struct inode *inode, void *opaque) ...@@ -192,18 +192,17 @@ static int ocfs2_find_actor(struct inode *inode, void *opaque)
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
int ret = 0; int ret = 0;
mlog_entry("(0x%p, %lu, 0x%p)\n", inode, inode->i_ino, opaque);
args = opaque; args = opaque;
mlog_bug_on_msg(!inode, "No inode in find actor!\n"); mlog_bug_on_msg(!inode, "No inode in find actor!\n");
trace_ocfs2_find_actor(inode, inode->i_ino, opaque, args->fi_blkno);
if (oi->ip_blkno != args->fi_blkno) if (oi->ip_blkno != args->fi_blkno)
goto bail; goto bail;
ret = 1; ret = 1;
bail: bail:
mlog_exit(ret);
return ret; return ret;
} }
...@@ -218,8 +217,6 @@ static int ocfs2_init_locked_inode(struct inode *inode, void *opaque) ...@@ -218,8 +217,6 @@ static int ocfs2_init_locked_inode(struct inode *inode, void *opaque)
static struct lock_class_key ocfs2_quota_ip_alloc_sem_key, static struct lock_class_key ocfs2_quota_ip_alloc_sem_key,
ocfs2_file_ip_alloc_sem_key; ocfs2_file_ip_alloc_sem_key;
mlog_entry("inode = %p, opaque = %p\n", inode, opaque);
inode->i_ino = args->fi_ino; inode->i_ino = args->fi_ino;
OCFS2_I(inode)->ip_blkno = args->fi_blkno; OCFS2_I(inode)->ip_blkno = args->fi_blkno;
if (args->fi_sysfile_type != 0) if (args->fi_sysfile_type != 0)
...@@ -235,7 +232,6 @@ static int ocfs2_init_locked_inode(struct inode *inode, void *opaque) ...@@ -235,7 +232,6 @@ static int ocfs2_init_locked_inode(struct inode *inode, void *opaque)
lockdep_set_class(&OCFS2_I(inode)->ip_alloc_sem, lockdep_set_class(&OCFS2_I(inode)->ip_alloc_sem,
&ocfs2_file_ip_alloc_sem_key); &ocfs2_file_ip_alloc_sem_key);
mlog_exit(0);
return 0; return 0;
} }
...@@ -246,9 +242,6 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, ...@@ -246,9 +242,6 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
struct ocfs2_super *osb; struct ocfs2_super *osb;
int use_plocks = 1; int use_plocks = 1;
mlog_entry("(0x%p, size:%llu)\n", inode,
(unsigned long long)le64_to_cpu(fe->i_size));
sb = inode->i_sb; sb = inode->i_sb;
osb = OCFS2_SB(sb); osb = OCFS2_SB(sb);
...@@ -300,20 +293,20 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, ...@@ -300,20 +293,20 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
inode->i_nlink = ocfs2_read_links_count(fe); inode->i_nlink = ocfs2_read_links_count(fe);
trace_ocfs2_populate_inode(OCFS2_I(inode)->ip_blkno,
le32_to_cpu(fe->i_flags));
if (fe->i_flags & cpu_to_le32(OCFS2_SYSTEM_FL)) { if (fe->i_flags & cpu_to_le32(OCFS2_SYSTEM_FL)) {
OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SYSTEM_FILE; OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SYSTEM_FILE;
inode->i_flags |= S_NOQUOTA; inode->i_flags |= S_NOQUOTA;
} }
if (fe->i_flags & cpu_to_le32(OCFS2_LOCAL_ALLOC_FL)) { if (fe->i_flags & cpu_to_le32(OCFS2_LOCAL_ALLOC_FL)) {
OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP; OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP;
mlog(0, "local alloc inode: i_ino=%lu\n", inode->i_ino);
} else if (fe->i_flags & cpu_to_le32(OCFS2_BITMAP_FL)) { } else if (fe->i_flags & cpu_to_le32(OCFS2_BITMAP_FL)) {
OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP; OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP;
} else if (fe->i_flags & cpu_to_le32(OCFS2_QUOTA_FL)) { } else if (fe->i_flags & cpu_to_le32(OCFS2_QUOTA_FL)) {
inode->i_flags |= S_NOQUOTA; inode->i_flags |= S_NOQUOTA;
} else if (fe->i_flags & cpu_to_le32(OCFS2_SUPER_BLOCK_FL)) { } else if (fe->i_flags & cpu_to_le32(OCFS2_SUPER_BLOCK_FL)) {
mlog(0, "superblock inode: i_ino=%lu\n", inode->i_ino);
/* we can't actually hit this as read_inode can't /* we can't actually hit this as read_inode can't
* handle superblocks today ;-) */ * handle superblocks today ;-) */
BUG(); BUG();
...@@ -381,7 +374,6 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, ...@@ -381,7 +374,6 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
if (S_ISDIR(inode->i_mode)) if (S_ISDIR(inode->i_mode))
ocfs2_resv_set_type(&OCFS2_I(inode)->ip_la_data_resv, ocfs2_resv_set_type(&OCFS2_I(inode)->ip_la_data_resv,
OCFS2_RESV_FLAG_DIR); OCFS2_RESV_FLAG_DIR);
mlog_exit_void();
} }
static int ocfs2_read_locked_inode(struct inode *inode, static int ocfs2_read_locked_inode(struct inode *inode,
...@@ -394,8 +386,6 @@ static int ocfs2_read_locked_inode(struct inode *inode, ...@@ -394,8 +386,6 @@ static int ocfs2_read_locked_inode(struct inode *inode,
int status, can_lock; int status, can_lock;
u32 generation = 0; u32 generation = 0;
mlog_entry("(0x%p, 0x%p)\n", inode, args);
status = -EINVAL; status = -EINVAL;
if (inode == NULL || inode->i_sb == NULL) { if (inode == NULL || inode->i_sb == NULL) {
mlog(ML_ERROR, "bad inode\n"); mlog(ML_ERROR, "bad inode\n");
...@@ -443,6 +433,9 @@ static int ocfs2_read_locked_inode(struct inode *inode, ...@@ -443,6 +433,9 @@ static int ocfs2_read_locked_inode(struct inode *inode,
&& !(args->fi_flags & OCFS2_FI_FLAG_ORPHAN_RECOVERY) && !(args->fi_flags & OCFS2_FI_FLAG_ORPHAN_RECOVERY)
&& !ocfs2_mount_local(osb); && !ocfs2_mount_local(osb);
trace_ocfs2_read_locked_inode(
(unsigned long long)OCFS2_I(inode)->ip_blkno, can_lock);
/* /*
* To maintain backwards compatibility with older versions of * To maintain backwards compatibility with older versions of
* ocfs2-tools, we still store the generation value for system * ocfs2-tools, we still store the generation value for system
...@@ -534,7 +527,6 @@ static int ocfs2_read_locked_inode(struct inode *inode, ...@@ -534,7 +527,6 @@ static int ocfs2_read_locked_inode(struct inode *inode,
if (args && bh) if (args && bh)
brelse(bh); brelse(bh);
mlog_exit(status);
return status; return status;
} }
...@@ -551,8 +543,6 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb, ...@@ -551,8 +543,6 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb,
struct ocfs2_dinode *fe; struct ocfs2_dinode *fe;
handle_t *handle = NULL; handle_t *handle = NULL;
mlog_entry_void();
fe = (struct ocfs2_dinode *) fe_bh->b_data; fe = (struct ocfs2_dinode *) fe_bh->b_data;
/* /*
...@@ -600,7 +590,6 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb, ...@@ -600,7 +590,6 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb,
out: out:
if (handle) if (handle)
ocfs2_commit_trans(osb, handle); ocfs2_commit_trans(osb, handle);
mlog_exit(status);
return status; return status;
} }
...@@ -696,8 +685,6 @@ static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb, ...@@ -696,8 +685,6 @@ static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb,
spin_lock(&osb->osb_lock); spin_lock(&osb->osb_lock);
if (ocfs2_node_map_test_bit(osb, &osb->osb_recovering_orphan_dirs, slot)) { if (ocfs2_node_map_test_bit(osb, &osb->osb_recovering_orphan_dirs, slot)) {
mlog(0, "Recovery is happening on orphan dir %d, will skip "
"this inode\n", slot);
ret = -EDEADLK; ret = -EDEADLK;
goto out; goto out;
} }
...@@ -706,6 +693,7 @@ static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb, ...@@ -706,6 +693,7 @@ static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb,
osb->osb_orphan_wipes[slot]++; osb->osb_orphan_wipes[slot]++;
out: out:
spin_unlock(&osb->osb_lock); spin_unlock(&osb->osb_lock);
trace_ocfs2_check_orphan_recovery_state(slot, ret);
return ret; return ret;
} }
...@@ -816,6 +804,10 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode) ...@@ -816,6 +804,10 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode)
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
trace_ocfs2_inode_is_valid_to_delete(current, osb->dc_task,
(unsigned long long)oi->ip_blkno,
oi->ip_flags);
/* We shouldn't be getting here for the root directory /* We shouldn't be getting here for the root directory
* inode.. */ * inode.. */
if (inode == osb->root_inode) { if (inode == osb->root_inode) {
...@@ -828,11 +820,8 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode) ...@@ -828,11 +820,8 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode)
* have to skip deleting this guy. That's OK though because * have to skip deleting this guy. That's OK though because
* the node who's doing the actual deleting should handle it * the node who's doing the actual deleting should handle it
* anyway. */ * anyway. */
if (current == osb->dc_task) { if (current == osb->dc_task)
mlog(0, "Skipping delete of %lu because we're currently "
"in downconvert\n", inode->i_ino);
goto bail; goto bail;
}
spin_lock(&oi->ip_lock); spin_lock(&oi->ip_lock);
/* OCFS2 *never* deletes system files. This should technically /* OCFS2 *never* deletes system files. This should technically
...@@ -847,11 +836,8 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode) ...@@ -847,11 +836,8 @@ static int ocfs2_inode_is_valid_to_delete(struct inode *inode)
/* If we have allowd wipe of this inode for another node, it /* If we have allowd wipe of this inode for another node, it
* will be marked here so we can safely skip it. Recovery will * will be marked here so we can safely skip it. Recovery will
* cleanup any inodes we might inadvertantly skip here. */ * cleanup any inodes we might inadvertantly skip here. */
if (oi->ip_flags & OCFS2_INODE_SKIP_DELETE) { if (oi->ip_flags & OCFS2_INODE_SKIP_DELETE)
mlog(0, "Skipping delete of %lu because another node "
"has done this for us.\n", inode->i_ino);
goto bail_unlock; goto bail_unlock;
}
ret = 1; ret = 1;
bail_unlock: bail_unlock:
...@@ -868,28 +854,27 @@ static int ocfs2_query_inode_wipe(struct inode *inode, ...@@ -868,28 +854,27 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
struct buffer_head *di_bh, struct buffer_head *di_bh,
int *wipe) int *wipe)
{ {
int status = 0; int status = 0, reason = 0;
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_dinode *di; struct ocfs2_dinode *di;
*wipe = 0; *wipe = 0;
trace_ocfs2_query_inode_wipe_begin((unsigned long long)oi->ip_blkno,
inode->i_nlink);
/* While we were waiting for the cluster lock in /* While we were waiting for the cluster lock in
* ocfs2_delete_inode, another node might have asked to delete * ocfs2_delete_inode, another node might have asked to delete
* the inode. Recheck our flags to catch this. */ * the inode. Recheck our flags to catch this. */
if (!ocfs2_inode_is_valid_to_delete(inode)) { if (!ocfs2_inode_is_valid_to_delete(inode)) {
mlog(0, "Skipping delete of %llu because flags changed\n", reason = 1;
(unsigned long long)oi->ip_blkno);
goto bail; goto bail;
} }
/* Now that we have an up to date inode, we can double check /* Now that we have an up to date inode, we can double check
* the link count. */ * the link count. */
if (inode->i_nlink) { if (inode->i_nlink)
mlog(0, "Skipping delete of %llu because nlink = %u\n",
(unsigned long long)oi->ip_blkno, inode->i_nlink);
goto bail; goto bail;
}
/* Do some basic inode verification... */ /* Do some basic inode verification... */
di = (struct ocfs2_dinode *) di_bh->b_data; di = (struct ocfs2_dinode *) di_bh->b_data;
...@@ -904,9 +889,7 @@ static int ocfs2_query_inode_wipe(struct inode *inode, ...@@ -904,9 +889,7 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
* ORPHANED_FL not. * ORPHANED_FL not.
*/ */
if (di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) { if (di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) {
mlog(0, "Reflinked inode %llu is no longer orphaned. " reason = 2;
"it shouldn't be deleted\n",
(unsigned long long)oi->ip_blkno);
goto bail; goto bail;
} }
...@@ -943,8 +926,7 @@ static int ocfs2_query_inode_wipe(struct inode *inode, ...@@ -943,8 +926,7 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
status = ocfs2_try_open_lock(inode, 1); status = ocfs2_try_open_lock(inode, 1);
if (status == -EAGAIN) { if (status == -EAGAIN) {
status = 0; status = 0;
mlog(0, "Skipping delete of %llu because it is in use on " reason = 3;
"other nodes\n", (unsigned long long)oi->ip_blkno);
goto bail; goto bail;
} }
if (status < 0) { if (status < 0) {
...@@ -953,11 +935,10 @@ static int ocfs2_query_inode_wipe(struct inode *inode, ...@@ -953,11 +935,10 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
} }
*wipe = 1; *wipe = 1;
mlog(0, "Inode %llu is ok to wipe from orphan dir %u\n", trace_ocfs2_query_inode_wipe_succ(le16_to_cpu(di->i_orphaned_slot));
(unsigned long long)oi->ip_blkno,
le16_to_cpu(di->i_orphaned_slot));
bail: bail:
trace_ocfs2_query_inode_wipe_end(status, reason);
return status; return status;
} }
...@@ -967,8 +948,8 @@ static int ocfs2_query_inode_wipe(struct inode *inode, ...@@ -967,8 +948,8 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
static void ocfs2_cleanup_delete_inode(struct inode *inode, static void ocfs2_cleanup_delete_inode(struct inode *inode,
int sync_data) int sync_data)
{ {
mlog(0, "Cleanup inode %llu, sync = %d\n", trace_ocfs2_cleanup_delete_inode(
(unsigned long long)OCFS2_I(inode)->ip_blkno, sync_data); (unsigned long long)OCFS2_I(inode)->ip_blkno, sync_data);
if (sync_data) if (sync_data)
write_inode_now(inode, 1); write_inode_now(inode, 1);
truncate_inode_pages(&inode->i_data, 0); truncate_inode_pages(&inode->i_data, 0);
...@@ -980,15 +961,15 @@ static void ocfs2_delete_inode(struct inode *inode) ...@@ -980,15 +961,15 @@ static void ocfs2_delete_inode(struct inode *inode)
sigset_t oldset; sigset_t oldset;
struct buffer_head *di_bh = NULL; struct buffer_head *di_bh = NULL;
mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino); trace_ocfs2_delete_inode(inode->i_ino,
(unsigned long long)OCFS2_I(inode)->ip_blkno,
is_bad_inode(inode));
/* When we fail in read_inode() we mark inode as bad. The second test /* When we fail in read_inode() we mark inode as bad. The second test
* catches the case when inode allocation fails before allocating * catches the case when inode allocation fails before allocating
* a block for inode. */ * a block for inode. */
if (is_bad_inode(inode) || !OCFS2_I(inode)->ip_blkno) { if (is_bad_inode(inode) || !OCFS2_I(inode)->ip_blkno)
mlog(0, "Skipping delete of bad inode\n");
goto bail; goto bail;
}
dquot_initialize(inode); dquot_initialize(inode);
...@@ -1080,7 +1061,7 @@ static void ocfs2_delete_inode(struct inode *inode) ...@@ -1080,7 +1061,7 @@ static void ocfs2_delete_inode(struct inode *inode)
bail_unblock: bail_unblock:
ocfs2_unblock_signals(&oldset); ocfs2_unblock_signals(&oldset);
bail: bail:
mlog_exit_void(); return;
} }
static void ocfs2_clear_inode(struct inode *inode) static void ocfs2_clear_inode(struct inode *inode)
...@@ -1088,11 +1069,9 @@ static void ocfs2_clear_inode(struct inode *inode) ...@@ -1088,11 +1069,9 @@ static void ocfs2_clear_inode(struct inode *inode)
int status; int status;
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
mlog_entry_void();
end_writeback(inode); end_writeback(inode);
mlog(0, "Clearing inode: %llu, nlink = %u\n", trace_ocfs2_clear_inode((unsigned long long)oi->ip_blkno,
(unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_nlink); inode->i_nlink);
mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL,
"Inode=%lu\n", inode->i_ino); "Inode=%lu\n", inode->i_ino);
...@@ -1181,8 +1160,6 @@ static void ocfs2_clear_inode(struct inode *inode) ...@@ -1181,8 +1160,6 @@ static void ocfs2_clear_inode(struct inode *inode)
*/ */
jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal, jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal,
&oi->ip_jinode); &oi->ip_jinode);
mlog_exit_void();
} }
void ocfs2_evict_inode(struct inode *inode) void ocfs2_evict_inode(struct inode *inode)
...@@ -1204,17 +1181,14 @@ int ocfs2_drop_inode(struct inode *inode) ...@@ -1204,17 +1181,14 @@ int ocfs2_drop_inode(struct inode *inode)
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
int res; int res;
mlog_entry_void(); trace_ocfs2_drop_inode((unsigned long long)oi->ip_blkno,
inode->i_nlink, oi->ip_flags);
mlog(0, "Drop inode %llu, nlink = %u, ip_flags = 0x%x\n",
(unsigned long long)oi->ip_blkno, inode->i_nlink, oi->ip_flags);
if (oi->ip_flags & OCFS2_INODE_MAYBE_ORPHANED) if (oi->ip_flags & OCFS2_INODE_MAYBE_ORPHANED)
res = 1; res = 1;
else else
res = generic_drop_inode(inode); res = generic_drop_inode(inode);
mlog_exit_void();
return res; return res;
} }
...@@ -1226,11 +1200,11 @@ int ocfs2_inode_revalidate(struct dentry *dentry) ...@@ -1226,11 +1200,11 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
int status = 0; int status = 0;
mlog_entry("(inode = 0x%p, ino = %llu)\n", inode, trace_ocfs2_inode_revalidate(inode,
inode ? (unsigned long long)OCFS2_I(inode)->ip_blkno : 0ULL); inode ? (unsigned long long)OCFS2_I(inode)->ip_blkno : 0ULL,
inode ? (unsigned long long)OCFS2_I(inode)->ip_flags : 0);
if (!inode) { if (!inode) {
mlog(0, "eep, no inode!\n");
status = -ENOENT; status = -ENOENT;
goto bail; goto bail;
} }
...@@ -1238,7 +1212,6 @@ int ocfs2_inode_revalidate(struct dentry *dentry) ...@@ -1238,7 +1212,6 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
spin_lock(&OCFS2_I(inode)->ip_lock); spin_lock(&OCFS2_I(inode)->ip_lock);
if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) { if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) {
spin_unlock(&OCFS2_I(inode)->ip_lock); spin_unlock(&OCFS2_I(inode)->ip_lock);
mlog(0, "inode deleted!\n");
status = -ENOENT; status = -ENOENT;
goto bail; goto bail;
} }
...@@ -1254,8 +1227,6 @@ int ocfs2_inode_revalidate(struct dentry *dentry) ...@@ -1254,8 +1227,6 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
} }
ocfs2_inode_unlock(inode, 0); ocfs2_inode_unlock(inode, 0);
bail: bail:
mlog_exit(status);
return status; return status;
} }
...@@ -1271,8 +1242,7 @@ int ocfs2_mark_inode_dirty(handle_t *handle, ...@@ -1271,8 +1242,7 @@ int ocfs2_mark_inode_dirty(handle_t *handle,
int status; int status;
struct ocfs2_dinode *fe = (struct ocfs2_dinode *) bh->b_data; struct ocfs2_dinode *fe = (struct ocfs2_dinode *) bh->b_data;
mlog_entry("(inode %llu)\n", trace_ocfs2_mark_inode_dirty((unsigned long long)OCFS2_I(inode)->ip_blkno);
(unsigned long long)OCFS2_I(inode)->ip_blkno);
status = ocfs2_journal_access_di(handle, INODE_CACHE(inode), bh, status = ocfs2_journal_access_di(handle, INODE_CACHE(inode), bh,
OCFS2_JOURNAL_ACCESS_WRITE); OCFS2_JOURNAL_ACCESS_WRITE);
...@@ -1302,7 +1272,6 @@ int ocfs2_mark_inode_dirty(handle_t *handle, ...@@ -1302,7 +1272,6 @@ int ocfs2_mark_inode_dirty(handle_t *handle,
ocfs2_journal_dirty(handle, bh); ocfs2_journal_dirty(handle, bh);
leave: leave:
mlog_exit(status);
return status; return status;
} }
...@@ -1345,8 +1314,7 @@ int ocfs2_validate_inode_block(struct super_block *sb, ...@@ -1345,8 +1314,7 @@ int ocfs2_validate_inode_block(struct super_block *sb,
int rc; int rc;
struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data; struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;
mlog(0, "Validating dinode %llu\n", trace_ocfs2_validate_inode_block((unsigned long long)bh->b_blocknr);
(unsigned long long)bh->b_blocknr);
BUG_ON(!buffer_uptodate(bh)); BUG_ON(!buffer_uptodate(bh));
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/compat.h> #include <linux/compat.h>
#define MLOG_MASK_PREFIX ML_INODE
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -46,6 +45,22 @@ static inline void __o2info_set_request_error(struct ocfs2_info_request *kreq, ...@@ -46,6 +45,22 @@ static inline void __o2info_set_request_error(struct ocfs2_info_request *kreq,
#define o2info_set_request_error(a, b) \ #define o2info_set_request_error(a, b) \
__o2info_set_request_error((struct ocfs2_info_request *)&(a), b) __o2info_set_request_error((struct ocfs2_info_request *)&(a), b)
static inline void __o2info_set_request_filled(struct ocfs2_info_request *req)
{
req->ir_flags |= OCFS2_INFO_FL_FILLED;
}
#define o2info_set_request_filled(a) \
__o2info_set_request_filled((struct ocfs2_info_request *)&(a))
static inline void __o2info_clear_request_filled(struct ocfs2_info_request *req)
{
req->ir_flags &= ~OCFS2_INFO_FL_FILLED;
}
#define o2info_clear_request_filled(a) \
__o2info_clear_request_filled((struct ocfs2_info_request *)&(a))
static int ocfs2_get_inode_attr(struct inode *inode, unsigned *flags) static int ocfs2_get_inode_attr(struct inode *inode, unsigned *flags)
{ {
int status; int status;
...@@ -59,7 +74,6 @@ static int ocfs2_get_inode_attr(struct inode *inode, unsigned *flags) ...@@ -59,7 +74,6 @@ static int ocfs2_get_inode_attr(struct inode *inode, unsigned *flags)
*flags = OCFS2_I(inode)->ip_attr; *flags = OCFS2_I(inode)->ip_attr;
ocfs2_inode_unlock(inode, 0); ocfs2_inode_unlock(inode, 0);
mlog_exit(status);
return status; return status;
} }
...@@ -125,7 +139,6 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags, ...@@ -125,7 +139,6 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
brelse(bh); brelse(bh);
mlog_exit(status);
return status; return status;
} }
...@@ -139,7 +152,8 @@ int ocfs2_info_handle_blocksize(struct inode *inode, ...@@ -139,7 +152,8 @@ int ocfs2_info_handle_blocksize(struct inode *inode,
goto bail; goto bail;
oib.ib_blocksize = inode->i_sb->s_blocksize; oib.ib_blocksize = inode->i_sb->s_blocksize;
oib.ib_req.ir_flags |= OCFS2_INFO_FL_FILLED;
o2info_set_request_filled(oib);
if (o2info_to_user(oib, req)) if (o2info_to_user(oib, req))
goto bail; goto bail;
...@@ -163,7 +177,8 @@ int ocfs2_info_handle_clustersize(struct inode *inode, ...@@ -163,7 +177,8 @@ int ocfs2_info_handle_clustersize(struct inode *inode,
goto bail; goto bail;
oic.ic_clustersize = osb->s_clustersize; oic.ic_clustersize = osb->s_clustersize;
oic.ic_req.ir_flags |= OCFS2_INFO_FL_FILLED;
o2info_set_request_filled(oic);
if (o2info_to_user(oic, req)) if (o2info_to_user(oic, req))
goto bail; goto bail;
...@@ -187,7 +202,8 @@ int ocfs2_info_handle_maxslots(struct inode *inode, ...@@ -187,7 +202,8 @@ int ocfs2_info_handle_maxslots(struct inode *inode,
goto bail; goto bail;
oim.im_max_slots = osb->max_slots; oim.im_max_slots = osb->max_slots;
oim.im_req.ir_flags |= OCFS2_INFO_FL_FILLED;
o2info_set_request_filled(oim);
if (o2info_to_user(oim, req)) if (o2info_to_user(oim, req))
goto bail; goto bail;
...@@ -211,7 +227,8 @@ int ocfs2_info_handle_label(struct inode *inode, ...@@ -211,7 +227,8 @@ int ocfs2_info_handle_label(struct inode *inode,
goto bail; goto bail;
memcpy(oil.il_label, osb->vol_label, OCFS2_MAX_VOL_LABEL_LEN); memcpy(oil.il_label, osb->vol_label, OCFS2_MAX_VOL_LABEL_LEN);
oil.il_req.ir_flags |= OCFS2_INFO_FL_FILLED;
o2info_set_request_filled(oil);
if (o2info_to_user(oil, req)) if (o2info_to_user(oil, req))
goto bail; goto bail;
...@@ -235,7 +252,8 @@ int ocfs2_info_handle_uuid(struct inode *inode, ...@@ -235,7 +252,8 @@ int ocfs2_info_handle_uuid(struct inode *inode,
goto bail; goto bail;
memcpy(oiu.iu_uuid_str, osb->uuid_str, OCFS2_TEXT_UUID_LEN + 1); memcpy(oiu.iu_uuid_str, osb->uuid_str, OCFS2_TEXT_UUID_LEN + 1);
oiu.iu_req.ir_flags |= OCFS2_INFO_FL_FILLED;
o2info_set_request_filled(oiu);
if (o2info_to_user(oiu, req)) if (o2info_to_user(oiu, req))
goto bail; goto bail;
...@@ -261,7 +279,8 @@ int ocfs2_info_handle_fs_features(struct inode *inode, ...@@ -261,7 +279,8 @@ int ocfs2_info_handle_fs_features(struct inode *inode,
oif.if_compat_features = osb->s_feature_compat; oif.if_compat_features = osb->s_feature_compat;
oif.if_incompat_features = osb->s_feature_incompat; oif.if_incompat_features = osb->s_feature_incompat;
oif.if_ro_compat_features = osb->s_feature_ro_compat; oif.if_ro_compat_features = osb->s_feature_ro_compat;
oif.if_req.ir_flags |= OCFS2_INFO_FL_FILLED;
o2info_set_request_filled(oif);
if (o2info_to_user(oif, req)) if (o2info_to_user(oif, req))
goto bail; goto bail;
...@@ -286,7 +305,7 @@ int ocfs2_info_handle_journal_size(struct inode *inode, ...@@ -286,7 +305,7 @@ int ocfs2_info_handle_journal_size(struct inode *inode,
oij.ij_journal_size = osb->journal->j_inode->i_size; oij.ij_journal_size = osb->journal->j_inode->i_size;
oij.ij_req.ir_flags |= OCFS2_INFO_FL_FILLED; o2info_set_request_filled(oij);
if (o2info_to_user(oij, req)) if (o2info_to_user(oij, req))
goto bail; goto bail;
...@@ -308,7 +327,7 @@ int ocfs2_info_handle_unknown(struct inode *inode, ...@@ -308,7 +327,7 @@ int ocfs2_info_handle_unknown(struct inode *inode,
if (o2info_from_user(oir, req)) if (o2info_from_user(oir, req))
goto bail; goto bail;
oir.ir_flags &= ~OCFS2_INFO_FL_FILLED; o2info_clear_request_filled(oir);
if (o2info_to_user(oir, req)) if (o2info_to_user(oir, req))
goto bail; goto bail;
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/time.h> #include <linux/time.h>
#include <linux/random.h> #include <linux/random.h>
#define MLOG_MASK_PREFIX ML_JOURNAL
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -52,6 +51,7 @@ ...@@ -52,6 +51,7 @@
#include "quota.h" #include "quota.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
#include "ocfs2_trace.h"
DEFINE_SPINLOCK(trans_inc_lock); DEFINE_SPINLOCK(trans_inc_lock);
...@@ -303,16 +303,15 @@ static int ocfs2_commit_cache(struct ocfs2_super *osb) ...@@ -303,16 +303,15 @@ static int ocfs2_commit_cache(struct ocfs2_super *osb)
unsigned int flushed; unsigned int flushed;
struct ocfs2_journal *journal = NULL; struct ocfs2_journal *journal = NULL;
mlog_entry_void();
journal = osb->journal; journal = osb->journal;
/* Flush all pending commits and checkpoint the journal. */ /* Flush all pending commits and checkpoint the journal. */
down_write(&journal->j_trans_barrier); down_write(&journal->j_trans_barrier);
if (atomic_read(&journal->j_num_trans) == 0) { flushed = atomic_read(&journal->j_num_trans);
trace_ocfs2_commit_cache_begin(flushed);
if (flushed == 0) {
up_write(&journal->j_trans_barrier); up_write(&journal->j_trans_barrier);
mlog(0, "No transactions for me to flush!\n");
goto finally; goto finally;
} }
...@@ -331,13 +330,11 @@ static int ocfs2_commit_cache(struct ocfs2_super *osb) ...@@ -331,13 +330,11 @@ static int ocfs2_commit_cache(struct ocfs2_super *osb)
atomic_set(&journal->j_num_trans, 0); atomic_set(&journal->j_num_trans, 0);
up_write(&journal->j_trans_barrier); up_write(&journal->j_trans_barrier);
mlog(0, "commit_thread: flushed transaction %lu (%u handles)\n", trace_ocfs2_commit_cache_end(journal->j_trans_id, flushed);
journal->j_trans_id, flushed);
ocfs2_wake_downconvert_thread(osb); ocfs2_wake_downconvert_thread(osb);
wake_up(&journal->j_checkpointed); wake_up(&journal->j_checkpointed);
finally: finally:
mlog_exit(status);
return status; return status;
} }
...@@ -425,9 +422,8 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks) ...@@ -425,9 +422,8 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks)
return 0; return 0;
old_nblocks = handle->h_buffer_credits; old_nblocks = handle->h_buffer_credits;
mlog_entry_void();
mlog(0, "Trying to extend transaction by %d blocks\n", nblocks); trace_ocfs2_extend_trans(old_nblocks, nblocks);
#ifdef CONFIG_OCFS2_DEBUG_FS #ifdef CONFIG_OCFS2_DEBUG_FS
status = 1; status = 1;
...@@ -440,9 +436,7 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks) ...@@ -440,9 +436,7 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks)
#endif #endif
if (status > 0) { if (status > 0) {
mlog(0, trace_ocfs2_extend_trans_restart(old_nblocks + nblocks);
"jbd2_journal_extend failed, trying "
"jbd2_journal_restart\n");
status = jbd2_journal_restart(handle, status = jbd2_journal_restart(handle,
old_nblocks + nblocks); old_nblocks + nblocks);
if (status < 0) { if (status < 0) {
...@@ -453,8 +447,6 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks) ...@@ -453,8 +447,6 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks)
status = 0; status = 0;
bail: bail:
mlog_exit(status);
return status; return status;
} }
...@@ -622,12 +614,9 @@ static int __ocfs2_journal_access(handle_t *handle, ...@@ -622,12 +614,9 @@ static int __ocfs2_journal_access(handle_t *handle,
BUG_ON(!handle); BUG_ON(!handle);
BUG_ON(!bh); BUG_ON(!bh);
mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %zu\n", trace_ocfs2_journal_access(
(unsigned long long)bh->b_blocknr, type, (unsigned long long)ocfs2_metadata_cache_owner(ci),
(type == OCFS2_JOURNAL_ACCESS_CREATE) ? (unsigned long long)bh->b_blocknr, type, bh->b_size);
"OCFS2_JOURNAL_ACCESS_CREATE" :
"OCFS2_JOURNAL_ACCESS_WRITE",
bh->b_size);
/* we can safely remove this assertion after testing. */ /* we can safely remove this assertion after testing. */
if (!buffer_uptodate(bh)) { if (!buffer_uptodate(bh)) {
...@@ -668,7 +657,6 @@ static int __ocfs2_journal_access(handle_t *handle, ...@@ -668,7 +657,6 @@ static int __ocfs2_journal_access(handle_t *handle,
mlog(ML_ERROR, "Error %d getting %d access to buffer!\n", mlog(ML_ERROR, "Error %d getting %d access to buffer!\n",
status, type); status, type);
mlog_exit(status);
return status; return status;
} }
...@@ -737,13 +725,10 @@ void ocfs2_journal_dirty(handle_t *handle, struct buffer_head *bh) ...@@ -737,13 +725,10 @@ void ocfs2_journal_dirty(handle_t *handle, struct buffer_head *bh)
{ {
int status; int status;
mlog_entry("(bh->b_blocknr=%llu)\n", trace_ocfs2_journal_dirty((unsigned long long)bh->b_blocknr);
(unsigned long long)bh->b_blocknr);
status = jbd2_journal_dirty_metadata(handle, bh); status = jbd2_journal_dirty_metadata(handle, bh);
BUG_ON(status); BUG_ON(status);
mlog_exit_void();
} }
#define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE) #define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE)
...@@ -775,8 +760,6 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) ...@@ -775,8 +760,6 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
struct ocfs2_super *osb; struct ocfs2_super *osb;
int inode_lock = 0; int inode_lock = 0;
mlog_entry_void();
BUG_ON(!journal); BUG_ON(!journal);
osb = journal->j_osb; osb = journal->j_osb;
...@@ -820,10 +803,9 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) ...@@ -820,10 +803,9 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
goto done; goto done;
} }
mlog(0, "inode->i_size = %lld\n", inode->i_size); trace_ocfs2_journal_init(inode->i_size,
mlog(0, "inode->i_blocks = %llu\n", (unsigned long long)inode->i_blocks,
(unsigned long long)inode->i_blocks); OCFS2_I(inode)->ip_clusters);
mlog(0, "inode->ip_clusters = %u\n", OCFS2_I(inode)->ip_clusters);
/* call the kernels journal init function now */ /* call the kernels journal init function now */
j_journal = jbd2_journal_init_inode(inode); j_journal = jbd2_journal_init_inode(inode);
...@@ -833,8 +815,7 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) ...@@ -833,8 +815,7 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
goto done; goto done;
} }
mlog(0, "Returned from jbd2_journal_init_inode\n"); trace_ocfs2_journal_init_maxlen(j_journal->j_maxlen);
mlog(0, "j_journal->j_maxlen = %u\n", j_journal->j_maxlen);
*dirty = (le32_to_cpu(di->id1.journal1.ij_flags) & *dirty = (le32_to_cpu(di->id1.journal1.ij_flags) &
OCFS2_JOURNAL_DIRTY_FL); OCFS2_JOURNAL_DIRTY_FL);
...@@ -859,7 +840,6 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) ...@@ -859,7 +840,6 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
} }
} }
mlog_exit(status);
return status; return status;
} }
...@@ -882,8 +862,6 @@ static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb, ...@@ -882,8 +862,6 @@ static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,
struct buffer_head *bh = journal->j_bh; struct buffer_head *bh = journal->j_bh;
struct ocfs2_dinode *fe; struct ocfs2_dinode *fe;
mlog_entry_void();
fe = (struct ocfs2_dinode *)bh->b_data; fe = (struct ocfs2_dinode *)bh->b_data;
/* The journal bh on the osb always comes from ocfs2_journal_init() /* The journal bh on the osb always comes from ocfs2_journal_init()
...@@ -906,7 +884,6 @@ static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb, ...@@ -906,7 +884,6 @@ static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,
if (status < 0) if (status < 0)
mlog_errno(status); mlog_errno(status);
mlog_exit(status);
return status; return status;
} }
...@@ -921,8 +898,6 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb) ...@@ -921,8 +898,6 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
struct inode *inode = NULL; struct inode *inode = NULL;
int num_running_trans = 0; int num_running_trans = 0;
mlog_entry_void();
BUG_ON(!osb); BUG_ON(!osb);
journal = osb->journal; journal = osb->journal;
...@@ -939,10 +914,7 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb) ...@@ -939,10 +914,7 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
BUG(); BUG();
num_running_trans = atomic_read(&(osb->journal->j_num_trans)); num_running_trans = atomic_read(&(osb->journal->j_num_trans));
if (num_running_trans > 0) trace_ocfs2_journal_shutdown(num_running_trans);
mlog(0, "Shutting down journal: must wait on %d "
"running transactions!\n",
num_running_trans);
/* Do a commit_cache here. It will flush our journal, *and* /* Do a commit_cache here. It will flush our journal, *and*
* release any locks that are still held. * release any locks that are still held.
...@@ -955,7 +927,7 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb) ...@@ -955,7 +927,7 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
* completely destroy the journal. */ * completely destroy the journal. */
if (osb->commit_task) { if (osb->commit_task) {
/* Wait for the commit thread */ /* Wait for the commit thread */
mlog(0, "Waiting for ocfs2commit to exit....\n"); trace_ocfs2_journal_shutdown_wait(osb->commit_task);
kthread_stop(osb->commit_task); kthread_stop(osb->commit_task);
osb->commit_task = NULL; osb->commit_task = NULL;
} }
...@@ -998,7 +970,6 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb) ...@@ -998,7 +970,6 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
done: done:
if (inode) if (inode)
iput(inode); iput(inode);
mlog_exit_void();
} }
static void ocfs2_clear_journal_error(struct super_block *sb, static void ocfs2_clear_journal_error(struct super_block *sb,
...@@ -1024,8 +995,6 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) ...@@ -1024,8 +995,6 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed)
int status = 0; int status = 0;
struct ocfs2_super *osb; struct ocfs2_super *osb;
mlog_entry_void();
BUG_ON(!journal); BUG_ON(!journal);
osb = journal->j_osb; osb = journal->j_osb;
...@@ -1059,7 +1028,6 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) ...@@ -1059,7 +1028,6 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed)
osb->commit_task = NULL; osb->commit_task = NULL;
done: done:
mlog_exit(status);
return status; return status;
} }
...@@ -1070,8 +1038,6 @@ int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full) ...@@ -1070,8 +1038,6 @@ int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full)
{ {
int status; int status;
mlog_entry_void();
BUG_ON(!journal); BUG_ON(!journal);
status = jbd2_journal_wipe(journal->j_journal, full); status = jbd2_journal_wipe(journal->j_journal, full);
...@@ -1085,7 +1051,6 @@ int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full) ...@@ -1085,7 +1051,6 @@ int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full)
mlog_errno(status); mlog_errno(status);
bail: bail:
mlog_exit(status);
return status; return status;
} }
...@@ -1124,8 +1089,6 @@ static int ocfs2_force_read_journal(struct inode *inode) ...@@ -1124,8 +1089,6 @@ static int ocfs2_force_read_journal(struct inode *inode)
#define CONCURRENT_JOURNAL_FILL 32ULL #define CONCURRENT_JOURNAL_FILL 32ULL
struct buffer_head *bhs[CONCURRENT_JOURNAL_FILL]; struct buffer_head *bhs[CONCURRENT_JOURNAL_FILL];
mlog_entry_void();
memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL); memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL);
num_blocks = ocfs2_blocks_for_bytes(inode->i_sb, inode->i_size); num_blocks = ocfs2_blocks_for_bytes(inode->i_sb, inode->i_size);
...@@ -1161,7 +1124,6 @@ static int ocfs2_force_read_journal(struct inode *inode) ...@@ -1161,7 +1124,6 @@ static int ocfs2_force_read_journal(struct inode *inode)
bail: bail:
for(i = 0; i < CONCURRENT_JOURNAL_FILL; i++) for(i = 0; i < CONCURRENT_JOURNAL_FILL; i++)
brelse(bhs[i]); brelse(bhs[i]);
mlog_exit(status);
return status; return status;
} }
...@@ -1185,7 +1147,7 @@ struct ocfs2_la_recovery_item { ...@@ -1185,7 +1147,7 @@ struct ocfs2_la_recovery_item {
*/ */
void ocfs2_complete_recovery(struct work_struct *work) void ocfs2_complete_recovery(struct work_struct *work)
{ {
int ret; int ret = 0;
struct ocfs2_journal *journal = struct ocfs2_journal *journal =
container_of(work, struct ocfs2_journal, j_recovery_work); container_of(work, struct ocfs2_journal, j_recovery_work);
struct ocfs2_super *osb = journal->j_osb; struct ocfs2_super *osb = journal->j_osb;
...@@ -1194,9 +1156,8 @@ void ocfs2_complete_recovery(struct work_struct *work) ...@@ -1194,9 +1156,8 @@ void ocfs2_complete_recovery(struct work_struct *work)
struct ocfs2_quota_recovery *qrec; struct ocfs2_quota_recovery *qrec;
LIST_HEAD(tmp_la_list); LIST_HEAD(tmp_la_list);
mlog_entry_void(); trace_ocfs2_complete_recovery(
(unsigned long long)OCFS2_I(journal->j_inode)->ip_blkno);
mlog(0, "completing recovery from keventd\n");
spin_lock(&journal->j_lock); spin_lock(&journal->j_lock);
list_splice_init(&journal->j_la_cleanups, &tmp_la_list); list_splice_init(&journal->j_la_cleanups, &tmp_la_list);
...@@ -1205,15 +1166,18 @@ void ocfs2_complete_recovery(struct work_struct *work) ...@@ -1205,15 +1166,18 @@ void ocfs2_complete_recovery(struct work_struct *work)
list_for_each_entry_safe(item, n, &tmp_la_list, lri_list) { list_for_each_entry_safe(item, n, &tmp_la_list, lri_list) {
list_del_init(&item->lri_list); list_del_init(&item->lri_list);
mlog(0, "Complete recovery for slot %d\n", item->lri_slot);
ocfs2_wait_on_quotas(osb); ocfs2_wait_on_quotas(osb);
la_dinode = item->lri_la_dinode; la_dinode = item->lri_la_dinode;
if (la_dinode) { tl_dinode = item->lri_tl_dinode;
mlog(0, "Clean up local alloc %llu\n", qrec = item->lri_qrec;
(unsigned long long)le64_to_cpu(la_dinode->i_blkno));
trace_ocfs2_complete_recovery_slot(item->lri_slot,
la_dinode ? le64_to_cpu(la_dinode->i_blkno) : 0,
tl_dinode ? le64_to_cpu(tl_dinode->i_blkno) : 0,
qrec);
if (la_dinode) {
ret = ocfs2_complete_local_alloc_recovery(osb, ret = ocfs2_complete_local_alloc_recovery(osb,
la_dinode); la_dinode);
if (ret < 0) if (ret < 0)
...@@ -1222,11 +1186,7 @@ void ocfs2_complete_recovery(struct work_struct *work) ...@@ -1222,11 +1186,7 @@ void ocfs2_complete_recovery(struct work_struct *work)
kfree(la_dinode); kfree(la_dinode);
} }
tl_dinode = item->lri_tl_dinode;
if (tl_dinode) { if (tl_dinode) {
mlog(0, "Clean up truncate log %llu\n",
(unsigned long long)le64_to_cpu(tl_dinode->i_blkno));
ret = ocfs2_complete_truncate_log_recovery(osb, ret = ocfs2_complete_truncate_log_recovery(osb,
tl_dinode); tl_dinode);
if (ret < 0) if (ret < 0)
...@@ -1239,9 +1199,7 @@ void ocfs2_complete_recovery(struct work_struct *work) ...@@ -1239,9 +1199,7 @@ void ocfs2_complete_recovery(struct work_struct *work)
if (ret < 0) if (ret < 0)
mlog_errno(ret); mlog_errno(ret);
qrec = item->lri_qrec;
if (qrec) { if (qrec) {
mlog(0, "Recovering quota files");
ret = ocfs2_finish_quota_recovery(osb, qrec, ret = ocfs2_finish_quota_recovery(osb, qrec,
item->lri_slot); item->lri_slot);
if (ret < 0) if (ret < 0)
...@@ -1252,8 +1210,7 @@ void ocfs2_complete_recovery(struct work_struct *work) ...@@ -1252,8 +1210,7 @@ void ocfs2_complete_recovery(struct work_struct *work)
kfree(item); kfree(item);
} }
mlog(0, "Recovery completion\n"); trace_ocfs2_complete_recovery_end(ret);
mlog_exit_void();
} }
/* NOTE: This function always eats your references to la_dinode and /* NOTE: This function always eats your references to la_dinode and
...@@ -1339,8 +1296,6 @@ static int __ocfs2_recovery_thread(void *arg) ...@@ -1339,8 +1296,6 @@ static int __ocfs2_recovery_thread(void *arg)
int rm_quota_used = 0, i; int rm_quota_used = 0, i;
struct ocfs2_quota_recovery *qrec; struct ocfs2_quota_recovery *qrec;
mlog_entry_void();
status = ocfs2_wait_on_mount(osb); status = ocfs2_wait_on_mount(osb);
if (status < 0) { if (status < 0) {
goto bail; goto bail;
...@@ -1372,15 +1327,12 @@ static int __ocfs2_recovery_thread(void *arg) ...@@ -1372,15 +1327,12 @@ static int __ocfs2_recovery_thread(void *arg)
* clear it until ocfs2_recover_node() has succeeded. */ * clear it until ocfs2_recover_node() has succeeded. */
node_num = rm->rm_entries[0]; node_num = rm->rm_entries[0];
spin_unlock(&osb->osb_lock); spin_unlock(&osb->osb_lock);
mlog(0, "checking node %d\n", node_num);
slot_num = ocfs2_node_num_to_slot(osb, node_num); slot_num = ocfs2_node_num_to_slot(osb, node_num);
trace_ocfs2_recovery_thread_node(node_num, slot_num);
if (slot_num == -ENOENT) { if (slot_num == -ENOENT) {
status = 0; status = 0;
mlog(0, "no slot for this node, so no recovery"
"required.\n");
goto skip_recovery; goto skip_recovery;
} }
mlog(0, "node %d was using slot %d\n", node_num, slot_num);
/* It is a bit subtle with quota recovery. We cannot do it /* It is a bit subtle with quota recovery. We cannot do it
* immediately because we have to obtain cluster locks from * immediately because we have to obtain cluster locks from
...@@ -1407,7 +1359,7 @@ static int __ocfs2_recovery_thread(void *arg) ...@@ -1407,7 +1359,7 @@ static int __ocfs2_recovery_thread(void *arg)
spin_lock(&osb->osb_lock); spin_lock(&osb->osb_lock);
} }
spin_unlock(&osb->osb_lock); spin_unlock(&osb->osb_lock);
mlog(0, "All nodes recovered\n"); trace_ocfs2_recovery_thread_end(status);
/* Refresh all journal recovery generations from disk */ /* Refresh all journal recovery generations from disk */
status = ocfs2_check_journals_nolocks(osb); status = ocfs2_check_journals_nolocks(osb);
...@@ -1451,7 +1403,6 @@ static int __ocfs2_recovery_thread(void *arg) ...@@ -1451,7 +1403,6 @@ static int __ocfs2_recovery_thread(void *arg)
if (rm_quota) if (rm_quota)
kfree(rm_quota); kfree(rm_quota);
mlog_exit(status);
/* no one is callint kthread_stop() for us so the kthread() api /* no one is callint kthread_stop() for us so the kthread() api
* requires that we call do_exit(). And it isn't exported, but * requires that we call do_exit(). And it isn't exported, but
* complete_and_exit() seems to be a minimal wrapper around it. */ * complete_and_exit() seems to be a minimal wrapper around it. */
...@@ -1461,19 +1412,15 @@ static int __ocfs2_recovery_thread(void *arg) ...@@ -1461,19 +1412,15 @@ static int __ocfs2_recovery_thread(void *arg)
void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num) void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num)
{ {
mlog_entry("(node_num=%d, osb->node_num = %d)\n",
node_num, osb->node_num);
mutex_lock(&osb->recovery_lock); mutex_lock(&osb->recovery_lock);
if (osb->disable_recovery)
goto out;
/* People waiting on recovery will wait on trace_ocfs2_recovery_thread(node_num, osb->node_num,
* the recovery map to empty. */ osb->disable_recovery, osb->recovery_thread_task,
if (ocfs2_recovery_map_set(osb, node_num)) osb->disable_recovery ?
mlog(0, "node %d already in recovery map.\n", node_num); -1 : ocfs2_recovery_map_set(osb, node_num));
mlog(0, "starting recovery thread...\n"); if (osb->disable_recovery)
goto out;
if (osb->recovery_thread_task) if (osb->recovery_thread_task)
goto out; goto out;
...@@ -1488,8 +1435,6 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num) ...@@ -1488,8 +1435,6 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num)
out: out:
mutex_unlock(&osb->recovery_lock); mutex_unlock(&osb->recovery_lock);
wake_up(&osb->recovery_event); wake_up(&osb->recovery_event);
mlog_exit_void();
} }
static int ocfs2_read_journal_inode(struct ocfs2_super *osb, static int ocfs2_read_journal_inode(struct ocfs2_super *osb,
...@@ -1563,7 +1508,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb, ...@@ -1563,7 +1508,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
* If not, it needs recovery. * If not, it needs recovery.
*/ */
if (osb->slot_recovery_generations[slot_num] != slot_reco_gen) { if (osb->slot_recovery_generations[slot_num] != slot_reco_gen) {
mlog(0, "Slot %u already recovered (old/new=%u/%u)\n", slot_num, trace_ocfs2_replay_journal_recovered(slot_num,
osb->slot_recovery_generations[slot_num], slot_reco_gen); osb->slot_recovery_generations[slot_num], slot_reco_gen);
osb->slot_recovery_generations[slot_num] = slot_reco_gen; osb->slot_recovery_generations[slot_num] = slot_reco_gen;
status = -EBUSY; status = -EBUSY;
...@@ -1574,7 +1519,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb, ...@@ -1574,7 +1519,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
status = ocfs2_inode_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY); status = ocfs2_inode_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY);
if (status < 0) { if (status < 0) {
mlog(0, "status returned from ocfs2_inode_lock=%d\n", status); trace_ocfs2_replay_journal_lock_err(status);
if (status != -ERESTARTSYS) if (status != -ERESTARTSYS)
mlog(ML_ERROR, "Could not lock journal!\n"); mlog(ML_ERROR, "Could not lock journal!\n");
goto done; goto done;
...@@ -1587,7 +1532,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb, ...@@ -1587,7 +1532,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
slot_reco_gen = ocfs2_get_recovery_generation(fe); slot_reco_gen = ocfs2_get_recovery_generation(fe);
if (!(flags & OCFS2_JOURNAL_DIRTY_FL)) { if (!(flags & OCFS2_JOURNAL_DIRTY_FL)) {
mlog(0, "No recovery required for node %d\n", node_num); trace_ocfs2_replay_journal_skip(node_num);
/* Refresh recovery generation for the slot */ /* Refresh recovery generation for the slot */
osb->slot_recovery_generations[slot_num] = slot_reco_gen; osb->slot_recovery_generations[slot_num] = slot_reco_gen;
goto done; goto done;
...@@ -1608,7 +1553,6 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb, ...@@ -1608,7 +1553,6 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
goto done; goto done;
} }
mlog(0, "calling journal_init_inode\n");
journal = jbd2_journal_init_inode(inode); journal = jbd2_journal_init_inode(inode);
if (journal == NULL) { if (journal == NULL) {
mlog(ML_ERROR, "Linux journal layer error\n"); mlog(ML_ERROR, "Linux journal layer error\n");
...@@ -1628,7 +1572,6 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb, ...@@ -1628,7 +1572,6 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
ocfs2_clear_journal_error(osb->sb, journal, slot_num); ocfs2_clear_journal_error(osb->sb, journal, slot_num);
/* wipe the journal */ /* wipe the journal */
mlog(0, "flushing the journal.\n");
jbd2_journal_lock_updates(journal); jbd2_journal_lock_updates(journal);
status = jbd2_journal_flush(journal); status = jbd2_journal_flush(journal);
jbd2_journal_unlock_updates(journal); jbd2_journal_unlock_updates(journal);
...@@ -1665,7 +1608,6 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb, ...@@ -1665,7 +1608,6 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
brelse(bh); brelse(bh);
mlog_exit(status);
return status; return status;
} }
...@@ -1688,8 +1630,7 @@ static int ocfs2_recover_node(struct ocfs2_super *osb, ...@@ -1688,8 +1630,7 @@ static int ocfs2_recover_node(struct ocfs2_super *osb,
struct ocfs2_dinode *la_copy = NULL; struct ocfs2_dinode *la_copy = NULL;
struct ocfs2_dinode *tl_copy = NULL; struct ocfs2_dinode *tl_copy = NULL;
mlog_entry("(node_num=%d, slot_num=%d, osb->node_num = %d)\n", trace_ocfs2_recover_node(node_num, slot_num, osb->node_num);
node_num, slot_num, osb->node_num);
/* Should not ever be called to recover ourselves -- in that /* Should not ever be called to recover ourselves -- in that
* case we should've called ocfs2_journal_load instead. */ * case we should've called ocfs2_journal_load instead. */
...@@ -1698,9 +1639,7 @@ static int ocfs2_recover_node(struct ocfs2_super *osb, ...@@ -1698,9 +1639,7 @@ static int ocfs2_recover_node(struct ocfs2_super *osb,
status = ocfs2_replay_journal(osb, node_num, slot_num); status = ocfs2_replay_journal(osb, node_num, slot_num);
if (status < 0) { if (status < 0) {
if (status == -EBUSY) { if (status == -EBUSY) {
mlog(0, "Skipping recovery for slot %u (node %u) " trace_ocfs2_recover_node_skip(slot_num, node_num);
"as another node has recovered it\n", slot_num,
node_num);
status = 0; status = 0;
goto done; goto done;
} }
...@@ -1735,7 +1674,6 @@ static int ocfs2_recover_node(struct ocfs2_super *osb, ...@@ -1735,7 +1674,6 @@ static int ocfs2_recover_node(struct ocfs2_super *osb,
status = 0; status = 0;
done: done:
mlog_exit(status);
return status; return status;
} }
...@@ -1808,8 +1746,8 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb) ...@@ -1808,8 +1746,8 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb)
spin_lock(&osb->osb_lock); spin_lock(&osb->osb_lock);
osb->slot_recovery_generations[i] = gen; osb->slot_recovery_generations[i] = gen;
mlog(0, "Slot %u recovery generation is %u\n", i, trace_ocfs2_mark_dead_nodes(i,
osb->slot_recovery_generations[i]); osb->slot_recovery_generations[i]);
if (i == osb->slot_num) { if (i == osb->slot_num) {
spin_unlock(&osb->osb_lock); spin_unlock(&osb->osb_lock);
...@@ -1845,7 +1783,6 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb) ...@@ -1845,7 +1783,6 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb)
status = 0; status = 0;
bail: bail:
mlog_exit(status);
return status; return status;
} }
...@@ -1884,11 +1821,12 @@ void ocfs2_queue_orphan_scan(struct ocfs2_super *osb) ...@@ -1884,11 +1821,12 @@ void ocfs2_queue_orphan_scan(struct ocfs2_super *osb)
os = &osb->osb_orphan_scan; os = &osb->osb_orphan_scan;
mlog(0, "Begin orphan scan\n");
if (atomic_read(&os->os_state) == ORPHAN_SCAN_INACTIVE) if (atomic_read(&os->os_state) == ORPHAN_SCAN_INACTIVE)
goto out; goto out;
trace_ocfs2_queue_orphan_scan_begin(os->os_count, os->os_seqno,
atomic_read(&os->os_state));
status = ocfs2_orphan_scan_lock(osb, &seqno); status = ocfs2_orphan_scan_lock(osb, &seqno);
if (status < 0) { if (status < 0) {
if (status != -EAGAIN) if (status != -EAGAIN)
...@@ -1918,7 +1856,8 @@ void ocfs2_queue_orphan_scan(struct ocfs2_super *osb) ...@@ -1918,7 +1856,8 @@ void ocfs2_queue_orphan_scan(struct ocfs2_super *osb)
unlock: unlock:
ocfs2_orphan_scan_unlock(osb, seqno); ocfs2_orphan_scan_unlock(osb, seqno);
out: out:
mlog(0, "Orphan scan completed\n"); trace_ocfs2_queue_orphan_scan_end(os->os_count, os->os_seqno,
atomic_read(&os->os_state));
return; return;
} }
...@@ -2002,8 +1941,7 @@ static int ocfs2_orphan_filldir(void *priv, const char *name, int name_len, ...@@ -2002,8 +1941,7 @@ static int ocfs2_orphan_filldir(void *priv, const char *name, int name_len,
if (IS_ERR(iter)) if (IS_ERR(iter))
return 0; return 0;
mlog(0, "queue orphan %llu\n", trace_ocfs2_orphan_filldir((unsigned long long)OCFS2_I(iter)->ip_blkno);
(unsigned long long)OCFS2_I(iter)->ip_blkno);
/* No locking is required for the next_orphan queue as there /* No locking is required for the next_orphan queue as there
* is only ever a single process doing orphan recovery. */ * is only ever a single process doing orphan recovery. */
OCFS2_I(iter)->ip_next_orphan = p->head; OCFS2_I(iter)->ip_next_orphan = p->head;
...@@ -2119,7 +2057,7 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb, ...@@ -2119,7 +2057,7 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb,
struct inode *iter; struct inode *iter;
struct ocfs2_inode_info *oi; struct ocfs2_inode_info *oi;
mlog(0, "Recover inodes from orphan dir in slot %d\n", slot); trace_ocfs2_recover_orphans(slot);
ocfs2_mark_recovering_orphan_dir(osb, slot); ocfs2_mark_recovering_orphan_dir(osb, slot);
ret = ocfs2_queue_orphans(osb, slot, &inode); ret = ocfs2_queue_orphans(osb, slot, &inode);
...@@ -2132,7 +2070,8 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb, ...@@ -2132,7 +2070,8 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb,
while (inode) { while (inode) {
oi = OCFS2_I(inode); oi = OCFS2_I(inode);
mlog(0, "iput orphan %llu\n", (unsigned long long)oi->ip_blkno); trace_ocfs2_recover_orphans_iput(
(unsigned long long)oi->ip_blkno);
iter = oi->ip_next_orphan; iter = oi->ip_next_orphan;
...@@ -2170,6 +2109,7 @@ static int __ocfs2_wait_on_mount(struct ocfs2_super *osb, int quota) ...@@ -2170,6 +2109,7 @@ static int __ocfs2_wait_on_mount(struct ocfs2_super *osb, int quota)
* MOUNTED flag, but this is set right before * MOUNTED flag, but this is set right before
* dismount_volume() so we can trust it. */ * dismount_volume() so we can trust it. */
if (atomic_read(&osb->vol_state) == VOLUME_DISABLED) { if (atomic_read(&osb->vol_state) == VOLUME_DISABLED) {
trace_ocfs2_wait_on_mount(VOLUME_DISABLED);
mlog(0, "mount error, exiting!\n"); mlog(0, "mount error, exiting!\n");
return -EBUSY; return -EBUSY;
} }
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#define MLOG_MASK_PREFIX ML_DISK_ALLOC
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -43,6 +42,7 @@ ...@@ -43,6 +42,7 @@
#include "suballoc.h" #include "suballoc.h"
#include "super.h" #include "super.h"
#include "sysfile.h" #include "sysfile.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
...@@ -201,8 +201,7 @@ void ocfs2_la_set_sizes(struct ocfs2_super *osb, int requested_mb) ...@@ -201,8 +201,7 @@ void ocfs2_la_set_sizes(struct ocfs2_super *osb, int requested_mb)
la_max_mb = ocfs2_clusters_to_megabytes(sb, la_max_mb = ocfs2_clusters_to_megabytes(sb,
ocfs2_local_alloc_size(sb) * 8); ocfs2_local_alloc_size(sb) * 8);
mlog(0, "requested: %dM, max: %uM, default: %uM\n", trace_ocfs2_la_set_sizes(requested_mb, la_max_mb, la_default_mb);
requested_mb, la_max_mb, la_default_mb);
if (requested_mb == -1) { if (requested_mb == -1) {
/* No user request - use defaults */ /* No user request - use defaults */
...@@ -276,8 +275,8 @@ int ocfs2_alloc_should_use_local(struct ocfs2_super *osb, u64 bits) ...@@ -276,8 +275,8 @@ int ocfs2_alloc_should_use_local(struct ocfs2_super *osb, u64 bits)
ret = 1; ret = 1;
bail: bail:
mlog(0, "state=%d, bits=%llu, la_bits=%d, ret=%d\n", trace_ocfs2_alloc_should_use_local(
osb->local_alloc_state, (unsigned long long)bits, la_bits, ret); (unsigned long long)bits, osb->local_alloc_state, la_bits, ret);
spin_unlock(&osb->osb_lock); spin_unlock(&osb->osb_lock);
return ret; return ret;
} }
...@@ -291,8 +290,6 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb) ...@@ -291,8 +290,6 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
struct inode *inode = NULL; struct inode *inode = NULL;
struct ocfs2_local_alloc *la; struct ocfs2_local_alloc *la;
mlog_entry_void();
if (osb->local_alloc_bits == 0) if (osb->local_alloc_bits == 0)
goto bail; goto bail;
...@@ -364,9 +361,10 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb) ...@@ -364,9 +361,10 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
if (inode) if (inode)
iput(inode); iput(inode);
mlog(0, "Local alloc window bits = %d\n", osb->local_alloc_bits); trace_ocfs2_load_local_alloc(osb->local_alloc_bits);
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -388,8 +386,6 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb) ...@@ -388,8 +386,6 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb)
struct ocfs2_dinode *alloc_copy = NULL; struct ocfs2_dinode *alloc_copy = NULL;
struct ocfs2_dinode *alloc = NULL; struct ocfs2_dinode *alloc = NULL;
mlog_entry_void();
cancel_delayed_work(&osb->la_enable_wq); cancel_delayed_work(&osb->la_enable_wq);
flush_workqueue(ocfs2_wq); flush_workqueue(ocfs2_wq);
...@@ -482,8 +478,6 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb) ...@@ -482,8 +478,6 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb)
if (alloc_copy) if (alloc_copy)
kfree(alloc_copy); kfree(alloc_copy);
mlog_exit_void();
} }
/* /*
...@@ -502,7 +496,7 @@ int ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb, ...@@ -502,7 +496,7 @@ int ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb,
struct inode *inode = NULL; struct inode *inode = NULL;
struct ocfs2_dinode *alloc; struct ocfs2_dinode *alloc;
mlog_entry("(slot_num = %d)\n", slot_num); trace_ocfs2_begin_local_alloc_recovery(slot_num);
*alloc_copy = NULL; *alloc_copy = NULL;
...@@ -552,7 +546,8 @@ int ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb, ...@@ -552,7 +546,8 @@ int ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb,
iput(inode); iput(inode);
} }
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -570,8 +565,6 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb, ...@@ -570,8 +565,6 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,
struct buffer_head *main_bm_bh = NULL; struct buffer_head *main_bm_bh = NULL;
struct inode *main_bm_inode; struct inode *main_bm_inode;
mlog_entry_void();
main_bm_inode = ocfs2_get_system_file_inode(osb, main_bm_inode = ocfs2_get_system_file_inode(osb,
GLOBAL_BITMAP_SYSTEM_INODE, GLOBAL_BITMAP_SYSTEM_INODE,
OCFS2_INVALID_SLOT); OCFS2_INVALID_SLOT);
...@@ -620,7 +613,8 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb, ...@@ -620,7 +613,8 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,
out: out:
if (!status) if (!status)
ocfs2_init_steal_slots(osb); ocfs2_init_steal_slots(osb);
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -640,8 +634,6 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, ...@@ -640,8 +634,6 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
struct inode *local_alloc_inode; struct inode *local_alloc_inode;
unsigned int free_bits; unsigned int free_bits;
mlog_entry_void();
BUG_ON(!ac); BUG_ON(!ac);
local_alloc_inode = local_alloc_inode =
...@@ -712,10 +704,6 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, ...@@ -712,10 +704,6 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
goto bail; goto bail;
} }
if (ac->ac_max_block)
mlog(0, "Calling in_range for max block %llu\n",
(unsigned long long)ac->ac_max_block);
ac->ac_inode = local_alloc_inode; ac->ac_inode = local_alloc_inode;
/* We should never use localalloc from another slot */ /* We should never use localalloc from another slot */
ac->ac_alloc_slot = osb->slot_num; ac->ac_alloc_slot = osb->slot_num;
...@@ -729,10 +717,12 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, ...@@ -729,10 +717,12 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
iput(local_alloc_inode); iput(local_alloc_inode);
} }
mlog(0, "bits=%d, slot=%d, ret=%d\n", bits_wanted, osb->slot_num, trace_ocfs2_reserve_local_alloc_bits(
status); (unsigned long long)ac->ac_max_block,
bits_wanted, osb->slot_num, status);
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -749,7 +739,6 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, ...@@ -749,7 +739,6 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb,
struct ocfs2_dinode *alloc; struct ocfs2_dinode *alloc;
struct ocfs2_local_alloc *la; struct ocfs2_local_alloc *la;
mlog_entry_void();
BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL); BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL);
local_alloc_inode = ac->ac_inode; local_alloc_inode = ac->ac_inode;
...@@ -788,7 +777,8 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, ...@@ -788,7 +777,8 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb,
ocfs2_journal_dirty(handle, osb->local_alloc_bh); ocfs2_journal_dirty(handle, osb->local_alloc_bh);
bail: bail:
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -799,13 +789,11 @@ static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc) ...@@ -799,13 +789,11 @@ static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc)
u32 count = 0; u32 count = 0;
struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc);
mlog_entry_void();
buffer = la->la_bitmap; buffer = la->la_bitmap;
for (i = 0; i < le16_to_cpu(la->la_size); i++) for (i = 0; i < le16_to_cpu(la->la_size); i++)
count += hweight8(buffer[i]); count += hweight8(buffer[i]);
mlog_exit(count); trace_ocfs2_local_alloc_count_bits(count);
return count; return count;
} }
...@@ -820,10 +808,7 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb, ...@@ -820,10 +808,7 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb,
void *bitmap = NULL; void *bitmap = NULL;
struct ocfs2_reservation_map *resmap = &osb->osb_la_resmap; struct ocfs2_reservation_map *resmap = &osb->osb_la_resmap;
mlog_entry("(numbits wanted = %u)\n", *numbits);
if (!alloc->id1.bitmap1.i_total) { if (!alloc->id1.bitmap1.i_total) {
mlog(0, "No bits in my window!\n");
bitoff = -1; bitoff = -1;
goto bail; goto bail;
} }
...@@ -883,8 +868,7 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb, ...@@ -883,8 +868,7 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb,
} }
} }
mlog(0, "Exiting loop, bitoff = %d, numfound = %d\n", bitoff, trace_ocfs2_local_alloc_find_clear_bits_search_bitmap(bitoff, numfound);
numfound);
if (numfound == *numbits) if (numfound == *numbits)
bitoff = startoff - numfound; bitoff = startoff - numfound;
...@@ -895,7 +879,10 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb, ...@@ -895,7 +879,10 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb,
if (local_resv) if (local_resv)
ocfs2_resv_discard(resmap, resv); ocfs2_resv_discard(resmap, resv);
mlog_exit(bitoff); trace_ocfs2_local_alloc_find_clear_bits(*numbits,
le32_to_cpu(alloc->id1.bitmap1.i_total),
bitoff, numfound);
return bitoff; return bitoff;
} }
...@@ -903,15 +890,12 @@ static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc) ...@@ -903,15 +890,12 @@ static void ocfs2_clear_local_alloc(struct ocfs2_dinode *alloc)
{ {
struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc);
int i; int i;
mlog_entry_void();
alloc->id1.bitmap1.i_total = 0; alloc->id1.bitmap1.i_total = 0;
alloc->id1.bitmap1.i_used = 0; alloc->id1.bitmap1.i_used = 0;
la->la_bm_off = 0; la->la_bm_off = 0;
for(i = 0; i < le16_to_cpu(la->la_size); i++) for(i = 0; i < le16_to_cpu(la->la_size); i++)
la->la_bitmap[i] = 0; la->la_bitmap[i] = 0;
mlog_exit_void();
} }
#if 0 #if 0
...@@ -952,18 +936,16 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb, ...@@ -952,18 +936,16 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb,
void *bitmap; void *bitmap;
struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc);
mlog_entry("total = %u, used = %u\n", trace_ocfs2_sync_local_to_main(
le32_to_cpu(alloc->id1.bitmap1.i_total), le32_to_cpu(alloc->id1.bitmap1.i_total),
le32_to_cpu(alloc->id1.bitmap1.i_used)); le32_to_cpu(alloc->id1.bitmap1.i_used));
if (!alloc->id1.bitmap1.i_total) { if (!alloc->id1.bitmap1.i_total) {
mlog(0, "nothing to sync!\n");
goto bail; goto bail;
} }
if (le32_to_cpu(alloc->id1.bitmap1.i_used) == if (le32_to_cpu(alloc->id1.bitmap1.i_used) ==
le32_to_cpu(alloc->id1.bitmap1.i_total)) { le32_to_cpu(alloc->id1.bitmap1.i_total)) {
mlog(0, "all bits were taken!\n");
goto bail; goto bail;
} }
...@@ -985,8 +967,7 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb, ...@@ -985,8 +967,7 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb,
ocfs2_clusters_to_blocks(osb->sb, ocfs2_clusters_to_blocks(osb->sb,
start - count); start - count);
mlog(0, "freeing %u bits starting at local alloc bit " trace_ocfs2_sync_local_to_main_free(
"%u (la_start_blk = %llu, blkno = %llu)\n",
count, start - count, count, start - count,
(unsigned long long)la_start_blk, (unsigned long long)la_start_blk,
(unsigned long long)blkno); (unsigned long long)blkno);
...@@ -1007,7 +988,8 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb, ...@@ -1007,7 +988,8 @@ static int ocfs2_sync_local_to_main(struct ocfs2_super *osb,
} }
bail: bail:
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -1132,7 +1114,8 @@ static int ocfs2_local_alloc_reserve_for_window(struct ocfs2_super *osb, ...@@ -1132,7 +1114,8 @@ static int ocfs2_local_alloc_reserve_for_window(struct ocfs2_super *osb,
*ac = NULL; *ac = NULL;
} }
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -1148,17 +1131,12 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb, ...@@ -1148,17 +1131,12 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb,
struct ocfs2_dinode *alloc = NULL; struct ocfs2_dinode *alloc = NULL;
struct ocfs2_local_alloc *la; struct ocfs2_local_alloc *la;
mlog_entry_void();
alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data;
la = OCFS2_LOCAL_ALLOC(alloc); la = OCFS2_LOCAL_ALLOC(alloc);
if (alloc->id1.bitmap1.i_total) trace_ocfs2_local_alloc_new_window(
mlog(0, "asking me to alloc a new window over a non-empty " le32_to_cpu(alloc->id1.bitmap1.i_total),
"one\n"); osb->local_alloc_bits);
mlog(0, "Allocating %u clusters for a new window.\n",
osb->local_alloc_bits);
/* Instruct the allocation code to try the most recently used /* Instruct the allocation code to try the most recently used
* cluster group. We'll re-record the group used this pass * cluster group. We'll re-record the group used this pass
...@@ -1220,13 +1198,13 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb, ...@@ -1220,13 +1198,13 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb,
ocfs2_resmap_restart(&osb->osb_la_resmap, cluster_count, ocfs2_resmap_restart(&osb->osb_la_resmap, cluster_count,
OCFS2_LOCAL_ALLOC(alloc)->la_bitmap); OCFS2_LOCAL_ALLOC(alloc)->la_bitmap);
mlog(0, "New window allocated:\n"); trace_ocfs2_local_alloc_new_window_result(
mlog(0, "window la_bm_off = %u\n", OCFS2_LOCAL_ALLOC(alloc)->la_bm_off,
OCFS2_LOCAL_ALLOC(alloc)->la_bm_off); le32_to_cpu(alloc->id1.bitmap1.i_total));
mlog(0, "window bits = %u\n", le32_to_cpu(alloc->id1.bitmap1.i_total));
bail: bail:
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -1243,8 +1221,6 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb, ...@@ -1243,8 +1221,6 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb,
struct ocfs2_dinode *alloc_copy = NULL; struct ocfs2_dinode *alloc_copy = NULL;
struct ocfs2_alloc_context *ac = NULL; struct ocfs2_alloc_context *ac = NULL;
mlog_entry_void();
ocfs2_recalc_la_window(osb, OCFS2_LA_EVENT_SLIDE); ocfs2_recalc_la_window(osb, OCFS2_LA_EVENT_SLIDE);
/* This will lock the main bitmap for us. */ /* This will lock the main bitmap for us. */
...@@ -1324,7 +1300,8 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb, ...@@ -1324,7 +1300,8 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb,
if (ac) if (ac)
ocfs2_free_alloc_context(ac); ocfs2_free_alloc_context(ac);
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
#define MLOG_MASK_PREFIX ML_INODE
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#define MLOG_MASK_PREFIX ML_FILE_IO
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -42,6 +41,7 @@ ...@@ -42,6 +41,7 @@
#include "inode.h" #include "inode.h"
#include "mmap.h" #include "mmap.h"
#include "super.h" #include "super.h"
#include "ocfs2_trace.h"
static int ocfs2_fault(struct vm_area_struct *area, struct vm_fault *vmf) static int ocfs2_fault(struct vm_area_struct *area, struct vm_fault *vmf)
...@@ -49,13 +49,12 @@ static int ocfs2_fault(struct vm_area_struct *area, struct vm_fault *vmf) ...@@ -49,13 +49,12 @@ static int ocfs2_fault(struct vm_area_struct *area, struct vm_fault *vmf)
sigset_t oldset; sigset_t oldset;
int ret; int ret;
mlog_entry("(area=%p, page offset=%lu)\n", area, vmf->pgoff);
ocfs2_block_signals(&oldset); ocfs2_block_signals(&oldset);
ret = filemap_fault(area, vmf); ret = filemap_fault(area, vmf);
ocfs2_unblock_signals(&oldset); ocfs2_unblock_signals(&oldset);
mlog_exit_ptr(vmf->page); trace_ocfs2_fault(OCFS2_I(area->vm_file->f_mapping->host)->ip_blkno,
area, vmf->page, vmf->pgoff);
return ret; return ret;
} }
......
此差异已折叠。
...@@ -147,6 +147,17 @@ struct ocfs2_lock_res_ops; ...@@ -147,6 +147,17 @@ struct ocfs2_lock_res_ops;
typedef void (*ocfs2_lock_callback)(int status, unsigned long data); typedef void (*ocfs2_lock_callback)(int status, unsigned long data);
#ifdef CONFIG_OCFS2_FS_STATS
struct ocfs2_lock_stats {
u64 ls_total; /* Total wait in NSEC */
u32 ls_gets; /* Num acquires */
u32 ls_fail; /* Num failed acquires */
/* Storing max wait in usecs saves 24 bytes per inode */
u32 ls_max; /* Max wait in USEC */
};
#endif
struct ocfs2_lock_res { struct ocfs2_lock_res {
void *l_priv; void *l_priv;
struct ocfs2_lock_res_ops *l_ops; struct ocfs2_lock_res_ops *l_ops;
...@@ -182,15 +193,9 @@ struct ocfs2_lock_res { ...@@ -182,15 +193,9 @@ struct ocfs2_lock_res {
struct list_head l_debug_list; struct list_head l_debug_list;
#ifdef CONFIG_OCFS2_FS_STATS #ifdef CONFIG_OCFS2_FS_STATS
unsigned long long l_lock_num_prmode; /* PR acquires */ struct ocfs2_lock_stats l_lock_prmode; /* PR mode stats */
unsigned long long l_lock_num_exmode; /* EX acquires */ u32 l_lock_refresh; /* Disk refreshes */
unsigned int l_lock_num_prmode_failed; /* Failed PR gets */ struct ocfs2_lock_stats l_lock_exmode; /* EX mode stats */
unsigned int l_lock_num_exmode_failed; /* Failed EX gets */
unsigned long long l_lock_total_prmode; /* Tot wait for PR */
unsigned long long l_lock_total_exmode; /* Tot wait for EX */
unsigned int l_lock_max_prmode; /* Max wait for PR */
unsigned int l_lock_max_exmode; /* Max wait for EX */
unsigned int l_lock_refresh; /* Disk refreshes */
#endif #endif
#ifdef CONFIG_DEBUG_LOCK_ALLOC #ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lockdep_map l_lockdep_map; struct lockdep_map l_lockdep_map;
......
此差异已折叠。
此差异已折叠。
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <linux/quotaops.h> #include <linux/quotaops.h>
#include <linux/module.h> #include <linux/module.h>
#define MLOG_MASK_PREFIX ML_QUOTA
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2_fs.h" #include "ocfs2_fs.h"
...@@ -23,6 +22,7 @@ ...@@ -23,6 +22,7 @@
#include "quota.h" #include "quota.h"
#include "uptodate.h" #include "uptodate.h"
#include "super.h" #include "super.h"
#include "ocfs2_trace.h"
/* Number of local quota structures per block */ /* Number of local quota structures per block */
static inline unsigned int ol_quota_entries_per_block(struct super_block *sb) static inline unsigned int ol_quota_entries_per_block(struct super_block *sb)
...@@ -475,7 +475,7 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, ...@@ -475,7 +475,7 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode,
struct ocfs2_recovery_chunk *rchunk, *next; struct ocfs2_recovery_chunk *rchunk, *next;
qsize_t spacechange, inodechange; qsize_t spacechange, inodechange;
mlog_entry("ino=%lu type=%u", (unsigned long)lqinode->i_ino, type); trace_ocfs2_recover_local_quota_file((unsigned long)lqinode->i_ino, type);
list_for_each_entry_safe(rchunk, next, &(rec->r_list[type]), rc_list) { list_for_each_entry_safe(rchunk, next, &(rec->r_list[type]), rc_list) {
chunk = rchunk->rc_chunk; chunk = rchunk->rc_chunk;
...@@ -575,7 +575,8 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, ...@@ -575,7 +575,8 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode,
} }
if (status < 0) if (status < 0)
free_recovery_list(&(rec->r_list[type])); free_recovery_list(&(rec->r_list[type]));
mlog_exit(status); if (status)
mlog_errno(status);
return status; return status;
} }
...@@ -600,7 +601,7 @@ int ocfs2_finish_quota_recovery(struct ocfs2_super *osb, ...@@ -600,7 +601,7 @@ int ocfs2_finish_quota_recovery(struct ocfs2_super *osb,
for (type = 0; type < MAXQUOTAS; type++) { for (type = 0; type < MAXQUOTAS; type++) {
if (list_empty(&(rec->r_list[type]))) if (list_empty(&(rec->r_list[type])))
continue; continue;
mlog(0, "Recovering quota in slot %d\n", slot_num); trace_ocfs2_finish_quota_recovery(slot_num);
lqinode = ocfs2_get_system_file_inode(osb, ino[type], slot_num); lqinode = ocfs2_get_system_file_inode(osb, ino[type], slot_num);
if (!lqinode) { if (!lqinode) {
status = -ENOENT; status = -ENOENT;
...@@ -882,9 +883,10 @@ static void olq_set_dquot(struct buffer_head *bh, void *private) ...@@ -882,9 +883,10 @@ static void olq_set_dquot(struct buffer_head *bh, void *private)
dqblk->dqb_inodemod = cpu_to_le64(od->dq_dquot.dq_dqb.dqb_curinodes - dqblk->dqb_inodemod = cpu_to_le64(od->dq_dquot.dq_dqb.dqb_curinodes -
od->dq_originodes); od->dq_originodes);
spin_unlock(&dq_data_lock); spin_unlock(&dq_data_lock);
mlog(0, "Writing local dquot %u space %lld inodes %lld\n", trace_olq_set_dquot(
od->dq_dquot.dq_id, (long long)le64_to_cpu(dqblk->dqb_spacemod), (unsigned long long)le64_to_cpu(dqblk->dqb_spacemod),
(long long)le64_to_cpu(dqblk->dqb_inodemod)); (unsigned long long)le64_to_cpu(dqblk->dqb_inodemod),
od->dq_dquot.dq_id);
} }
/* Write dquot to local quota file */ /* Write dquot to local quota file */
......
此差异已折叠。
此差异已折叠。
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/types.h> #include <linux/types.h>
#define MLOG_MASK_PREFIX ML_DISK_ALLOC
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -39,6 +38,7 @@ ...@@ -39,6 +38,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"
#include "suballoc.h" #include "suballoc.h"
...@@ -82,7 +82,6 @@ static u16 ocfs2_calc_new_backup_super(struct inode *inode, ...@@ -82,7 +82,6 @@ static u16 ocfs2_calc_new_backup_super(struct inode *inode,
backups++; backups++;
} }
mlog_exit_void();
return backups; return backups;
} }
...@@ -103,8 +102,8 @@ static int ocfs2_update_last_group_and_inode(handle_t *handle, ...@@ -103,8 +102,8 @@ static int ocfs2_update_last_group_and_inode(handle_t *handle,
u16 cl_bpc = le16_to_cpu(cl->cl_bpc); u16 cl_bpc = le16_to_cpu(cl->cl_bpc);
u16 cl_cpg = le16_to_cpu(cl->cl_cpg); u16 cl_cpg = le16_to_cpu(cl->cl_cpg);
mlog_entry("(new_clusters=%d, first_new_cluster = %u)\n", trace_ocfs2_update_last_group_and_inode(new_clusters,
new_clusters, first_new_cluster); first_new_cluster);
ret = ocfs2_journal_access_gd(handle, INODE_CACHE(bm_inode), ret = ocfs2_journal_access_gd(handle, INODE_CACHE(bm_inode),
group_bh, OCFS2_JOURNAL_ACCESS_WRITE); group_bh, OCFS2_JOURNAL_ACCESS_WRITE);
...@@ -176,7 +175,8 @@ static int ocfs2_update_last_group_and_inode(handle_t *handle, ...@@ -176,7 +175,8 @@ static int ocfs2_update_last_group_and_inode(handle_t *handle,
le16_add_cpu(&group->bg_free_bits_count, -1 * num_bits); le16_add_cpu(&group->bg_free_bits_count, -1 * num_bits);
} }
out: out:
mlog_exit(ret); if (ret)
mlog_errno(ret);
return ret; return ret;
} }
...@@ -281,8 +281,6 @@ int ocfs2_group_extend(struct inode * inode, int new_clusters) ...@@ -281,8 +281,6 @@ int ocfs2_group_extend(struct inode * inode, int new_clusters)
u32 first_new_cluster; u32 first_new_cluster;
u64 lgd_blkno; u64 lgd_blkno;
mlog_entry_void();
if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb))
return -EROFS; return -EROFS;
...@@ -342,7 +340,8 @@ int ocfs2_group_extend(struct inode * inode, int new_clusters) ...@@ -342,7 +340,8 @@ int ocfs2_group_extend(struct inode * inode, int new_clusters)
goto out_unlock; goto out_unlock;
} }
mlog(0, "extend the last group at %llu, new clusters = %d\n",
trace_ocfs2_group_extend(
(unsigned long long)le64_to_cpu(group->bg_blkno), new_clusters); (unsigned long long)le64_to_cpu(group->bg_blkno), new_clusters);
handle = ocfs2_start_trans(osb, OCFS2_GROUP_EXTEND_CREDITS); handle = ocfs2_start_trans(osb, OCFS2_GROUP_EXTEND_CREDITS);
...@@ -377,7 +376,6 @@ int ocfs2_group_extend(struct inode * inode, int new_clusters) ...@@ -377,7 +376,6 @@ int ocfs2_group_extend(struct inode * inode, int new_clusters)
iput(main_bm_inode); iput(main_bm_inode);
out: out:
mlog_exit_void();
return ret; return ret;
} }
...@@ -472,8 +470,6 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input) ...@@ -472,8 +470,6 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input)
struct ocfs2_chain_rec *cr; struct ocfs2_chain_rec *cr;
u16 cl_bpc; u16 cl_bpc;
mlog_entry_void();
if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb))
return -EROFS; return -EROFS;
...@@ -520,8 +516,8 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input) ...@@ -520,8 +516,8 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input)
goto out_unlock; goto out_unlock;
} }
mlog(0, "Add a new group %llu in chain = %u, length = %u\n", trace_ocfs2_group_add((unsigned long long)input->group,
(unsigned long long)input->group, input->chain, input->clusters); input->chain, input->clusters, input->frees);
handle = ocfs2_start_trans(osb, OCFS2_GROUP_ADD_CREDITS); handle = ocfs2_start_trans(osb, OCFS2_GROUP_ADD_CREDITS);
if (IS_ERR(handle)) { if (IS_ERR(handle)) {
...@@ -589,6 +585,5 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input) ...@@ -589,6 +585,5 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input)
iput(main_bm_inode); iput(main_bm_inode);
out: out:
mlog_exit_void();
return ret; return ret;
} }
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册