[Ocfs2-commits] mfasheh commits r2172 - in trunk/fs/ocfs2: . cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Apr 25 19:43:43 CDT 2005
Author: mfasheh
Signed-off-by: zab
Date: 2005-04-25 19:43:42 -0500 (Mon, 25 Apr 2005)
New Revision: 2172
Removed:
trunk/fs/ocfs2/ocfs_log.h
Modified:
trunk/fs/ocfs2/24io.c
trunk/fs/ocfs2/Makefile
trunk/fs/ocfs2/aio.c
trunk/fs/ocfs2/alloc.c
trunk/fs/ocfs2/aops.c
trunk/fs/ocfs2/buffer_head_io.c
trunk/fs/ocfs2/buffer_head_io.h
trunk/fs/ocfs2/cluster/masklog.c
trunk/fs/ocfs2/cluster/masklog.h
trunk/fs/ocfs2/dcache.c
trunk/fs/ocfs2/dir.c
trunk/fs/ocfs2/dlmglue.c
trunk/fs/ocfs2/extent_map.c
trunk/fs/ocfs2/file.c
trunk/fs/ocfs2/heartbeat.c
trunk/fs/ocfs2/inode.c
trunk/fs/ocfs2/journal.c
trunk/fs/ocfs2/localalloc.c
trunk/fs/ocfs2/mmap.c
trunk/fs/ocfs2/namei.c
trunk/fs/ocfs2/ocfs_compat.c
trunk/fs/ocfs2/proc.c
trunk/fs/ocfs2/slot_map.c
trunk/fs/ocfs2/suballoc.c
trunk/fs/ocfs2/super.c
trunk/fs/ocfs2/symlink.c
trunk/fs/ocfs2/sysfile.c
trunk/fs/ocfs2/vote.c
Log:
* switch ocfs2 over to use the mlog api
Signed-off-by: zab
Modified: trunk/fs/ocfs2/24io.c
===================================================================
--- trunk/fs/ocfs2/24io.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/24io.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -33,16 +33,15 @@
#include <linux/types.h>
#include <linux/iobuf.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_FILE_IO
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "alloc.h"
#include "extent_map.h"
#include "inode.h"
-
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_INODE
-
static int ocfs_get_sector(struct inode *inode, unsigned long isector,
unsigned long *osector)
{
@@ -50,11 +49,11 @@
u64 v_blkno, p_blkno, p_sector;
int s_to_b_bits, offset;
- LOG_ENTRY_ARGS ("(0x%p, %lu)\n", inode, isector);
+ mlog_entry ("(0x%p, %lu)\n", inode, isector);
err = -EINVAL;
if (!inode) {
- LOG_ERROR_STR ("bad inode");
+ mlog(ML_ERROR, "bad inode\n");
goto bail;
}
@@ -65,7 +64,7 @@
err = ocfs2_extent_map_get_blocks(inode, v_blkno, 1, &p_blkno,
NULL);
if (err) {
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
@@ -73,8 +72,8 @@
p_sector += offset;
if (p_sector == 0) {
err = -EIO;
- LOG_ERROR_ARGS ("isector=%lu inode=%llu\n",
- isector, OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "isector=%lu inode=%llu\n",
+ isector, OCFS_I(inode)->ip_blkno);
}
/* 2.4 shouldn't ever have this happen */
@@ -83,7 +82,7 @@
*osector = (unsigned long)p_sector;
bail:
- LOG_EXIT_INT (err);
+ mlog_exit (err);
return err;
} /* ocfs_get_sector */
@@ -128,7 +127,7 @@
err = -EINVAL;
if (size == 0) {
- printk("direct write of 0 byte\n");
+ mlog(ML_NOTICE, "direct write of 0 bytes\n");
return 0;
}
@@ -285,7 +284,7 @@
totalioblocks += blocks;
}
} else {
- printk( "ocfs_rw_direct : brw_kiovec() %d\n", err);
+ MLOG(ML_NOTICE, "brw_kiovec() %d\n", err);
break;
}
unmap_kiobuf (iobuf);
Modified: trunk/fs/ocfs2/Makefile
===================================================================
--- trunk/fs/ocfs2/Makefile 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/Makefile 2005-04-26 00:43:42 UTC (rev 2172)
@@ -35,14 +35,6 @@
EXTRA_CFLAGS += -DJOURNAL_ACCESS_WITH_CREDITS
endif
-ifneq ($(QUIET),1)
-EXTRA_CFLAGS += -DVERBOSE_BH_JBD_TRACE
-EXTRA_CFLAGS += -DVERBOSE_LOCKING_TRACE
-EXTRA_CFLAGS += -DVERBOSE_BH_SEQNUM_TRACE
-EXTRA_CFLAGS += -DVERBOSE_COMMIT_THREAD
-endif
-
-
#
# Since SUBDIRS means something to kbuild, define them safely. Do not
# include trailing slashes.
@@ -86,7 +78,6 @@
ocfs1_fs_compat.h \
ocfs.h \
ocfs2.h \
- ocfs_log.h \
ocfs_compat.h \
buffer_head_io.h \
aio.h \
Modified: trunk/fs/ocfs2/aio.c
===================================================================
--- trunk/fs/ocfs2/aio.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/aio.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -34,10 +34,9 @@
#include <linux/pagemap.h>
#include <linux/uio.h>
-#define MLOG_MASK_PREFIX ML_AIO
+#define MLOG_MASK_PREFIX ML_FILE_IO|ML_AIO
#include <cluster/masklog.h>
-#include "ocfs_log.h"
#include "ocfs.h"
#include "ocfs2.h"
@@ -256,14 +255,14 @@
okp = okp_alloc(iocb);
if (IS_ERR(okp)) {
ret = PTR_ERR(okp);
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto out;
}
ret = ocfs2_setup_io_locks(inode->i_sb, inode, buf, count,
&okp->kp_ctxt, &target_binode);
if (ret < 0) {
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto out;
}
@@ -278,7 +277,7 @@
okp->kp_info.wl_unlock_ctxt = 1; /* re-use the write info path */
ret = ocfs2_lock_buffer_inodes(&okp->kp_ctxt, NULL);
if (ret < 0) {
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto out;
}
@@ -313,7 +312,7 @@
okp = okp_alloc(iocb);
if (IS_ERR(okp)) {
ret = PTR_ERR(okp);
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto out;
}
@@ -341,7 +340,7 @@
okp->kp_info.wl_extended = 0;
}
if (ret) {
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto out;
}
}
Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/alloc.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -30,7 +30,9 @@
#include <linux/slab.h>
#include <linux/highmem.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_DISK_ALLOC
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -46,9 +48,6 @@
#include "buffer_head_io.h"
-/* Tracing */
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_ALLOC
-
static int ocfs_extent_contig(struct inode *inode, ocfs2_extent_rec *ext,
u64 blkno);
@@ -120,7 +119,7 @@
ocfs2_extent_block *eb;
struct buffer_head *eb_bh = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
@@ -128,7 +127,7 @@
retval = ocfs_read_block(osb, fe->i_last_eb_blk, &eb_bh,
OCFS_BH_CACHED, inode);
if (retval < 0) {
- LOG_ERROR_STATUS(retval);
+ mlog_errno(retval);
goto bail;
}
eb = (ocfs2_extent_block *) eb_bh->b_data;
@@ -143,7 +142,7 @@
if (eb_bh)
brelse(eb_bh);
- LOG_EXIT_STATUS(retval);
+ mlog_exit(retval);
return retval;
}
@@ -165,7 +164,7 @@
u64 first_blkno;
ocfs2_extent_block *eb;
- LOG_ENTRY();
+ mlog_entry_void();
count = 0;
while (count < wanted) {
@@ -177,7 +176,7 @@
&num_got,
&first_blkno);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -185,7 +184,7 @@
bhs[i] = sb_getblk(osb->sb, first_blkno);
if (bhs[i] == NULL) {
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
set_buffer_uptodate(bhs[i]);
@@ -194,7 +193,7 @@
status = ocfs_journal_access(handle, inode, bhs[i],
OCFS_JOURNAL_ACCESS_CREATE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -221,7 +220,7 @@
* this isn't absolutely necessary. */
status = ocfs_journal_dirty(handle, bhs[i]);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -238,7 +237,7 @@
bhs[i] = NULL;
}
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -272,7 +271,7 @@
ocfs2_extent_list *eb_el;
ocfs2_extent_list *el;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(last_eb_bh);
@@ -294,7 +293,7 @@
new_eb_bhs = kmalloc(size, GFP_KERNEL);
if (!new_eb_bhs) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(new_eb_bhs, 0, size);
@@ -302,7 +301,7 @@
status = ocfs_create_new_meta_bhs(osb, handle, inode, new_blocks,
meta_ac, new_eb_bhs);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -323,7 +322,7 @@
status = ocfs_journal_access(handle, inode, bh,
OCFS_JOURNAL_ACCESS_CREATE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -338,7 +337,7 @@
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -354,20 +353,20 @@
status = ocfs_journal_access(handle, inode, last_eb_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_journal_access(handle, inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (eb_bh) {
status = ocfs_journal_access(handle, inode, eb_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -389,14 +388,14 @@
status = ocfs_journal_dirty(handle, last_eb_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
if (eb_bh) {
status = ocfs_journal_dirty(handle, eb_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
}
status = 0;
@@ -408,7 +407,7 @@
kfree(new_eb_bhs);
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -433,12 +432,12 @@
ocfs2_extent_list *fe_el;
ocfs2_extent_list *eb_el;
- LOG_ENTRY();
+ mlog_entry_void();
status = ocfs_create_new_meta_bhs(osb, handle, inode, 1, meta_ac,
&new_eb_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -451,7 +450,7 @@
status = ocfs_journal_access(handle, inode, new_eb_bh,
OCFS_JOURNAL_ACCESS_CREATE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -466,14 +465,14 @@
status = ocfs_journal_dirty(handle, new_eb_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_journal_access(handle, inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -496,7 +495,7 @@
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -507,7 +506,7 @@
if (new_eb_bh)
brelse(new_eb_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -532,12 +531,12 @@
ocfs2_extent_block *eb;
ocfs2_extent_list *el;
- LOG_ENTRY();
+ mlog_entry_void();
status = ocfs_journal_access(handle, inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -555,7 +554,7 @@
GFP_KERNEL);
if (!eb_bhs) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(eb_bhs, 0, sizeof(struct buffer_head *) * num_bhs);
@@ -569,7 +568,7 @@
status = ocfs_read_block(osb, next_blkno, &eb_bhs[i],
OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
eb = (ocfs2_extent_block *) eb_bhs[i]->b_data;
@@ -578,7 +577,7 @@
status = ocfs_journal_access(handle, inode, eb_bhs[i],
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -608,7 +607,7 @@
status = ocfs_journal_dirty(handle, eb_bhs[i]);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
}
OCFS_ASSERT(i == (num_bhs - 1));
/* note that the leaf block wasn't touched in
@@ -649,17 +648,17 @@
status = ocfs2_extent_map_append(inode, &el->l_recs[i],
new_clusters);
if (status) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
ocfs2_extent_map_drop(inode, fe->i_clusters);
}
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
if (fe->id2.i_list.l_tree_depth) {
status = ocfs_journal_dirty(handle, eb_bhs[num_bhs - 1]);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
}
status = 0;
@@ -671,7 +670,7 @@
kfree(eb_bhs);
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -707,7 +706,7 @@
struct buffer_head *bh = NULL;
struct buffer_head *lowest_bh = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
*target_bh = NULL;
@@ -728,7 +727,7 @@
status = ocfs_read_block(osb, blkno, &bh, OCFS_BH_CACHED,
inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -755,7 +754,7 @@
if (bh)
brelse(bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -775,11 +774,10 @@
ocfs2_extent_block *eb;
ocfs2_extent_list *el;
- LOG_ENTRY();
+ mlog_entry_void();
- LOG_TRACE_ARGS("add %u clusters starting at block %llu to inode "
- "%llu\n",new_clusters, start_blk,
- OCFS_I(inode)->ip_blkno);
+ mlog(0, "add %u clusters starting at block %llu to inode %llu\n",
+ new_clusters, start_blk, OCFS_I(inode)->ip_blkno);
fe = (ocfs2_dinode *) fe_bh->b_data;
el = &fe->id2.i_list;
@@ -789,7 +787,7 @@
status = ocfs_read_block(osb, fe->i_last_eb_blk, &last_eb_bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
goto bail;
}
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
@@ -804,13 +802,13 @@
|| ocfs_extent_contig(inode, &el->l_recs[i], start_blk))
goto out_add;
- LOG_TRACE_STR("ocfs2_allocate_extent: couldn't do a simple add, "
- "traversing tree now.\n");
+ mlog(0, "ocfs2_allocate_extent: couldn't do a simple add, traversing "
+ "tree now.\n");
shift = ocfs2_find_branch_target(osb, inode, fe_bh, &bh);
if (shift < 0) {
status = shift;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -819,9 +817,8 @@
/* if we hit a leaf, we'd better be empty :) */
OCFS_ASSERT(el->l_next_free_rec == el->l_count);
OCFS_ASSERT(!bh);
- LOG_TRACE_ARGS("ocfs2_allocate_extent: need to shift tree "
- "depth (current = %u)\n",
- fe->id2.i_list.l_tree_depth);
+ mlog(0, "ocfs2_allocate_extent: need to shift tree depth "
+ "(current = %u)\n", fe->id2.i_list.l_tree_depth);
/* ocfs2_shift_tree_depth will return us a buffer with
* the new extent block (so we can pass that to
@@ -829,7 +826,7 @@
status = ocfs2_shift_tree_depth(osb, handle, inode, fe_bh,
meta_ac, &bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
/* Special case: we have room now if we shifted from
@@ -840,11 +837,11 @@
/* call ocfs2_add_branch to add the final part of the tree with
* the new data. */
- LOG_TRACE_ARGS("ocfs2_allocate_extent: add branch. bh = %p\n", bh);
+ mlog(0, "ocfs2_allocate_extent: add branch. bh = %p\n", bh);
status = ocfs2_add_branch(osb, handle, inode, fe_bh, bh, last_eb_bh,
meta_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -853,7 +850,7 @@
status = ocfs2_do_insert_extent(osb, handle, inode, fe_bh,
start_blk, new_clusters);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
if (bh)
@@ -862,7 +859,7 @@
if (last_eb_bh)
brelse(last_eb_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -927,7 +924,7 @@
status = ocfs_read_block(osb, block, &bh, OCFS_BH_CACHED,
inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
eb = (ocfs2_extent_block *) bh->b_data;
@@ -937,7 +934,7 @@
*new_last_eb = bh;
get_bh(*new_last_eb);
- LOG_TRACE_ARGS("returning block %llu\n", le64_to_cpu(eb->h_blkno));
+ mlog(0, "returning block %llu\n", le64_to_cpu(eb->h_blkno));
bail:
if (bh)
brelse(bh);
@@ -973,7 +970,7 @@
old_last_eb_bh,
&last_eb_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (last_eb_bh)
@@ -982,7 +979,7 @@
status = ocfs_journal_access(handle, inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
el = &(fe->id2.i_list);
@@ -1026,7 +1023,7 @@
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1037,25 +1034,25 @@
status = ocfs_journal_access(handle, inode, last_eb_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
last_eb->h_next_leaf_blk = 0;
status = ocfs_journal_dirty(handle, last_eb_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
/* if our tree depth > 0, update all the tree blocks below us. */
while(depth) {
- LOG_TRACE_ARGS("traveling tree (depth = %d, next_eb = %llu)\n",
- depth, next_eb);
+ mlog(0, "traveling tree (depth = %d, next_eb = %llu)\n",
+ depth, next_eb);
status = ocfs_read_block(osb, next_eb, &eb_bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
eb = (ocfs2_extent_block *) eb_bh->b_data;
@@ -1065,7 +1062,7 @@
status = ocfs_journal_access(handle, inode, eb_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1074,11 +1071,11 @@
i = el->l_next_free_rec - 1;
- LOG_TRACE_ARGS("extent block %llu, before: record %d: "
- "(%u, %u, %llu), next = %u\n",
- le64_to_cpu(eb->h_blkno), i,
- el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
- el->l_recs[i].e_blkno, el->l_next_free_rec);
+ mlog(0, "extent block %llu, before: record %d: "
+ "(%u, %u, %llu), next = %u\n",
+ le64_to_cpu(eb->h_blkno), i,
+ el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
+ el->l_recs[i].e_blkno, el->l_next_free_rec);
OCFS_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
el->l_recs[i].e_clusters -= clusters_to_del;
@@ -1094,20 +1091,20 @@
OCFS_ASSERT(el->l_next_free_rec);
el->l_next_free_rec--;
}
- LOG_TRACE_ARGS("extent block %llu, after: record %d: "
- "(%u, %u, %llu), next = %u\n",
- le64_to_cpu(eb->h_blkno), i,
- el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
- el->l_recs[i].e_blkno, el->l_next_free_rec);
+ mlog(0, "extent block %llu, after: record %d: "
+ "(%u, %u, %llu), next = %u\n",
+ le64_to_cpu(eb->h_blkno), i,
+ el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
+ el->l_recs[i].e_blkno, el->l_next_free_rec);
status = ocfs_journal_dirty(handle, eb_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (!el->l_next_free_rec) {
- LOG_TRACE_ARGS("deleting this extent block.\n");
+ mlog(0, "deleting this extent block.\n");
OCFS_ASSERT(!eb->h_suballoc_node);
OCFS_ASSERT(!el->l_recs[0].e_clusters);
OCFS_ASSERT(!el->l_recs[0].e_cpos);
@@ -1117,7 +1114,7 @@
tc->tc_ext_alloc_bh,
eb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1131,7 +1128,7 @@
tc->tc_bitmap_bh, delete_blk,
clusters_to_del);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = 0;
@@ -1140,7 +1137,7 @@
ocfs2_extent_map_trunc(inode, fe->i_clusters);
else
ocfs2_extent_map_drop(inode, 0);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1167,7 +1164,7 @@
struct buffer_head *last_eb_bh;
ocfs_journal_handle *handle;
- LOG_ENTRY();
+ mlog_entry_void();
down_write(&OCFS_I(inode)->ip_alloc_sem);
@@ -1190,14 +1187,14 @@
el = &(fe->id2.i_list);
last_eb = fe->i_last_eb_blk;
start:
- LOG_TRACE_ARGS("ocfs_commit_truncate: fe->i_clusters = %u, "
- "last_eb = %llu, fe->i_last_eb_blk = %llu, "
- "fe->id2.i_list.l_tree_depth = %u last_eb_bh = %p\n",
- fe->i_clusters, last_eb, fe->i_last_eb_blk,
- fe->id2.i_list.l_tree_depth, last_eb_bh);
+ mlog(0, "ocfs_commit_truncate: fe->i_clusters = %u, "
+ "last_eb = %llu, fe->i_last_eb_blk = %llu, "
+ "fe->id2.i_list.l_tree_depth = %u last_eb_bh = %p\n",
+ fe->i_clusters, last_eb, fe->i_last_eb_blk,
+ fe->id2.i_list.l_tree_depth, last_eb_bh);
if (last_eb != fe->i_last_eb_blk) {
- LOG_TRACE_ARGS("last_eb changed!\n");
+ mlog(0, "last_eb changed!\n");
OCFS_ASSERT(fe->id2.i_list.l_tree_depth);
last_eb = fe->i_last_eb_blk;
/* i_last_eb_blk may have changed, read it if
@@ -1214,7 +1211,7 @@
&last_eb_bh, OCFS_BH_CACHED,
inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
@@ -1231,14 +1228,14 @@
clusters_to_del = (el->l_recs[i].e_clusters
+ el->l_recs[i].e_cpos) - target_i_clusters;
- LOG_TRACE_ARGS("clusters_to_del = %u in this pass\n", clusters_to_del);
+ mlog(0, "clusters_to_del = %u in this pass\n", clusters_to_del);
credits = ocfs_calc_tree_trunc_credits(osb->sb, clusters_to_del,
fe, el);
if (!ocfs_handle_started(handle)) {
handle = ocfs_start_trans(osb, handle, credits);
if (!handle) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
/* Since we got our cluster lock from caller and we
@@ -1248,11 +1245,11 @@
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
status = ocfs_mark_inode_dirty(handle, inode, fe_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
} else {
status = ocfs_extend_trans(handle, credits);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1260,7 +1257,7 @@
status = ocfs_do_truncate(osb, clusters_to_del, inode, fe_bh,
last_eb_bh, tc);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1275,7 +1272,7 @@
if (last_eb_bh)
brelse(last_eb_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1302,7 +1299,7 @@
struct inode *data_alloc_inode = NULL;
struct buffer_head *data_alloc_bh = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
*tc = NULL;
@@ -1310,15 +1307,15 @@
i_size_read(inode));
fe = (ocfs2_dinode *) fe_bh->b_data;
- LOG_TRACE_ARGS("fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
- "%llu\n", fe->i_clusters, new_i_clusters, fe->i_size);
+ mlog(0, "fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
+ "%llu\n", fe->i_clusters, new_i_clusters, fe->i_size);
OCFS_ASSERT(fe->i_clusters > new_i_clusters);
*tc = kmalloc(sizeof(ocfs2_truncate_context), GFP_KERNEL);
if (!(*tc)) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(*tc, 0, sizeof(ocfs2_truncate_context));
@@ -1326,7 +1323,7 @@
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1338,7 +1335,7 @@
status = ocfs_read_block(osb, fe->i_last_eb_blk,
&last_eb_bh, OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
@@ -1349,12 +1346,12 @@
}
if (metadata_delete) {
- LOG_TRACE_STR("Will have to delete metadata for this trunc. "
- "locking allocator.\n");
+ mlog(0, "Will have to delete metadata for this trunc. "
+ "locking allocator.\n");
ext_alloc_inode = ocfs_get_system_file_inode(osb, EXTENT_ALLOC_SYSTEM_INODE, 0);
if (!ext_alloc_inode) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1364,7 +1361,7 @@
&ext_alloc_bh,
1);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
}
@@ -1372,14 +1369,14 @@
data_alloc_inode = ocfs_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE, -1);
if (!data_alloc_inode) {
status = -EINVAL;
- LOG_ERROR_STR("Could not get bitmap inode!");
+ mlog(ML_ERROR, "Could not get bitmap inode!\n");
goto bail;
}
ocfs_handle_add_inode(handle, data_alloc_inode);
status = ocfs2_meta_lock(data_alloc_inode, handle, &data_alloc_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -1407,7 +1404,7 @@
ocfs_free_truncate_context(*tc);
*tc = NULL;
}
- LOG_EXIT();
+ mlog_exit_void();
return status;
}
Modified: trunk/fs/ocfs2/aops.c
===================================================================
--- trunk/fs/ocfs2/aops.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/aops.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -26,7 +26,9 @@
#include <linux/pagemap.h>
#include <asm/byteorder.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_FILE_IO
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -38,9 +40,6 @@
#include "journal.h"
#include "symlink.h"
-
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_INODE
-
static int ocfs_symlink_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{
@@ -52,34 +51,34 @@
ocfs_super *osb = OCFS_SB(inode->i_sb);
void *kaddr;
- LOG_ENTRY_ARGS("(0x%p, %llu, 0x%p, %d)\n", inode,
- (unsigned long long)iblock, bh_result, create);
+ mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
+ (unsigned long long)iblock, bh_result, create);
OCFS_ASSERT(!ocfs2_inode_is_fast_symlink(inode));
if ((iblock << inode->i_sb->s_blocksize_bits) > PATH_MAX + 1) {
- LOG_ERROR_ARGS ("block offset > PATH_MAX: %llu",
- (unsigned long long)iblock);
+ mlog(ML_ERROR, "block offset > PATH_MAX: %llu",
+ (unsigned long long)iblock);
goto bail;
}
status = ocfs_read_block(OCFS_SB(inode->i_sb), OCFS_I(inode)->ip_blkno,
&bh, OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
fe = (ocfs2_dinode *) bh->b_data;
if (!IS_VALID_FILE_ENTRY(fe)) {
- LOG_ERROR_ARGS("Invalid fe at blkno %llu",
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "Invalid fe at blkno %llu",
+ OCFS_I(inode)->ip_blkno);
goto bail;
}
if ((u64)iblock >= ocfs2_clusters_to_blocks(inode->i_sb,
fe->i_clusters)) {
- LOG_ERROR_ARGS ("block offset is outside the allocated size: %llu",
+ mlog(ML_ERROR, "block offset is outside the allocated size: %llu",
(unsigned long long)iblock);
goto bail;
}
@@ -90,7 +89,7 @@
buffer_cache_bh = sb_getblk(osb->sb,
fe->id2.i_list.l_recs[0].e_blkno + iblock);
if (!buffer_cache_bh) {
- LOG_ERROR_STR("couldn't getblock for symlink!");
+ mlog(ML_ERROR, "couldn't getblock for symlink!\n");
goto bail;
}
@@ -102,7 +101,7 @@
&& ocfs_inode_is_new(inode)) {
kaddr = kmap_atomic(bh_result->b_page, KM_USER0);
if (!kaddr) {
- LOG_ERROR_ARGS("couldn't kmap!\n");
+ mlog(ML_ERROR, "couldn't kmap!\n");
goto bail;
}
memcpy(kaddr + (bh_result->b_size * iblock),
@@ -123,7 +122,7 @@
if (bh)
brelse(bh);
- LOG_EXIT_INT (err);
+ mlog_exit (err);
return err;
}
@@ -134,12 +133,12 @@
u64 vbo = 0;
u64 p_blkno;
- LOG_ENTRY_ARGS("(0x%p, %llu, 0x%p, %d)\n", inode,
- (unsigned long long)iblock, bh_result, create);
+ mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
+ (unsigned long long)iblock, bh_result, create);
if (OCFS_I(inode)->ip_flags & OCFS_INODE_SYSTEM_FILE) {
- printk("get_block on system inode 0x%p (%lu)\n",
- inode, inode->i_ino);
+ mlog(ML_NOTICE, "get_block on system inode 0x%p (%lu)\n",
+ inode, inode->i_ino);
}
if (S_ISLNK(inode->i_mode)) {
@@ -166,10 +165,9 @@
NULL);
if (err) {
- LOG_ERROR_ARGS("Error %d from get_blocks(0x%p, %llu, 1, %llu, NULL)\n",
- err,
- inode, (unsigned long long)iblock,
- p_blkno);
+ mlog(ML_ERROR, "Error %d from get_blocks(0x%p, %llu, 1, %llu, "
+ "NULL)\n", err, inode, (unsigned long long)iblock,
+ p_blkno);
goto bail;
}
@@ -179,9 +177,9 @@
if (bh_result->b_blocknr == 0) {
err = -EIO;
- LOG_ERROR_ARGS ("iblock = %llu p_blkno = %llu blkno=(%llu)\n",
- (unsigned long long)iblock, p_blkno,
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "iblock = %llu p_blkno = %llu blkno=(%llu)\n",
+ (unsigned long long)iblock, p_blkno,
+ OCFS_I(inode)->ip_blkno);
}
if (vbo < OCFS_I(inode)->ip_mmu_private)
@@ -189,11 +187,11 @@
if (!create)
goto bail;
if (vbo != OCFS_I(inode)->ip_mmu_private) {
- LOG_ERROR_ARGS("Uh-oh, vbo = %lld, i_size = %llu, mmu = %llu, "
- "inode = %llu\n",
- vbo, i_size_read(inode),
- OCFS_I(inode)->ip_mmu_private,
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "Uh-oh, vbo = %lld, i_size = %llu, mmu = %llu, "
+ "inode = %llu\n",
+ vbo, i_size_read(inode),
+ OCFS_I(inode)->ip_mmu_private,
+ OCFS_I(inode)->ip_blkno);
BUG();
err = -EIO;
goto bail;
@@ -207,7 +205,7 @@
if (err < 0)
err = -EIO;
- LOG_EXIT_INT (err);
+ mlog_exit (err);
return err;
}
@@ -215,11 +213,11 @@
{
int ret;
- LOG_ENTRY_ARGS("(0x%p, %lu)\n", file, (page ? page->index : 0));
+ mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0));
ret = block_read_full_page(page, ocfs_get_block);
- LOG_EXIT_INT(ret);
+ mlog_exit(ret);
return ret;
}
@@ -229,11 +227,11 @@
{
int ret;
- LOG_ENTRY_ARGS("(0x%p)\n", page);
+ mlog_entry("(0x%p)\n", page);
ret = block_write_full_page(page, ocfs_get_block, wbc);
- LOG_EXIT_INT(ret);
+ mlog_exit(ret);
return ret;
}
@@ -242,11 +240,11 @@
{
int ret;
- LOG_ENTRY_ARGS("(0x%p)\n", page);
+ mlog_entry("(0x%p)\n", page);
ret = block_write_full_page(page, ocfs_get_block);
- LOG_EXIT_INT(ret);
+ mlog_exit(ret);
return ret;
}
@@ -395,12 +393,12 @@
{
int ret;
- LOG_ENTRY_ARGS("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
+ mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
ret = cont_prepare_write(page, from, to, ocfs_get_block,
&(OCFS_I(page->mapping->host)->ip_mmu_private));
- LOG_EXIT_INT(ret);
+ mlog_exit(ret);
return ret;
}
@@ -414,11 +412,11 @@
{
int ret;
- LOG_ENTRY_ARGS("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
+ mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
ret = generic_commit_write(file, page, from, to);
- LOG_EXIT_INT(ret);
+ mlog_exit(ret);
return ret;
}
@@ -439,21 +437,21 @@
int err = 0;
struct inode *inode = mapping->host;
- LOG_ENTRY_ARGS("(block = %llu)\n", (unsigned long long)block);
+ mlog_entry("(block = %llu)\n", (unsigned long long)block);
if (!INODE_JOURNAL(inode)) {
- LOG_ERROR_STR("bmap is only for journal inodes!");
+ mlog(ML_ERROR, "bmap is only for journal inodes!\n");
err = -EINVAL;
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
err = ocfs2_extent_map_get_blocks(inode, block, 1, &p_blkno,
NULL);
if (err) {
- LOG_ERROR_ARGS("get_blocks() failed, block = %llu\n",
- (unsigned long long)block);
- LOG_ERROR_STATUS(err);
+ mlog(ML_ERROR, "get_blocks() failed, block = %llu\n",
+ (unsigned long long)block);
+ mlog_errno(err);
goto bail;
}
@@ -466,7 +464,7 @@
status = err ? err : (int)p_blkno;
#endif
- LOG_EXIT_STATUS((int)status);
+ mlog_exit((int)status);
return status;
}
@@ -500,7 +498,7 @@
unsigned char blocksize_bits;
if (!inode || !bh_result) {
- LOG_ERROR_STR("inode or bh_result is null");
+ mlog(ML_ERROR, "inode or bh_result is null\n");
return -EIO;
}
@@ -527,8 +525,8 @@
ret = ocfs2_extent_map_get_blocks(inode, iblock, 1, &p_blkno,
&contig_blocks);
if (ret) {
- LOG_ERROR_ARGS("get_blocks() failed iblock=%llu\n",
- (unsigned long long)iblock);
+ mlog(ML_ERROR, "get_blocks() failed iblock=%llu\n",
+ (unsigned long long)iblock);
ret = -EIO;
goto bail;
}
@@ -564,14 +562,14 @@
struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
int ret;
- LOG_ENTRY ();
+ mlog_entry_void ();
/* blockdev_direct_IO checks alignment for us, using */
ret = blockdev_direct_IO_no_locking(rw, iocb, inode,
inode->i_sb->s_bdev, iov, offset,
nr_segs, ocfs_direct_IO_get_blocks,
NULL);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_direct_IO */
Modified: trunk/fs/ocfs2/buffer_head_io.c
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/buffer_head_io.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -30,7 +30,8 @@
#include <linux/slab.h>
#include <linux/highmem.h>
-#include "ocfs_log.h"
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -39,16 +40,14 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_IO
-
void ocfs_end_buffer_io_sync(struct buffer_head *bh,
int uptodate)
{
-// LOG_ENTRY_ARGS("(bh->b_blocknr = %u, uptodate = %d)\n", bh->b_blocknr,
+// mlog_entry("(bh->b_blocknr = %u, uptodate = %d)\n", bh->b_blocknr,
// uptodate);
if (!uptodate)
- LOG_ERROR_STATUS(-EIO);
+ mlog_errno(-EIO);
if (uptodate)
set_buffer_uptodate(bh);
@@ -56,7 +55,7 @@
clear_buffer_uptodate(bh);
unlock_buffer(bh);
-// LOG_EXIT();
+// mlog_exit_void();
}
int ocfs_write_blocks (ocfs_super *osb, struct buffer_head *bhs[],
@@ -66,28 +65,16 @@
int i;
struct super_block *sb;
struct buffer_head *bh;
-
-#ifdef OCFS_DBG_TIMING
- my_timing_t begin, end;
-#endif
- LOG_ENTRY_ARGS("(bh[0]->b_blocknr = %llu, nr=%d, inode=%p)\n",
+ mlog_entry("(bh[0]->b_blocknr = %llu, nr=%d, inode=%p)\n",
(unsigned long long)bhs[0]->b_blocknr, nr, inode);
-#ifdef OCFS_DBG_TIMING
- rdtsc (begin.lohi[0], begin.lohi[1]);
-#endif
if (osb == NULL || osb->sb == NULL || bhs == NULL) {
- LOG_TRACE_STR("osb == NULL || osb->sb == NULL || bhs == "
- "NULL");
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
- if (nr > 256)
- LOG_TRACE_ARGS ("Getting write for %u blocks\n", nr);
-
sb = osb->sb;
if (inode)
@@ -97,22 +84,21 @@
if (bh == NULL) {
if (inode)
up(&OCFS_I(inode)->ip_io_sem);
- LOG_TRACE_STR("bh == NULL");
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (unlikely(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO)) {
BUG();
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (unlikely(buffer_jbd(bh))) {
/* What are you thinking?! */
- printk("ocfs2: trying to write a jbd managed bh "
+ mlog(ML_ERROR, "trying to write a jbd managed bh "
"(blocknr = %llu), nr=%d\n",
(unsigned long long)bh->b_blocknr, nr);
BUG();
@@ -153,11 +139,7 @@
bail:
-#ifdef OCFS_DBG_TIMING
- IO_FUNC_TIMING_PRINT("ocfs_write_block", status);
-#endif
-
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -174,32 +156,24 @@
int i, ignore_cache = 0;
struct buffer_head *bh;
-#ifdef OCFS_DBG_TIMING
- my_timing_t begin, end;
-#endif
- LOG_ENTRY_ARGS("(block=(%llu), nr=(%d), flags=%d, inode=%p)\n",
+ mlog_entry("(block=(%llu), nr=(%d), flags=%d, inode=%p)\n",
block, nr, flags, inode);
-#ifdef OCFS_DBG_TIMING
- rdtsc (begin.lohi[0], begin.lohi[1]);
-#endif
if (osb == NULL || osb->sb == NULL || bhs == NULL) {
- LOG_TRACE_STR("osb == NULL || osb->sb == NULL || bhs == NULL "
- "|| num == NULL");
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (nr < 0) {
- printk("ocfs2: asked to read %d blocks!\n", nr);
+ mlog(ML_ERROR, "asked to read %d blocks!\n", nr);
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (nr == 0) {
- LOG_TRACE_STR("No buffers will be read!!!");
+ mlog(ML_BH_IO, "No buffers will be read!\n");
status = 0;
goto bail;
}
@@ -214,9 +188,8 @@
if (bhs[i] == NULL) {
if (inode)
up(&OCFS_I(inode)->ip_io_sem);
- LOG_TRACE_STR("bh == NULL");
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -225,13 +198,11 @@
if (flags & OCFS_BH_CACHED && inode &&
!TEST_BH_SEQNUM(inode, bh)) {
-#ifdef VERBOSE_BH_SEQNUM_TRACE
- LOG_TRACE_ARGS("(read) bh (%llu) seqnum (%lu) does "
- "not match inode (%u)\n",
- (unsigned long long)bh->b_blocknr,
- (bh->b_state & STATE_BIT_MASK) >> 19,
- atomic_read(GET_INODE_CLEAN_SEQ(inode)));
-#endif
+ mlog(ML_SEQNUM, "(read) bh (%llu) seqnum (%lu) does "
+ "not match inode (%u)\n",
+ (unsigned long long)bh->b_blocknr,
+ (bh->b_state & STATE_BIT_MASK) >> 19,
+ atomic_read(GET_INODE_CLEAN_SEQ(inode)));
ignore_cache = 1;
}
@@ -239,12 +210,10 @@
ignore_cache = 1;
if (buffer_jbd(bh)) {
-#ifdef VERBOSE_BH_JBD_TRACE
if (!(flags & OCFS_BH_CACHED) || ignore_cache)
- LOG_TRACE_ARGS("trying to sync read a jbd "
- "managed bh (blocknr = %llu)\n",
- (unsigned long long)bh->b_blocknr);
-#endif
+ mlog(ML_BH_IO, "trying to sync read a jbd "
+ "managed bh (blocknr = %llu)\n",
+ (unsigned long long)bh->b_blocknr);
continue;
}
@@ -252,18 +221,18 @@
if (buffer_dirty(bh)) {
/* This should probably be a BUG, or
* at least return an error. */
- LOG_TRACE_ARGS("asking me to sync read a "
- "dirty buffer! (blocknr = %llu)\n",
- (unsigned long long)bh->b_blocknr);
+ mlog(ML_BH_IO, "asking me to sync read a "
+ "dirty buffer! (blocknr = %llu)\n",
+ (unsigned long long)bh->b_blocknr);
continue;
}
lock_buffer(bh);
if (buffer_jbd(bh)) {
#ifdef CATCH_BH_JBD_RACES
- printk("Ugh, block %llu had the JBD bit set "
- "while I was in lock_buffer!",
- (unsigned long long)bh->b_blocknr);
+ mlog(ML_ERROR, "block %llu had the JBD bit "
+ "set while I was in lock_buffer!",
+ (unsigned long long)bh->b_blocknr);
BUG();
#else
unlock_buffer(bh);
@@ -301,15 +270,11 @@
if (inode)
up(&OCFS_I(inode)->ip_io_sem);
- LOG_TRACE_ARGS("block=(%llu), nr=(%d), cached=%s\n", block, nr,
- (!(flags & OCFS_BH_CACHED) || ignore_cache) ? "no" : "yes");
+ mlog(ML_BH_IO, "block=(%llu), nr=(%d), cached=%s\n", block, nr,
+ (!(flags & OCFS_BH_CACHED) || ignore_cache) ? "no" : "yes");
bail:
-#ifdef OCFS_DBG_TIMING
- IO_FUNC_TIMING_PRINT("ocfs_read_blocks", status);
-#endif
-
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
Modified: trunk/fs/ocfs2/buffer_head_io.h
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.h 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/buffer_head_io.h 2005-04-26 00:43:42 UTC (rev 2172)
@@ -123,52 +123,13 @@
return ret;
}
-#define OCFS_PRINT_FE_SIZE(bh) \
-do { \
- if (bh) { \
- ocfs2_dinode *__fe = bh->b_data; \
- if (IS_VALID_FILE_ENTRY(__fe)) { \
- printk("ocfs2: %s:%d fe_check: file_size = (%llu), " \
- "this_sector = (%llu)\n", \
- __FUNCTION__, __LINE__, \
- __fe->file_size, \
- __fe->this_sector); \
- } \
- } \
-} while(0)
-
-/* check the 1st five bytes. */
-static inline int ocfs_poison(struct buffer_head *bh)
-{
- int i;
- for(i = 0; i < 512; i++)
- if ((bh)->b_data[i] != 'P')
- return 0;
- return 1;
-}
-
-#define OCFS_DO_HEX_DUMP(bh) \
-do { \
- printk("bh->b_blocknr = %lu, bh->b_data:\n", bh->b_blocknr); \
- for(i = 0; i < 512; i++) { \
- printk("%03x ", bh->b_data[i]); \
- if ( ((i+1) % 16) == 0 ) \
- printk("\n"); \
- } \
- printk("\n"); \
-} while (0)
-
static inline int ocfs_write_block (ocfs_super * osb, struct buffer_head *bh,
struct inode *inode)
{
int status;
-
- IO_FUNC_TIMING_DECL
status = ocfs_write_blocks (osb, &bh, 1, inode);
- IO_FUNC_TIMING_PRINT("ocfs_write_block", status);
-
return status;
}
@@ -178,8 +139,6 @@
{
int status = 0;
- IO_FUNC_TIMING_DECL
-
if (bh == NULL) {
printk("ocfs2: bh == NULL\n");
status = -EINVAL;
@@ -190,7 +149,6 @@
flags, inode);
bail:
- IO_FUNC_TIMING_PRINT("ocfs_read_block", status);
return status;
}
Modified: trunk/fs/ocfs2/cluster/masklog.c
===================================================================
--- trunk/fs/ocfs2/cluster/masklog.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/cluster/masklog.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -180,7 +180,6 @@
set_a_string(TCP);
set_a_string(MSG);
set_a_string(SOCKET);
- set_a_string(AIO);
set_a_string(HEARTBEAT);
set_a_string(HB_BIO);
set_a_string(DLMFS);
@@ -189,6 +188,17 @@
set_a_string(DLM_THREAD);
set_a_string(DLM_MASTER);
set_a_string(DLM_RECOVERY);
+ set_a_string(AIO);
+ set_a_string(JOURNAL);
+ set_a_string(DISK_ALLOC);
+ set_a_string(SUPER);
+ set_a_string(FILE_IO);
+ set_a_string(EXTENT_MAP);
+ set_a_string(DLM_GLUE);
+ set_a_string(BH_IO);
+ set_a_string(SEQNUM);
+ set_a_string(NAMEI);
+ set_a_string(INODE);
set_a_string(ERROR);
set_a_string(NOTICE);
set_a_string(KTHREAD);
Modified: trunk/fs/ocfs2/cluster/masklog.h
===================================================================
--- trunk/fs/ocfs2/cluster/masklog.h 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/cluster/masklog.h 2005-04-26 00:43:42 UTC (rev 2172)
@@ -85,15 +85,25 @@
#define ML_TCP 0x0000000000000004ULL /* cluster/tcp.c */
#define ML_MSG 0x0000000000000008ULL /* network messages */
#define ML_SOCKET 0x0000000000000010ULL /* socket lifetime */
-#define ML_AIO 0x0000000000000020ULL /* aio read and write */
-#define ML_HEARTBEAT 0x0000000000000040ULL /* cluster heartbeat */
-#define ML_HB_BIO 0x0000000000000080ULL /* heartbaet io tracing */
-#define ML_DLMFS 0x0000000000000100ULL /* ocfs2_dlmfs */
-#define ML_DLM 0x0000000000000200ULL /* dlm general debugging */
-#define ML_DLM_DOMAIN 0x0000000000000400ULL /* dlm domain debugging */
-#define ML_DLM_THREAD 0x0000000000000800ULL /* dlm domain thread */
-#define ML_DLM_MASTER 0x0000000000001000ULL /* dlm master functions */
-#define ML_DLM_RECOVERY 0x0000000000002000ULL /* dlm master functions */
+#define ML_HEARTBEAT 0x0000000000000020ULL /* cluster heartbeat */
+#define ML_HB_BIO 0x0000000000000040ULL /* heartbaet io tracing */
+#define ML_DLMFS 0x0000000000000080ULL /* ocfs2_dlmfs */
+#define ML_DLM 0x0000000000000100ULL /* dlm general debugging */
+#define ML_DLM_DOMAIN 0x0000000000000200ULL /* dlm domain debugging */
+#define ML_DLM_THREAD 0x0000000000000400ULL /* dlm domain thread */
+#define ML_DLM_MASTER 0x0000000000000800ULL /* dlm master functions */
+#define ML_DLM_RECOVERY 0x0000000000001000ULL /* dlm master functions */
+#define ML_AIO 0x0000000000002000ULL /* ocfs2 aio read and write */
+#define ML_JOURNAL 0x0000000000004000ULL /* ocfs2 journalling functions */
+#define ML_DISK_ALLOC 0x0000000000008000ULL /* ocfs2 disk allocation */
+#define ML_SUPER 0x0000000000010000ULL /* ocfs2 mount / umount */
+#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_SEQNUM 0x0000000000200000ULL /* ocfs2 caching sequence #'s */
+#define ML_NAMEI 0x0000000000400000ULL /* ocfs2 directory / namespace */
+#define ML_INODE 0x0000000000800000ULL /* ocfs2 inode manipulation */
/* bits that are infrequently given and frequently matched in the high word */
#define ML_ERROR 0x0000000100000000ULL /* sent to KERN_ERR */
#define ML_NOTICE 0x0000000200000000ULL /* setn to KERN_NOTICE */
@@ -187,9 +197,7 @@
} while (0)
#define mlog_exit(st) do { \
- if (__builtin_types_compatible_p(typeof(st), void *)) \
- mlog(ML_EXIT, "EXIT: %p\n", (void *) (unsigned long) (st)); \
- else if (__builtin_types_compatible_p(typeof(st), unsigned long)) \
+ 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)); \
@@ -207,8 +215,12 @@
mlog(ML_EXIT, "EXIT: %llu\n", (unsigned long long) (st)); \
} while (0)
+#define mlog_exit_ptr(ptr) do { \
+ mlog(ML_EXIT, "EXIT: %p\n", ptr); \
+} while (0)
+
#define mlog_exit_void() do { \
- mlog(ML_EXIT, "EXIT"); \
+ mlog(ML_EXIT, "EXIT\n"); \
} while (0)
#include <linux/proc_fs.h>
Modified: trunk/fs/ocfs2/dcache.c
===================================================================
--- trunk/fs/ocfs2/dcache.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/dcache.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -32,23 +32,22 @@
#include <linux/namei.h>
#endif
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_NAMEI
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "alloc.h"
#include "dcache.h"
#include "file.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_DCACHE
-
-
static int ocfs_dentry_revalidate24(struct dentry *dentry, int flags)
{
struct inode *inode = dentry->d_inode;
int ret = 0; /* if all else fails, just return false */
ocfs_super *osb;
- LOG_ENTRY_ARGS ("(0x%p, %d, '%.*s')\n", dentry, flags,
+ mlog_entry ("(0x%p, %d, '%.*s')\n", dentry, flags,
dentry->d_name.len, dentry->d_name.name);
if (inode == NULL)
@@ -67,25 +66,23 @@
/* did we or someone else delete this inode? */
if (INODE_DELETED(inode)) {
spin_unlock(&OCFS_I(inode)->ip_lock);
- LOG_TRACE_ARGS("dentry_revalidate: inode (%llu) deleted, "
- "returning false\n",
- OCFS_I(inode)->ip_blkno);
+ mlog(0, "inode (%llu) deleted, returning false\n",
+ OCFS_I(inode)->ip_blkno);
goto bail;
}
spin_unlock(&OCFS_I(inode)->ip_lock);
#warning "should we do this for all files?"
if (S_ISDIR(inode->i_mode) && (!inode->i_nlink)) {
- LOG_TRACE_ARGS("dentry_revalidate: dir inode (%llu) orphaned, "
- "returning false\n",
- OCFS_I(inode)->ip_blkno);
+ mlog(0, "dir inode (%llu) orphaned, returning false\n",
+ OCFS_I(inode)->ip_blkno);
goto bail;
}
ret = 1;
bail:
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
}
Modified: trunk/fs/ocfs2/dir.c
===================================================================
--- trunk/fs/ocfs2/dir.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/dir.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -43,7 +43,9 @@
#include <linux/slab.h>
#include <linux/highmem.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_NAMEI
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -59,8 +61,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_DIR
-
static unsigned char ocfs_filetype_table[] = {
DT_UNKNOWN, DT_REG, DT_DIR, DT_CHR, DT_BLK, DT_FIFO, DT_SOCK, DT_LNK
};
@@ -85,14 +85,14 @@
struct super_block * sb = inode->i_sb;
int have_disk_lock = 0;
- LOG_ENTRY_ARGS("dirino=%llu\n", OCFS_I(inode)->ip_blkno);
+ mlog_entry("dirino=%llu\n", OCFS_I(inode)->ip_blkno);
stored = 0;
bh = NULL;
error = ocfs2_meta_lock(inode, NULL, NULL, 0);
if (error < 0) {
- LOG_ERROR_STATUS(error);
+ mlog_errno(error);
/* we haven't got any yet, so propagate the error. */
stored = error;
goto bail;
@@ -105,9 +105,9 @@
blk = (filp->f_pos) >> sb->s_blocksize_bits;
bh = ocfs_bread (inode, blk, &err, 0);
if (!bh) {
- LOG_ERROR_ARGS ("directory #%llu contains a hole at offset %lu\n",
- OCFS_I(inode)->ip_blkno,
- (unsigned long)filp->f_pos);
+ mlog(ML_ERROR, "directory #%llu contains a hole at "
+ "offset %lu\n", OCFS_I(inode)->ip_blkno,
+ (unsigned long)filp->f_pos);
filp->f_pos += sb->s_blocksize - offset;
continue;
}
@@ -199,7 +199,7 @@
if (have_disk_lock)
ocfs2_meta_unlock(inode, 0);
- LOG_EXIT_STATUS(stored);
+ mlog_exit(stored);
return stored;
}
@@ -218,7 +218,7 @@
int status = -ENOENT;
int lock_acq = 0;
- LOG_ENTRY_ARGS ("(osb=%p, parent=%llu, name='%.*s', blkno=%p, inode=%p)\n",
+ mlog_entry ("(osb=%p, parent=%llu, name='%.*s', blkno=%p, inode=%p)\n",
osb, OCFS_I(inode)->ip_blkno, namelen, name, blkno, inode);
if (take_lock) {
@@ -226,7 +226,7 @@
status = ocfs2_meta_lock(inode, NULL, NULL, 0);
if (status < 0) {
/* Volume should be disabled in this case */
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
lock_acq = 1;
@@ -254,7 +254,7 @@
}
}
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_find_files_on_disk */
@@ -274,8 +274,8 @@
if ((i_size_read(inode) <
(OCFS2_DIR_REC_LEN(1) + OCFS2_DIR_REC_LEN(2))) ||
!(bh = ocfs_bread (inode, 0, &err, 0))) {
- LOG_ERROR_ARGS ("bad directory (dir #%llu) - no data block\n",
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "bad directory (dir #%llu) - no data block\n",
+ OCFS_I(inode)->ip_blkno);
return 1;
}
@@ -286,8 +286,8 @@
!le64_to_cpu(de1->inode) ||
strcmp (".", de->name) ||
strcmp ("..", de1->name)) {
- LOG_ERROR_ARGS ("bad directory (dir #%llu) - no `.' or `..'\n",
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "bad directory (dir #%llu) - no `.' or `..'\n",
+ OCFS_I(inode)->ip_blkno);
brelse (bh);
return 1;
}
@@ -299,8 +299,9 @@
bh = ocfs_bread(inode,
offset >> sb->s_blocksize_bits, &err, 0);
if (!bh) {
- LOG_ERROR_ARGS ("directory #%llu contains a hole at offset %lu\n",
- OCFS_I(inode)->ip_blkno, offset);
+ mlog(ML_ERROR, "directory #%llu contains a "
+ "hole at offset %lu\n",
+ OCFS_I(inode)->ip_blkno, offset);
offset += sb->s_blocksize;
continue;
}
@@ -345,7 +346,7 @@
data_ac, meta_ac, NULL);
OCFS_ASSERT(status != -EAGAIN);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -353,19 +354,19 @@
status = ocfs2_extent_map_get_blocks(dir, dir->i_blocks, 1,
&p_blkno, NULL);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
*new_bh = sb_getblk(sb, p_blkno);
if (!*new_bh) {
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -386,16 +387,16 @@
struct ocfs2_dir_entry * de;
struct super_block *sb = osb->sb;
- LOG_ENTRY();
+ mlog_entry_void();
dir_i_size = i_size_read(dir);
- LOG_TRACE_ARGS("extending dir %llu (i_size = %llu)\n",
- OCFS_I(dir)->ip_blkno, dir_i_size);
+ mlog(0, "extending dir %llu (i_size = %llu)\n", OCFS_I(dir)->ip_blkno,
+ dir_i_size);
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -406,7 +407,7 @@
num_free_extents = ocfs_num_free_extents(osb, dir, fe);
if (num_free_extents < 0) {
status = num_free_extents;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -414,14 +415,14 @@
status = ocfs_reserve_new_metadata(osb, handle,
fe, &meta_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
status = ocfs_reserve_clusters(osb, handle, 1, &data_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -434,14 +435,14 @@
handle = ocfs_start_trans(osb, handle, credits);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_do_extend_dir(osb->sb, handle, dir, parent_fe_bh,
data_ac, meta_ac, &new_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -450,7 +451,7 @@
status = ocfs_journal_access(handle, dir, new_bh,
OCFS_JOURNAL_ACCESS_CREATE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(new_bh->b_data, 0, sb->s_blocksize);
@@ -459,7 +460,7 @@
de->rec_len = le16_to_cpu(sb->s_blocksize);
status = ocfs_journal_dirty(handle, new_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -468,7 +469,7 @@
dir->i_blocks += 1;
status = ocfs_mark_inode_dirty(handle, dir, parent_fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -486,7 +487,7 @@
if (new_bh)
brelse(new_bh);
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_extend_dir */
@@ -509,10 +510,10 @@
struct super_block * sb;
int status;
- LOG_ENTRY();
+ mlog_entry_void();
- LOG_TRACE_ARGS("getting ready to insert namelen %d into dir %llu\n",
- namelen, OCFS_I(dir)->ip_blkno);
+ mlog(0, "getting ready to insert namelen %d into dir %llu\n",
+ namelen, OCFS_I(dir)->ip_blkno);
OCFS_ASSERT(S_ISDIR(dir->i_mode));
fe = (ocfs2_dinode *) parent_fe_bh->b_data;
@@ -522,13 +523,13 @@
if (!namelen) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bh = ocfs_bread (dir, 0, &status, 0);
if (!bh) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -546,7 +547,7 @@
parent_fe_bh,
&bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
OCFS_ASSERT(bh);
@@ -559,7 +560,7 @@
&status,
0);
if (!bh) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
/* move to next block */
@@ -592,6 +593,6 @@
bail:
if (bh)
brelse(bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/dlmglue.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -39,7 +39,9 @@
#include <dlm/dlmapi.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_DLM_GLUE
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -54,15 +56,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_DLMGLUE
-
-#ifdef VERBOSE_LOCKING_TRACE
-#define dprintk(str, args...) \
- printk("(%d) %s:%d " str, current->pid, __FUNCTION__, __LINE__, ##args)
-#else
-#define dprintk(str, args...)
-#endif
-
/* lock ids are made up in the following manner:
* name[0] --> type
* name[1-6] --> 6 pad characters, reserved for now
@@ -224,7 +217,7 @@
unsigned int lvb_seq;
int ret = 0;
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&lockres->l_lock);
@@ -235,7 +228,7 @@
spin_unlock(&lockres->l_lock);
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
@@ -244,7 +237,7 @@
ocfs2_lvb *lvb = (ocfs2_lvb *) lockres->l_lksb.lvb;
unsigned int lvb_seq;
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&lockres->l_lock);
@@ -254,7 +247,7 @@
spin_unlock(&lockres->l_lock);
- LOG_EXIT();
+ mlog_exit_void();
}
/* fill in new values as we add them to the lvb. */
@@ -263,7 +256,7 @@
{
ocfs2_meta_lvb *lvb;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(lockres->l_type == OCFS_TYPE_META);
@@ -276,7 +269,7 @@
spin_unlock(&lockres->l_lock);
- LOG_EXIT();
+ mlog_exit_void();
}
static int ocfs2_build_lock_name(enum ocfs2_lock_type type,
@@ -287,7 +280,7 @@
int len;
char *name = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(type < OCFS_NUM_LOCK_TYPES);
@@ -304,11 +297,11 @@
OCFS_ASSERT(len == (OCFS2_LOCK_ID_MAX_LEN - 1));
- dprintk("built lock resource with name: %s\n", name);
+ mlog(0, "built lock resource with name: %s\n", name);
*ret = name;
bail:
- LOG_EXIT();
+ mlog_exit_void();
return len;
}
@@ -332,7 +325,7 @@
{
int status;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(type == OCFS_TYPE_META ||
type == OCFS_TYPE_DATA);
@@ -349,12 +342,12 @@
inode->i_generation,
&res->l_name);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -364,7 +357,7 @@
enum ocfs2_lock_type type = OCFS_TYPE_SUPER;
int status;
- LOG_ENTRY();
+ mlog_entry_void();
ocfs2_lock_res_init_common(res, type, osb);
@@ -375,27 +368,27 @@
0,
&res->l_name);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
void ocfs2_lock_res_free(ocfs2_lock_res *res)
{
- LOG_ENTRY();
+ mlog_entry_void();
if (res->l_name)
kfree(res->l_name);
- LOG_EXIT();
+ mlog_exit_void();
}
static inline void ocfs2_inc_holders(ocfs2_lock_res *lockres,
int level)
{
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(lockres);
@@ -409,13 +402,13 @@
default:
BUG();
}
- LOG_EXIT();
+ mlog_exit_void();
}
static inline void ocfs2_dec_holders(ocfs2_lock_res *lockres,
int level)
{
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(lockres);
@@ -431,7 +424,7 @@
default:
BUG();
}
- LOG_EXIT();
+ mlog_exit_void();
}
/* WARNING: This function lives in a world where the only three lock
@@ -483,7 +476,7 @@
static inline void ocfs2_generic_handle_downconvert_action(ocfs2_lock_res *lockres)
{
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_ATTACHED);
@@ -498,7 +491,7 @@
}
lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
- LOG_EXIT();
+ mlog_exit_void();
}
static void ocfs2_inc_inode_seq(ocfs_super *osb,
@@ -506,12 +499,11 @@
{
atomic_t *seq;
- LOG_ENTRY();
+ mlog_entry_void();
seq = GET_INODE_CLEAN_SEQ(inode);
- LOG_TRACE_ARGS("incrementing inode seq... current is %d\n",
- atomic_read(seq));
+ mlog(0, "incrementing inode seq... current is %d\n", atomic_read(seq));
/* wrap to ONE after 13 bits, will need a spinlock */
spin_lock (&osb->clean_buffer_lock);
@@ -525,15 +517,15 @@
/* has already incremented the global seq */
atomic_set(seq, atomic_read(&osb->clean_buffer_seq));
- LOG_TRACE_ARGS("done incrementing inode seq... new is %d\n",
- atomic_read(seq));
+ mlog(0, "done incrementing inode seq... new is %d\n",
+ atomic_read(seq));
- LOG_EXIT();
+ mlog_exit_void();
}
static inline void ocfs2_generic_handle_convert_action(ocfs2_lock_res *lockres)
{
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_ATTACHED);
@@ -547,7 +539,7 @@
lockres->l_level = lockres->l_requested;
lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
- LOG_EXIT();
+ mlog_exit_void();
}
static inline void ocfs2_handle_meta_convert_action(struct inode *inode,
@@ -555,19 +547,19 @@
{
ocfs_super *osb = OCFS2_SB(inode->i_sb);
- LOG_ENTRY();
+ mlog_entry_void();
/* generic_handle_convert_action will set the refresh flag for us. */
if (lockres->l_level == LKM_NLMODE)
ocfs2_inc_inode_seq(osb, inode);
ocfs2_generic_handle_convert_action(lockres);
- LOG_EXIT();
+ mlog_exit_void();
}
static inline void ocfs2_generic_handle_attach_action(ocfs2_lock_res *lockres)
{
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
OCFS_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
@@ -580,7 +572,7 @@
lockres_or_flags(lockres, OCFS2_LOCK_ATTACHED);
lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
- LOG_EXIT();
+ mlog_exit_void();
}
static void ocfs2_inode_ast_func(void *opaque)
@@ -590,14 +582,14 @@
ocfs_super *osb;
dlm_lockstatus *lksb;
- LOG_ENTRY();
+ mlog_entry_void();
inode = ocfs2_lock_res_inode(lockres);
osb = OCFS2_SB(inode->i_sb);
- dprintk("AST fired for inode %llu, l_action = %u, type = %s\n",
- OCFS_I(inode)->ip_blkno, lockres->l_action,
- (lockres->l_type == OCFS_TYPE_META) ? "Meta" : "Data");
+ mlog(0, "AST fired for inode %llu, l_action = %u, type = %s\n",
+ OCFS_I(inode)->ip_blkno, lockres->l_action,
+ (lockres->l_type == OCFS_TYPE_META) ? "Meta" : "Data");
OCFS_ASSERT(ocfs2_is_inode_lock(lockres));
@@ -607,11 +599,11 @@
lksb = &(lockres->l_lksb);
if (lksb->status != DLM_NORMAL) {
- LOG_ERROR_ARGS("ocfs2_inode_ast_func: lksb status value of %u "
- "on inode %llu\n", lksb->status,
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "ocfs2_inode_ast_func: lksb status value of %u "
+ "on inode %llu\n", lksb->status,
+ OCFS_I(inode)->ip_blkno);
spin_unlock(&lockres->l_lock);
- LOG_EXIT();
+ mlog_exit_void();
return;
}
@@ -648,13 +640,13 @@
spin_unlock(&lockres->l_lock);
wake_up(&lockres->l_event);
- LOG_EXIT();
+ mlog_exit_void();
}
static int ocfs2_generic_handle_bast(ocfs2_lock_res *lockres, int level)
{
int needs_downconvert = 0;
- LOG_ENTRY();
+ mlog_entry_void();
assert_spin_locked(&lockres->l_lock);
@@ -672,7 +664,7 @@
lockres->l_blocking = level;
}
- LOG_EXIT_STATUS(needs_downconvert);
+ mlog_exit(needs_downconvert);
return needs_downconvert;
}
@@ -683,17 +675,17 @@
ocfs_super *osb;
int needs_downconvert;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(ocfs2_is_inode_lock(lockres));
inode = ocfs2_lock_res_inode(lockres);
osb = OCFS2_SB(inode->i_sb);
- dprintk("BAST fired for inode %llu, blocking = %d, level = %d "
- "type = %s\n", OCFS_I(inode)->ip_blkno, level,
- lockres->l_level,
- (lockres->l_type == OCFS_TYPE_META) ? "Meta" : "Data");
+ mlog(0, "BAST fired for inode %llu, blocking = %d, level = %d "
+ "type = %s\n", OCFS_I(inode)->ip_blkno, level,
+ lockres->l_level,
+ (lockres->l_type == OCFS_TYPE_META) ? "Meta" : "Data");
OCFS_ASSERT(level > LKM_NLMODE);
@@ -709,7 +701,7 @@
/* TODO: Is a wake_up call here really necessary? */
wake_up(&lockres->l_event);
- LOG_EXIT();
+ mlog_exit_void();
}
static void ocfs2_super_ast_func(void *opaque)
@@ -717,16 +709,16 @@
ocfs2_lock_res *lockres = opaque;
dlm_lockstatus *lksb;
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("Superblock AST fired\n");
+ mlog(0, "Superblock AST fired\n");
OCFS_ASSERT(ocfs2_is_super_lock(lockres));
spin_lock(&lockres->l_lock);
lksb = &(lockres->l_lksb);
if (lksb->status != DLM_NORMAL) {
- LOG_ERROR_ARGS("lksb status value of %u!\n", lksb->status);
+ mlog(ML_ERROR, "lksb status value of %u!\n", lksb->status);
spin_unlock(&lockres->l_lock);
return;
}
@@ -750,7 +742,7 @@
spin_unlock(&lockres->l_lock);
wake_up(&lockres->l_event);
- LOG_EXIT();
+ mlog_exit_void();
}
static void ocfs2_super_bast_func(void *opaque, int level)
@@ -759,10 +751,10 @@
ocfs_super *osb;
int needs_downconvert;
- LOG_ENTRY();
+ mlog_entry_void();
osb = ocfs2_lock_res_super(lockres);
- dprintk("Superblock BAST fired\n");
+ mlog(0, "Superblock BAST fired\n");
spin_lock(&lockres->l_lock);
needs_downconvert = ocfs2_generic_handle_bast(lockres, level);
@@ -773,13 +765,13 @@
ocfs2_kick_vote_thread(osb);
wake_up(&lockres->l_event);
- LOG_EXIT();
+ mlog_exit_void();
}
static inline void ocfs2_recover_from_dlm_error(ocfs2_lock_res *lockres,
int convert)
{
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&lockres->l_lock);
lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
if (convert)
@@ -789,7 +781,7 @@
spin_unlock(&lockres->l_lock);
wake_up(&lockres->l_event);
- LOG_EXIT();
+ mlog_exit_void();
}
/* Note: If we detect another process working on the lock (i.e.,
@@ -804,10 +796,10 @@
int ret = 0;
dlm_status status;
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("lock %s, level = %d, flags = %d\n", lockres->l_name, level,
- flags);
+ mlog(0, "lock %s, level = %d, flags = %d\n", lockres->l_name, level,
+ flags);
spin_lock(&lockres->l_lock);
if ((lockres->l_flags & OCFS2_LOCK_ATTACHED) ||
@@ -830,15 +822,15 @@
lockres,
lockres->l_ops->bast);
if (status != DLM_NORMAL) {
- LOG_ERROR_ARGS("Dlm returns %d\n", status);
+ mlog(ML_ERROR, "Dlm returns %d\n", status);
ret = -ENOENT;
ocfs2_recover_from_dlm_error(lockres, 1);
}
- dprintk("lock %s, successfull return from dlmlock\n", lockres->l_name);
+ mlog(0, "lock %s, successfull return from dlmlock\n", lockres->l_name);
bail:
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
@@ -928,7 +920,7 @@
int ret;
int catch_signals = 1;
- LOG_ENTRY();
+ mlog_entry_void();
if (cb != NULL) {
fcb = kmalloc(sizeof(*fcb), GFP_NOFS);
@@ -974,7 +966,7 @@
ret = ocfs2_lock_create(osb, lockres, LKM_NLMODE, 0);
if (ret < 0) {
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto out;
}
goto again;
@@ -998,8 +990,8 @@
OCFS_ASSERT(level != LKM_IVMODE);
OCFS_ASSERT(level != LKM_NLMODE);
- dprintk("lock %s, convert from %d to level = %d\n",
- lockres->l_name, lockres->l_level, level);
+ mlog(0, "lock %s, convert from %d to level = %d\n",
+ lockres->l_name, lockres->l_level, level);
/* call dlm_lock to upgrade lock now */
status = dlmlock(osb->dlm,
@@ -1015,15 +1007,15 @@
(status == DLM_NOTQUEUED))
ret = -EAGAIN;
else {
- LOG_ERROR_ARGS("Dlm returns %d\n", status);
+ mlog(ML_ERROR, "Dlm returns %d\n", status);
ret = -ENOENT;
}
ocfs2_recover_from_dlm_error(lockres, 1);
goto out;
}
- dprintk("lock %s, successfull return from dlmlock\n",
- lockres->l_name);
+ mlog(0, "lock %s, successfull return from dlmlock\n",
+ lockres->l_name);
/* At this point we've gone inside the dlm and need to
* complete our work regardless. */
@@ -1050,7 +1042,7 @@
if (ret && fcb != NULL && fcb != &_fcb)
kfree(fcb);
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
@@ -1058,12 +1050,12 @@
ocfs2_lock_res *lockres,
int level)
{
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&lockres->l_lock);
ocfs2_dec_holders(lockres, level);
ocfs2_vote_on_unlock(osb, lockres);
spin_unlock(&lockres->l_lock);
- LOG_EXIT();
+ mlog_exit_void();
}
/* Grants us an EX lock on the data and metadata resources, skipping
@@ -1081,7 +1073,7 @@
OCFS_ASSERT(inode);
OCFS_ASSERT(ocfs_inode_is_new(inode));
- LOG_ENTRY();
+ mlog_entry_void();
/* NOTE: That we don't increment any of the holder counts, nor
* do we add anything to a journal handle. Since this is
@@ -1100,7 +1092,7 @@
status = ocfs2_lock_create(osb, lockres, LKM_EXMODE, LKM_LOCAL);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1113,13 +1105,13 @@
status = ocfs2_lock_create(osb, lockres, LKM_EXMODE, LKM_LOCAL);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1131,10 +1123,10 @@
OCFS_ASSERT(inode);
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("inode %llu, take %s DATA lock\n", OCFS_I(inode)->ip_blkno,
- write ? "EXMODE" : "PRMODE");
+ mlog(0, "inode %llu, take %s DATA lock\n", OCFS_I(inode)->ip_blkno,
+ write ? "EXMODE" : "PRMODE");
lockres = &OCFS_I(inode)->ip_data_lockres;
@@ -1143,9 +1135,9 @@
status = ocfs2_cluster_lock(OCFS2_SB(inode->i_sb), lockres, level, 0,
NULL, 0);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1154,7 +1146,7 @@
{
int kick = 0;
- LOG_ENTRY();
+ mlog_entry_void();
/* If we know that another node is waiting on our lock, kick
* the vote thread * pre-emptively when we reach a release
@@ -1177,7 +1169,7 @@
if (kick)
ocfs2_kick_vote_thread(osb);
- LOG_EXIT();
+ mlog_exit_void();
}
void ocfs2_data_unlock(struct inode *inode,
@@ -1186,14 +1178,14 @@
int level = write ? LKM_EXMODE : LKM_PRMODE;
ocfs2_lock_res *lockres = &OCFS_I(inode)->ip_data_lockres;
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("inode %llu drop %s DATA lock\n", OCFS_I(inode)->ip_blkno,
- write ? "EXMODE" : "PRMODE");
+ mlog(0, "inode %llu drop %s DATA lock\n", OCFS_I(inode)->ip_blkno,
+ write ? "EXMODE" : "PRMODE");
ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level);
- LOG_EXIT();
+ mlog_exit_void();
}
/* Call this with the lockres locked. I am reasonably sure we don't
@@ -1207,7 +1199,7 @@
ocfs2_lock_res *lockres = &oip->ip_meta_lockres;
ocfs2_meta_lvb *lvb = (ocfs2_meta_lvb *) lockres->l_lksb.lvb;
- LOG_ENTRY();
+ mlog_entry_void();
lvb->lvb_iclusters = cpu_to_be32(oip->ip_clusters);
lvb->lvb_iuid = cpu_to_be32(inode->i_uid);
@@ -1219,7 +1211,7 @@
lvb->lvb_ictime = cpu_to_be64(ocfs_get_seconds(inode->i_ctime));
lvb->lvb_imtime = cpu_to_be64(ocfs_get_seconds(inode->i_mtime));
- LOG_EXIT();
+ mlog_exit_void();
}
static void ocfs2_refresh_inode_from_lvb(struct inode *inode)
@@ -1228,18 +1220,18 @@
ocfs2_lock_res *lockres = &oip->ip_meta_lockres;
ocfs2_meta_lvb *lvb = (ocfs2_meta_lvb *) lockres->l_lksb.lvb;
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("seq %u, trunc clusters %u, iclusters %u\n",
- be32_to_cpu(lvb->lvb.lvb_seq),
- be32_to_cpu(lvb->lvb_trunc_clusters),
- be32_to_cpu(lvb->lvb_iclusters));
- dprintk("uid %u, gid %u, isize %llu, mode 0x%x\n",
- be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid),
- be64_to_cpu(lvb->lvb_isize), be16_to_cpu(lvb->lvb_imode));
- dprintk("nlink %u, atime %llx, ctime %llx, mtime %llx\n",
- be16_to_cpu(lvb->lvb_inlink), be64_to_cpu(lvb->lvb_iatime),
- be64_to_cpu(lvb->lvb_ictime), be64_to_cpu(lvb->lvb_imtime));
+ mlog(0, "seq %u, trunc clusters %u, iclusters %u\n",
+ be32_to_cpu(lvb->lvb.lvb_seq),
+ be32_to_cpu(lvb->lvb_trunc_clusters),
+ be32_to_cpu(lvb->lvb_iclusters));
+ mlog(0, "uid %u, gid %u, isize %llu, mode 0x%x\n",
+ be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid),
+ be64_to_cpu(lvb->lvb_isize), be16_to_cpu(lvb->lvb_imode));
+ mlog(0, "nlink %u, atime %llx, ctime %llx, mtime %llx\n",
+ be16_to_cpu(lvb->lvb_inlink), be64_to_cpu(lvb->lvb_iatime),
+ be64_to_cpu(lvb->lvb_ictime), be64_to_cpu(lvb->lvb_imtime));
/* We're safe here without the lockres lock... */
spin_lock(&oip->ip_lock);
@@ -1259,7 +1251,7 @@
OCFS_SET_INODE_TIME(inode, i_mtime, be64_to_cpu(lvb->lvb_imtime));
spin_unlock(&oip->ip_lock);
- LOG_EXIT();
+ mlog_exit_void();
}
static void ocfs2_reset_meta_lvb_values(struct inode *inode)
@@ -1268,7 +1260,7 @@
ocfs2_meta_lvb *lvb = (ocfs2_meta_lvb *) lockres->l_lksb.lvb;
u32 i_clusters;
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&OCFS_I(inode)->ip_lock);
i_clusters = OCFS_I(inode)->ip_clusters;
@@ -1279,7 +1271,7 @@
lvb->lvb_trunc_clusters = cpu_to_be32(i_clusters);
spin_unlock(&lockres->l_lock);
- LOG_EXIT();
+ mlog_exit_void();
}
static void __ocfs2_lvb_on_downconvert(ocfs2_lock_res *lockres,
@@ -1288,7 +1280,7 @@
ocfs2_lvb *lvb = (ocfs2_lvb *) lockres->l_lksb.lvb;
u32 lvb_seq = be32_to_cpu(lvb->lvb_seq);
- LOG_ENTRY();
+ mlog_entry_void();
if (lockres->l_level == LKM_EXMODE) {
lvb_seq++;
@@ -1304,7 +1296,7 @@
lockres->l_local_seq++;
}
- LOG_EXIT();
+ mlog_exit_void();
}
/* Determine whether a lock resource needs to be refreshed, and
@@ -1318,7 +1310,7 @@
{
int status = 0;
- LOG_ENTRY();
+ mlog_entry_void();
refresh_check:
spin_lock(&lockres->l_lock);
@@ -1340,7 +1332,7 @@
status = 1;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1349,7 +1341,7 @@
static inline void ocfs2_complete_lock_res_refresh(ocfs2_lock_res *lockres,
int status)
{
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&lockres->l_lock);
lockres_clear_flags(lockres, OCFS2_LOCK_REFRESHING);
@@ -1359,7 +1351,7 @@
wake_up(&lockres->l_event);
- LOG_EXIT();
+ mlog_exit_void();
}
/* may or may not return a bh if it went to disk. */
@@ -1371,7 +1363,7 @@
ocfs2_lock_res *lockres;
ocfs2_dinode *fe;
- LOG_ENTRY();
+ mlog_entry_void();
lockres = &OCFS_I(inode)->ip_meta_lockres;
@@ -1390,7 +1382,7 @@
OCFS_I(inode)->ip_blkno, bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail_refresh;
}
fe = (ocfs2_dinode *) (*bh)->b_data;
@@ -1406,8 +1398,8 @@
ocfs_refresh_inode(inode, fe);
}
- dprintk("inode %llu, I can only trust %u clusters\n",
- OCFS_I(inode)->ip_blkno, trustable_clusters);
+ mlog(0, "inode %llu, I can only trust %u clusters\n",
+ OCFS_I(inode)->ip_blkno, trustable_clusters);
/* will do nothing for inode types that don't use the extent
* map (directories, bitmap files, etc) */
@@ -1420,7 +1412,7 @@
bail_refresh:
ocfs2_complete_lock_res_refresh(lockres, status);
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1442,10 +1434,10 @@
OCFS_ASSERT(inode);
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("inode %llu, take %s META lock\n", OCFS_I(inode)->ip_blkno,
- ex ? "EXMODE" : "PRMODE");
+ mlog(0, "inode %llu, take %s META lock\n", OCFS_I(inode)->ip_blkno,
+ ex ? "EXMODE" : "PRMODE");
status = 0;
@@ -1454,7 +1446,7 @@
ocfs_node_map_is_empty(osb,
&osb->recovery_map));
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
return status;
}
@@ -1468,7 +1460,7 @@
cb_data);
if (status < 0) {
if (status != -EAGAIN)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1487,14 +1479,14 @@
ret_bh = &local_bh;
status = ocfs2_meta_lock_update(inode, ret_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bail:
if (local_bh)
brelse(local_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1508,7 +1500,7 @@
struct buffer_head *bh = NULL;
int status;
- LOG_ENTRY();
+ mlog_entry_void();
BUG_ON(handle && !ex);
@@ -1523,7 +1515,7 @@
OCFS_I(inode)->ip_blkno, &bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1534,13 +1526,13 @@
if (handle) {
status = ocfs_handle_add_lock(handle, inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
}
bail:
if (bh)
brelse(bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1550,13 +1542,13 @@
int level = ex ? LKM_EXMODE : LKM_PRMODE;
ocfs2_lock_res *lockres = &OCFS_I(inode)->ip_meta_lockres;
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("inode %llu drop %s META lock\n", OCFS_I(inode)->ip_blkno,
- ex ? "EXMODE" : "PRMODE");
+ mlog(0, "inode %llu drop %s META lock\n", OCFS_I(inode)->ip_blkno,
+ ex ? "EXMODE" : "PRMODE");
ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level);
- LOG_EXIT();
+ mlog_exit_void();
}
int ocfs2_super_lock(ocfs_super *osb,
@@ -1568,11 +1560,11 @@
struct buffer_head *bh;
ocfs2_slot_info *si = osb->slot_info;
- LOG_ENTRY();
+ mlog_entry_void();
status = ocfs2_cluster_lock(osb, lockres, level, 0, NULL, 0);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1582,7 +1574,7 @@
* everything is up to the caller :) */
status = ocfs2_should_refresh_lock_res(lockres);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (status) {
@@ -1590,12 +1582,12 @@
status = ocfs_read_block(osb, bh->b_blocknr, &bh, 0,
si->si_inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
ocfs2_complete_lock_res_refresh(lockres, status);
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1614,7 +1606,7 @@
u32 dlm_key;
dlm_ctxt *dlm = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
/* launch vote thread */
osb->vote_task = kthread_run(ocfs2_vote_thread, osb, "ocfs2vote-%d",
@@ -1622,7 +1614,7 @@
if (IS_ERR(osb->vote_task)) {
status = PTR_ERR(osb->vote_task);
osb->vote_task = NULL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1635,7 +1627,7 @@
if (!dlm) {
/* This is a best guess on return value... */
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1643,16 +1635,16 @@
status = ocfs2_super_lock_res_init(&osb->super_lockres, osb);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
void ocfs2_dlm_shutdown(ocfs_super *osb)
{
- LOG_ENTRY();
+ mlog_entry_void();
ocfs2_drop_super_lock(osb);
if (osb->vote_task) {
@@ -1662,20 +1654,20 @@
ocfs2_lock_res_free(&osb->super_lockres);
dlm_unregister_domain(osb->dlm);
- LOG_EXIT();
+ mlog_exit_void();
}
static void ocfs2_unlock_ast_func(void *opaque, dlm_status status)
{
ocfs2_lock_res *lockres = opaque;
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("UNLOCK AST called on lock %s, action = %d\n", lockres->l_name,
- lockres->l_unlock_action);
+ mlog(0, "UNLOCK AST called on lock %s, action = %d\n", lockres->l_name,
+ lockres->l_unlock_action);
if (status != DLM_NORMAL)
- LOG_ERROR_ARGS("Dlm returns status %d\n", status);
+ mlog(ML_ERROR, "Dlm returns status %d\n", status);
spin_lock(&lockres->l_lock);
switch(lockres->l_unlock_action) {
@@ -1694,7 +1686,7 @@
wake_up(&lockres->l_event);
- LOG_EXIT();
+ mlog_exit_void();
}
/* BEWARE: called with lockres lock, and always drops it. Caller
@@ -1728,7 +1720,7 @@
lockres->l_unlock_action = OCFS2_UNLOCK_DROP_LOCK;
spin_unlock(&lockres->l_lock);
- dprintk("lock %s\n", lockres->l_name);
+ mlog(0, "lock %s\n", lockres->l_name);
status = dlmunlock(osb->dlm,
&lockres->l_lksb,
@@ -1736,16 +1728,16 @@
lockres->l_ops->unlock_ast,
lockres);
if (status != DLM_NORMAL) {
- LOG_ERROR_ARGS("Dlm returns %d\n", status);
+ mlog(ML_ERROR, "Dlm returns %d\n", status);
ret = -ENOENT;
goto bail;
}
- dprintk("lock %s, successfull return from dlmunlock\n",
- lockres->l_name);
+ mlog(0, "lock %s, successfull return from dlmunlock\n",
+ lockres->l_name);
ocfs2_wait_on_busy_lock(lockres);
bail:
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
@@ -1763,10 +1755,10 @@
spin_lock(&lockres->l_lock);
while (lockres->l_flags & OCFS2_LOCK_BUSY) {
- dprintk("waiting on busy lock \"%s\": flags = %lx, action = "
- "%u, unlock_action = %u\n",
- lockres->l_name, lockres->l_flags, lockres->l_action,
- lockres->l_unlock_action);
+ mlog(0, "waiting on busy lock \"%s\": flags = %lx, action = "
+ "%u, unlock_action = %u\n",
+ lockres->l_name, lockres->l_flags, lockres->l_action,
+ lockres->l_unlock_action);
spin_unlock(&lockres->l_lock);
@@ -1790,13 +1782,13 @@
{
int status;
- LOG_ENTRY();
+ mlog_entry_void();
status = ocfs2_drop_lock(osb, &osb->super_lockres, NULL);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
}
static void ocfs2_meta_pre_drop(ocfs2_lock_res *lockres, void *data)
@@ -1818,13 +1810,13 @@
int status, err;
struct drop_lock_cb meta_dcb = { ocfs2_meta_pre_drop, inode, };
- LOG_ENTRY();
+ mlog_entry_void();
err = ocfs2_drop_lock(OCFS2_SB(inode->i_sb),
&OCFS_I(inode)->ip_data_lockres,
NULL);
if (err < 0)
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
status = err;
@@ -1832,11 +1824,11 @@
&OCFS_I(inode)->ip_meta_lockres,
&meta_dcb);
if (err < 0)
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
if (err < 0 && !status)
status = err;
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1848,18 +1840,18 @@
{
int status, flags = LKM_CONVERT;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(lockres->l_blocking > LKM_NLMODE);
if (lockres->l_level <= new_level) {
- LOG_ERROR_ARGS("lockres->l_level (%u) <= new_level (%u)\n",
- lockres->l_level, new_level);
+ mlog(ML_ERROR, "lockres->l_level (%u) <= new_level (%u)\n",
+ lockres->l_level, new_level);
BUG();
}
- dprintk("lock %s, new_level = %d, l_blocking = %d, lvb = %d\n",
- lockres->l_name, new_level, lockres->l_blocking, lvb);
+ mlog(0, "lock %s, new_level = %d, l_blocking = %d, lvb = %d\n",
+ lockres->l_name, new_level, lockres->l_blocking, lvb);
lockres->l_action = OCFS2_AST_DOWNCONVERT;
lockres->l_requested = new_level;
@@ -1878,7 +1870,7 @@
lockres,
lockres->l_ops->bast);
if (status != DLM_NORMAL) {
- LOG_ERROR_ARGS("Dlm returns %d\n", status);
+ mlog(ML_ERROR, "Dlm returns %d\n", status);
status = -ENOENT;
ocfs2_recover_from_dlm_error(lockres, 1);
goto bail;
@@ -1886,7 +1878,7 @@
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1896,9 +1888,9 @@
{
int status;
- LOG_ENTRY();
+ mlog_entry_void();
- dprintk("lock %s\n", lockres->l_name);
+ mlog(0, "lock %s\n", lockres->l_name);
/* were we in a convert when we got the bast fire? */
OCFS_ASSERT(lockres->l_action == OCFS2_AST_CONVERT ||
@@ -1924,14 +1916,14 @@
lockres->l_unlock_action = OCFS2_UNLOCK_INVALID;
spin_unlock(&lockres->l_lock);
} else {
- LOG_ERROR_ARGS("Dlm returns %d\n", status);
+ mlog(ML_ERROR, "Dlm returns %d\n", status);
status = -ENOENT;
ocfs2_recover_from_dlm_error(lockres, 0);
}
- dprintk("lock %s return from dlmunlock\n", lockres->l_name);
+ mlog(0, "lock %s return from dlmunlock\n", lockres->l_name);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1941,14 +1933,14 @@
{
int ret;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(new_level == LKM_NLMODE || new_level == LKM_PRMODE);
if (lockres->l_flags & OCFS2_LOCK_REFRESHING) {
ret = 0;
- dprintk("lockres %s currently being refreshed -- backing "
- "off!\n", lockres->l_name);
+ mlog(0, "lockres %s currently being refreshed -- backing "
+ "off!\n", lockres->l_name);
} else if (new_level == LKM_PRMODE)
ret = !lockres->l_ex_holders &&
ocfs_inode_fully_checkpointed(inode);
@@ -1956,7 +1948,7 @@
ret = !lockres->l_ro_holders && !lockres->l_ex_holders &&
ocfs_inode_fully_checkpointed(inode);
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
@@ -1968,7 +1960,7 @@
int ret = 0;
ocfs2_lock_res *lockres;
- LOG_ENTRY();
+ mlog_entry_void();
lockres = &OCFS_I(inode)->ip_meta_lockres;
@@ -1976,8 +1968,8 @@
OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
- LOG_TRACE_ARGS("l_level=%d, l_blocking=%d\n", lockres->l_level,
- lockres->l_blocking);
+ mlog(0, "l_level=%d, l_blocking=%d\n", lockres->l_level,
+ lockres->l_blocking);
OCFS_ASSERT(lockres->l_level == LKM_EXMODE ||
lockres->l_level == LKM_PRMODE);
@@ -2000,8 +1992,8 @@
new_level = ocfs2_highest_compat_lock_level(lockres->l_blocking);
- LOG_TRACE_ARGS("l_level=%d, l_blocking=%d, new_level=%d\n",
- lockres->l_level, lockres->l_blocking, new_level);
+ mlog(0, "l_level=%d, l_blocking=%d, new_level=%d\n",
+ lockres->l_level, lockres->l_blocking, new_level);
if (ocfs2_can_downconvert_meta_lock(inode, lockres, new_level)) {
if (lockres->l_level == LKM_EXMODE)
@@ -2016,13 +2008,13 @@
__ocfs2_stuff_meta_lvb(inode);
__ocfs2_lvb_on_downconvert(lockres, new_level);
} else
- dprintk("lockres %s: downconverting stale lock!\n",
- lockres->l_name);
+ mlog(0, "lockres %s: downconverting stale lock!\n",
+ lockres->l_name);
- LOG_TRACE_ARGS("calling __ocfs2_downconvert_lock with "
- "l_level=%d, l_blocking=%d, new_level=%d\n",
- lockres->l_level, lockres->l_blocking,
- new_level);
+ mlog(0, "calling __ocfs2_downconvert_lock with "
+ "l_level=%d, l_blocking=%d, new_level=%d\n",
+ lockres->l_level, lockres->l_blocking,
+ new_level);
ret = __ocfs2_downconvert_lock(OCFS2_SB(inode->i_sb),
lockres, new_level,
set_lvb);
@@ -2035,7 +2027,7 @@
spin_unlock(&lockres->l_lock);
ret = 0;
leave:
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
@@ -2048,7 +2040,7 @@
int new_level;
int ret = 0;
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&lockres->l_lock);
@@ -2119,7 +2111,7 @@
ret = __ocfs2_downconvert_lock(osb, lockres, new_level, 0);
leave:
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
@@ -2129,14 +2121,14 @@
struct inode *inode;
struct address_space *mapping;
- LOG_ENTRY();
+ mlog_entry_void();
inode = ocfs2_lock_res_inode(lockres);
mapping = inode->i_mapping;
if (filemap_fdatawrite(mapping)) {
- LOG_ERROR_ARGS("Could not sync inode %llu for downconvert!",
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "Could not sync inode %llu for downconvert!",
+ OCFS_I(inode)->ip_blkno);
}
sync_mapping_buffers(mapping);
if (blocking == LKM_EXMODE) {
@@ -2153,7 +2145,7 @@
filemap_fdatawait(mapping);
}
- LOG_EXIT();
+ mlog_exit_void();
}
int ocfs2_unblock_data(ocfs2_lock_res *lockres,
@@ -2163,22 +2155,22 @@
struct inode *inode;
ocfs_super *osb;
- LOG_ENTRY();
+ mlog_entry_void();
inode = ocfs2_lock_res_inode(lockres);
osb = OCFS2_SB(inode->i_sb);
- dprintk("unblock inode %llu\n", OCFS_I(inode)->ip_blkno);
+ mlog(0, "unblock inode %llu\n", OCFS_I(inode)->ip_blkno);
status = ocfs2_generic_unblock_lock(osb,
lockres,
requeue,
ocfs2_data_convert_worker);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
- dprintk("inode %llu, requeue = %d\n", OCFS_I(inode)->ip_blkno,
- *requeue);
+ mlog(0, "inode %llu, requeue = %d\n", OCFS_I(inode)->ip_blkno,
+ *requeue);
/* because of inode ref counting, we never want to propagate
* up requeue requests for inode locks. Instead we do it
@@ -2190,7 +2182,7 @@
iput(inode);
*requeue = 0;
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -2200,18 +2192,18 @@
int status;
struct inode *inode;
- LOG_ENTRY();
+ mlog_entry_void();
inode = ocfs2_lock_res_inode(lockres);
- dprintk("unblock inode %llu\n", OCFS_I(inode)->ip_blkno);
+ mlog(0, "unblock inode %llu\n", OCFS_I(inode)->ip_blkno);
status = ocfs2_do_unblock_meta(inode, requeue);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
- dprintk("inode %llu, requeue = %d\n", OCFS_I(inode)->ip_blkno,
- *requeue);
+ mlog(0, "inode %llu, requeue = %d\n", OCFS_I(inode)->ip_blkno,
+ *requeue);
/* if you're confused by this, see the comment in
* ocfs2_unblock_data */
@@ -2221,7 +2213,7 @@
iput(inode);
*requeue = 0;
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -2231,7 +2223,7 @@
int status;
ocfs_super *osb;
- LOG_ENTRY();
+ mlog_entry_void();
osb = ocfs2_lock_res_super(lockres);
@@ -2240,9 +2232,9 @@
requeue,
NULL);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -2252,31 +2244,31 @@
int status;
int requeue = 0;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(lockres);
OCFS_ASSERT(lockres->l_ops);
OCFS_ASSERT(lockres->l_ops->unblock);
- dprintk("lockres %s blocked.\n", lockres->l_name);
+ mlog(0, "lockres %s blocked.\n", lockres->l_name);
status = lockres->l_ops->unblock(lockres, &requeue);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
if (requeue)
ocfs2_schedule_blocked_lock(osb, lockres);
- dprintk("lockres %s, requeue = %s.\n", lockres->l_name,
- requeue ? "yes" : "no");
+ mlog(0, "lockres %s, requeue = %s.\n", lockres->l_name,
+ requeue ? "yes" : "no");
- LOG_EXIT();
+ mlog_exit_void();
}
static void ocfs2_schedule_blocked_lock(ocfs_super *osb,
ocfs2_lock_res *lockres)
{
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&osb->vote_task_lock);
if (list_empty(&lockres->l_blocked_list)) {
@@ -2286,20 +2278,20 @@
}
spin_unlock(&osb->vote_task_lock);
- LOG_EXIT();
+ mlog_exit_void();
}
/* needed for inodes as we have to take a reference on them.. */
static void ocfs2_schedule_blocked_inode_lock(struct inode *inode,
ocfs2_lock_res *lockres)
{
- LOG_ENTRY();
+ mlog_entry_void();
if (!igrab(inode)) {
- LOG_ERROR_ARGS("Inode %llu asked to be scheduled during "
- "clear_inode!\n", OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "Inode %llu asked to be scheduled during "
+ "clear_inode!\n", OCFS_I(inode)->ip_blkno);
return;
}
ocfs2_schedule_blocked_lock(OCFS2_SB(inode->i_sb), lockres);
- LOG_EXIT();
+ mlog_exit_void();
}
Modified: trunk/fs/ocfs2/extent_map.c
===================================================================
--- trunk/fs/ocfs2/extent_map.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/extent_map.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -34,7 +34,9 @@
#include <linux/slab.h>
#include <linux/rbtree.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_EXTENT_MAP
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/file.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -34,7 +34,9 @@
#include <linux/pagemap.h>
#include <linux/uio.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_INODE
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -52,8 +54,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_FILE
-
static int ocfs2_zero_extend(struct inode *inode);
static int ocfs_orphan_for_truncate(ocfs_super *osb,
struct inode *inode,
@@ -99,7 +99,7 @@
int mode = file->f_flags;
ocfs_inode_private *oip = OCFS_I(inode);
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%.*s')\n", inode, file,
+ mlog_entry ("(0x%p, 0x%p, '%.*s')\n", inode, file,
file->f_dentry->d_name.len,
file->f_dentry->d_name.name);
@@ -120,7 +120,7 @@
spin_unlock(&oip->ip_lock);
status = 0;
leave:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_file_open */
@@ -128,7 +128,7 @@
{
ocfs_inode_private *oip = OCFS_I(inode);
- LOG_ENTRY_ARGS("(0x%p, 0x%p, '%.*s')\n", inode, file,
+ mlog_entry("(0x%p, 0x%p, '%.*s')\n", inode, file,
file->f_dentry->d_name.len,
file->f_dentry->d_name.name);
@@ -137,7 +137,7 @@
oip->ip_flags &= ~OCFS_INODE_OPEN_DIRECT;
spin_unlock(&oip->ip_lock);
- LOG_EXIT_INT(0);
+ mlog_exit(0);
return 0;
}
@@ -154,7 +154,7 @@
struct inode *inode = dentry->d_inode;
ocfs_super *osb = OCFS_SB(inode->i_sb);
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, %d, '%.*s')\n", file, dentry, datasync,
+ mlog_entry ("(0x%p, 0x%p, %d, '%.*s')\n", file, dentry, datasync,
dentry->d_name.len, dentry->d_name.name);
err = ocfs_sync_inode(dentry->d_inode);
@@ -165,7 +165,7 @@
err = journal_force_commit(journal);
bail:
- LOG_EXIT_STATUS (err);
+ mlog_exit (err);
return (err < 0) ? -EIO : 0;
} /* ocfs_sync_file */
@@ -183,7 +183,7 @@
void ocfs2_file_finish_extension(struct inode *inode, loff_t newsize,
unsigned should_zero)
{
- LOG_TRACE_STR("Generic_file_write ok, asking for OIN update now");
+ mlog(0, "Generic_file_write ok, asking for OIN update now\n");
ocfs2_update_inode_size(inode, newsize);
if (!should_zero) {
@@ -199,7 +199,8 @@
* generic_file_write
*/
if (status)
- LOG_ERROR_ARGS("Unable to pre-zero extension of inode (%d)", status);
+ mlog(ML_ERROR, "Unable to pre-zero extension of inode "
+ "(%d)", status);
}
}
@@ -219,7 +220,7 @@
struct ocfs2_write_lock_info info = {0, };
DECLARE_BUFFER_LOCK_CTXT(ctxt);
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
+ mlog_entry ("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
(unsigned int)count,
filp->f_dentry->d_name.len,
filp->f_dentry->d_name.name);
@@ -231,7 +232,7 @@
}
if (!inode) {
- LOG_TRACE_STR ("bad inode");
+ mlog(0, "bad inode\n");
ret = -EIO;
goto bail;
}
@@ -282,7 +283,7 @@
ocfs2_unlock_buffer_inodes(&ctxt);
if (info.wl_have_i_sem)
up(&inode->i_sem);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
}
@@ -305,11 +306,11 @@
int sector_size;
DECLARE_BUFFER_LOCK_CTXT(ctxt);
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
+ mlog_entry ("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
(unsigned int)count, filp->f_dentry->d_name.len,
filp->f_dentry->d_name.name);
if (!inode) {
- LOG_ERROR_STR ("Bad inode or inode has no oin");
+ mlog(ML_ERROR, "Bad inode or inode has no oin\n");
ret = -EINVAL;
goto bail;
}
@@ -319,7 +320,7 @@
if (filp->f_flags & O_DIRECT) {
/* anything special for o_direct? */
- LOG_TRACE_STR ("O_DIRECT");
+ mlog(0, "O_DIRECT\n");
if (((*ppos) & (sector_size - 1)) || (count & (sector_size - 1)) ||
((unsigned long)buf & (sector_size - 1)) || (i_size_read(inode) & (sector_size -1))) {
do_direct_io = 0;
@@ -332,7 +333,7 @@
ret = ocfs2_setup_io_locks(inode->i_sb, inode, buf, count, &ctxt,
&target_binode);
if (ret < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -340,7 +341,7 @@
ret = ocfs2_lock_buffer_inodes(&ctxt, NULL);
if (ret < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail_unlock;
}
@@ -370,13 +371,13 @@
#endif
up_read(&OCFS_I(inode)->ip_alloc_sem);
if (ret == -EINVAL)
- LOG_ERROR_STR ("Generic_file_read returned -EINVAL");
+ mlog(ML_ERROR, "Generic_file_read returned -EINVAL\n");
bail_unlock:
ocfs2_unlock_buffer_inodes(&ctxt);
bail:
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_file_read */
@@ -412,7 +413,7 @@
struct super_block *sb = inode->i_sb;
ocfs_inode_private *oip = OCFS_I(inode);
- LOG_ENTRY();
+ mlog_entry_void();
grow = new_i_size > inode->i_size;
i_size_write(inode, new_i_size);
@@ -422,7 +423,7 @@
status = ocfs_mark_inode_dirty(handle, inode, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -433,7 +434,7 @@
spin_unlock(&oip->ip_lock);
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -445,7 +446,7 @@
int status;
ocfs_journal_handle *handle = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
/* TODO: This needs to actually orphen the inode in this
* transaction. */
@@ -453,19 +454,19 @@
handle = ocfs_start_trans(osb, handle, OCFS_INODE_UPDATE_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_set_inode_size(handle, inode, fe_bh, new_i_size);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
bail:
if (handle)
ocfs_commit_trans(handle);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -483,7 +484,7 @@
ocfs_journal_handle *handle = NULL;
ocfs2_truncate_context *tc = NULL;
- LOG_ENTRY_ARGS("(inode = %llu, new_i_size = %llu\n",
+ mlog_entry("(inode = %llu, new_i_size = %llu\n",
OCFS_I(inode)->ip_blkno, new_i_size);
truncate_inode_pages(inode->i_mapping, new_i_size);
@@ -491,7 +492,7 @@
status = ocfs_read_block(osb, OCFS_I(inode)->ip_blkno, &fe_bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -500,16 +501,15 @@
OCFS_ASSERT(fe->i_size == i_size_read(inode));
if (new_i_size > fe->i_size) {
- LOG_TRACE_ARGS("asked to truncate file with size (%llu) "
- "to size (%llu)!\n", fe->i_size,
- new_i_size);
+ mlog(0, "asked to truncate file with size (%llu) "
+ "to size (%llu)!\n", fe->i_size, new_i_size);
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
- LOG_TRACE_ARGS("inode %llu, i_size = %llu, new_i_size = %llu\n",
- fe->i_blkno, fe->i_size, new_i_size);
+ mlog(0, "inode %llu, i_size = %llu, new_i_size = %llu\n",
+ fe->i_blkno, fe->i_size, new_i_size);
/* lets handle the simple truncate cases before doing any more
* cluster locking. */
@@ -518,15 +518,15 @@
if (fe->i_clusters == ocfs2_clusters_for_bytes(osb->sb,
new_i_size)) {
- LOG_TRACE_ARGS("fe->i_clusters = %u, so we do a simple "
- "truncate\n", fe->i_clusters);
+ mlog(0, "fe->i_clusters = %u, so we do a simple truncate\n",
+ fe->i_clusters);
/* No allocation change is required, so lets fast path
* this truncate. */
handle = ocfs_start_trans(osb, NULL,
OCFS_INODE_UPDATE_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -536,14 +536,14 @@
status = ocfs_set_inode_size(handle, inode, fe_bh, new_i_size);
if (status < 0)
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
/* This forces other nodes to sync and drop their pages */
status = ocfs2_data_lock(inode, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
ocfs2_data_unlock(inode, 1);
@@ -554,19 +554,19 @@
* i_size. */
status = ocfs_orphan_for_truncate(osb, inode, fe_bh, new_i_size);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
status = ocfs_prepare_truncate(osb, inode, fe_bh, &tc);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_commit_truncate(osb, inode, fe_bh, tc);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -581,7 +581,7 @@
if (tc)
ocfs_free_truncate_context(tc);
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_truncate_file */
@@ -599,7 +599,7 @@
size >> PAGE_CACHE_SHIFT);
if (!page) {
res = -ENOMEM;
- LOG_ERROR_STATUS(res);
+ mlog_errno(res);
return res;
}
offset = (unsigned int)(size & (PAGE_CACHE_SIZE - 1)) + 1;
@@ -645,7 +645,7 @@
free_extents = ocfs_num_free_extents(osb, inode, fe);
if (free_extents < 0) {
status = free_extents;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -655,7 +655,7 @@
* 2) we are so fragmented, we've needed to add metadata too
* many times. */
if (!free_extents && !meta_ac) {
- LOG_TRACE_STR("we haven't reserved any metadata!");
+ mlog(0, "we haven't reserved any metadata!\n");
status = -EAGAIN;
if (reason)
*reason = RESTART_META;
@@ -663,7 +663,7 @@
} else if ((!free_extents)
&& (ocfs_alloc_context_bits_left(meta_ac)
< ocfs2_extend_meta_needed(fe))) {
- LOG_TRACE_STR("filesystem is really fragmented...");
+ mlog(0, "filesystem is really fragmented...\n");
status = -EAGAIN;
if (reason)
*reason = RESTART_META;
@@ -673,7 +673,7 @@
status = ocfs_claim_clusters(osb, handle, data_ac, 1,
&bit_off, &num_bits);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -683,17 +683,17 @@
status = ocfs_journal_access(handle, inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
block = ocfs2_clusters_to_blocks(osb->sb, bit_off);
- LOG_TRACE_ARGS("Allocating %u clusters at block %u for inode %llu\n",
- num_bits, bit_off, OCFS_I(inode)->ip_blkno);
+ mlog(0, "Allocating %u clusters at block %u for inode %llu\n",
+ num_bits, bit_off, OCFS_I(inode)->ip_blkno);
status = ocfs2_insert_extent(osb, handle, inode, fe_bh, block,
num_bits, meta_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -704,23 +704,22 @@
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
clusters_to_add -= num_bits;
if (clusters_to_add) {
- LOG_TRACE_ARGS("need to alloc once more, clusters = %u, "
- "wanted = %u\n", fe->i_clusters,
- clusters_to_add);
+ mlog(0, "need to alloc once more, clusters = %u, wanted = "
+ "%u\n", fe->i_clusters, clusters_to_add);
status = -EAGAIN;
if (reason)
*reason = RESTART_TRANS;
}
leave:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -765,7 +764,7 @@
ocfs2_alloc_context *meta_ac = NULL;
enum ocfs2_alloc_restarted why;
- LOG_ENTRY_ARGS("(new_i_size=%llu)\n", new_i_size);
+ mlog_entry("(new_i_size=%llu)\n", new_i_size);
*bytes_extended = 0;
@@ -777,14 +776,14 @@
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs_read_block(osb, OCFS_I(inode)->ip_blkno, &bh,
OCFS_BH_CACHED, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -799,10 +798,10 @@
clusters_to_add = ocfs2_clusters_for_bytes(osb->sb, new_i_size)
- fe->i_clusters;
- LOG_TRACE_ARGS("extend inode %llu, new_i_size = %llu, i_size = %llu, "
- "fe->i_clusters = %u, clusters_to_add = %u\n",
- OCFS_I(inode)->ip_blkno, new_i_size, i_size_read(inode),
- fe->i_clusters, clusters_to_add);
+ mlog(0, "extend inode %llu, new_i_size = %llu, i_size = %llu, "
+ "fe->i_clusters = %u, clusters_to_add = %u\n",
+ OCFS_I(inode)->ip_blkno, new_i_size, i_size_read(inode),
+ fe->i_clusters, clusters_to_add);
if (!clusters_to_add)
goto do_start_trans;
@@ -822,7 +821,7 @@
fe);
if (num_free_extents < 0) {
status = num_free_extents;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -832,7 +831,7 @@
fe,
&meta_ac);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto leave;
}
}
@@ -843,7 +842,7 @@
&data_ac);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -858,7 +857,7 @@
handle = ocfs_start_trans(osb, handle, credits);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -872,7 +871,7 @@
status = ocfs_journal_access(handle, inode, bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -888,7 +887,7 @@
meta_ac,
&why);
if ((status < 0) && (status != -EAGAIN)) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -897,7 +896,7 @@
ocfs2_clusters_to_bytes(osb->sb, fe->i_clusters))) {
if (why == RESTART_META) {
- LOG_TRACE_ARGS("restarting function.\n");
+ mlog(0, "restarting function.\n");
restart_func = 1;
} else {
OCFS_ASSERT(why == RESTART_TRANS);
@@ -913,7 +912,7 @@
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto leave;
}
@@ -921,7 +920,7 @@
ocfs2_clusters_for_bytes(osb->sb,
new_i_size)
- fe->i_clusters + overalloc_bits;
- LOG_TRACE_ARGS("restarting transaction.\n");
+ mlog(0, "restarting transaction.\n");
/* TODO: This can be more intelligent. */
credits = ocfs_calc_extend_credits(osb->sb,
fe,
@@ -931,7 +930,7 @@
/* handle still has to be committed at
* this point. */
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
goto restarted_transaction;
@@ -949,17 +948,17 @@
*bytes_extended += new_fe_size - fe->i_size;
fe->i_size = new_fe_size;
- LOG_TRACE_ARGS("fe: i_clusters = %u, i_size=%llu\n",
- fe->i_clusters, fe->i_size);
+ mlog(0, "fe: i_clusters = %u, i_size=%llu\n", fe->i_clusters,
+ fe->i_size);
- LOG_TRACE_ARGS("inode: ip_clusters=%u, i_size=%llu\n",
- OCFS_I(inode)->ip_clusters, i_size_read(inode));
+ mlog(0, "inode: ip_clusters=%u, i_size=%llu\n",
+ OCFS_I(inode)->ip_clusters, i_size_read(inode));
fe->i_ctime = fe->i_mtime = OCFS_CURRENT_TIME;
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto leave;
}
@@ -989,7 +988,7 @@
goto restart_all;
}
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_extend_file */
@@ -1008,24 +1007,24 @@
struct buffer_head *bh = NULL;
ocfs_journal_handle *handle = NULL;
- LOG_ENTRY_ARGS ("(0x%p, '%.*s')\n", dentry,
+ mlog_entry ("(0x%p, '%.*s')\n", dentry,
dentry->d_name.len, dentry->d_name.name);
if (attr->ia_valid & ATTR_MODE)
- LOG_TRACE_ARGS ("mode change: %d\n", attr->ia_mode);
+ mlog(0, "mode change: %d\n", attr->ia_mode);
if (attr->ia_valid & ATTR_UID)
- LOG_TRACE_ARGS ("uid change: %d\n", attr->ia_uid);
+ mlog(0, "uid change: %d\n", attr->ia_uid);
if (attr->ia_valid & ATTR_GID)
- LOG_TRACE_ARGS ("gid change: %d\n", attr->ia_gid);
+ mlog(0, "gid change: %d\n", attr->ia_gid);
if (attr->ia_valid & ATTR_SIZE)
- LOG_TRACE_STR ("size change...");
+ mlog(0, "size change...\n");
if (attr->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME))
- LOG_TRACE_STR ("time change...");
+ mlog(0, "time change...\n");
#define OCFS2_VALID_ATTRS (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_SIZE \
| ATTR_GID | ATTR_UID | ATTR_MODE)
if (!(attr->ia_valid & OCFS2_VALID_ATTRS)) {
- LOG_TRACE_ARGS("can't handle attrs: 0x%x\n", attr->ia_valid);
+ mlog(0, "can't handle attrs: 0x%x\n", attr->ia_valid);
return 0;
}
@@ -1037,7 +1036,7 @@
status = ocfs2_meta_lock(inode, NULL, &bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
unlock = 1;
@@ -1053,7 +1052,7 @@
&bytes_added);
if (status < 0 && (!bytes_added)) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
status = -ENOSPC;
goto bail;
}
@@ -1063,9 +1062,8 @@
&& status != -ENOSPC
&& status != -EINTR
&& status != -ERESTARTSYS)
- LOG_ERROR_ARGS("status return of %d extending inode "
- "%llu\n", status,
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "status return of %d extending inode "
+ "%llu\n", status, OCFS_I(inode)->ip_blkno);
status = 0;
newsize = bytes_added + i_size_read(inode);
@@ -1080,14 +1078,14 @@
spin_unlock(&OCFS_I(inode)->ip_lock);
status = ocfs2_zero_extend(inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
handle = ocfs_start_trans(osb, NULL, OCFS_INODE_UPDATE_CREDITS);
if (handle == NULL) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1096,18 +1094,18 @@
* with it. */
status = ocfs_handle_add_lock(handle, inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
unlock = 0;
status = inode_setattr (inode, attr);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_mark_inode_dirty(handle, inode, bh);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -1119,7 +1117,7 @@
if (bh)
brelse(bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_setattr */
@@ -1135,12 +1133,12 @@
ocfs_super *osb = sb->s_fs_info;
int err;
- LOG_ENTRY();
+ mlog_entry_void();
err = ocfs_inode_revalidate(dentry);
if (err) {
if (err != -ENOENT)
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
@@ -1150,7 +1148,7 @@
stat->blksize = osb->s_clustersize;
bail:
- LOG_EXIT_INT (err);
+ mlog_exit (err);
return err;
}
Modified: trunk/fs/ocfs2/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/heartbeat.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/heartbeat.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -35,7 +35,9 @@
#include <cluster/heartbeat.h>
#include <cluster/nodemanager.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_SUPER
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -46,9 +48,6 @@
#include "buffer_head_io.h"
-/* Tracing */
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_HEARTBEAT
-
#define OCFS2_HB_NODE_DOWN_PRI (0x0000002)
#define OCFS2_HB_NODE_UP_PRI OCFS2_HB_NODE_DOWN_PRI
@@ -77,7 +76,7 @@
OCFS_ASSERT(osb->node_num != node_num);
- LOG_TRACE_ARGS("ocfs2: node down event for %d\n", node_num);
+ mlog(0, "ocfs2: node down event for %d\n", node_num);
if (ocfs_node_map_test_bit(osb, &osb->umount_map, node_num)) {
/* If a node is in the umount map, then we've been
@@ -100,7 +99,7 @@
OCFS_ASSERT(osb->node_num != node_num);
- LOG_TRACE_ARGS("ocfs2: node up event for %d\n", node_num);
+ mlog(0, "ocfs2: node up event for %d\n", node_num);
ocfs_node_map_clear_bit(osb, &osb->umount_map, node_num);
}
@@ -113,7 +112,7 @@
ocfs2_hb_node_down_cb, osb, OCFS2_HB_NODE_DOWN_PRI);
status = hb_register_callback(&osb->osb_hb_down);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -121,7 +120,7 @@
osb, OCFS2_HB_NODE_UP_PRI);
status = hb_register_callback(&osb->osb_hb_up);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
return status;
@@ -133,11 +132,11 @@
status = hb_unregister_callback(&osb->osb_hb_down);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
status = hb_unregister_callback(&osb->osb_hb_up);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
}
@@ -148,7 +147,7 @@
if (!osb->uuid_str) {
/* This can happen if we don't get far enough in mount... */
- LOG_TRACE_STR("No UUID with which to stop heartbeat!\n");
+ mlog(0, "No UUID with which to stop heartbeat!\n\n");
return;
}
@@ -158,8 +157,7 @@
argv[3] = osb->uuid_str;
argv[4] = NULL;
- LOG_TRACE_ARGS("Run: %s %s %s %s\n",
- argv[0], argv[1], argv[2], argv[3]);
+ mlog(0, "Run: %s %s %s %s\n", argv[0], argv[1], argv[2], argv[3]);
/* minimal command environment taken from cpu_run_sbin_hotplug */
envp[0] = "HOME=/";
@@ -168,7 +166,7 @@
ret = call_usermodehelper(argv[0], argv, envp, 1);
if (ret < 0)
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
}
/* special case -1 for now
@@ -222,7 +220,7 @@
{
int ret;
if (bit >= map->num_nodes) {
- LOG_ERROR_ARGS("bit=%d map->num_nodes=%d\n", bit, map->num_nodes);
+ mlog(ML_ERROR, "bit=%d map->num_nodes=%d\n", bit, map->num_nodes);
BUG();
}
spin_lock(&osb->node_map_lock);
@@ -343,7 +341,7 @@
ret = hb_fill_node_map(osb->group_inode, &tmpmap, sizeof(tmpmap.map));
if (ret < 0) {
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto bail;
}
Modified: trunk/fs/ocfs2/inode.c
===================================================================
--- trunk/fs/ocfs2/inode.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/inode.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -34,7 +34,9 @@
#include <asm/byteorder.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_INODE
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -53,8 +55,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_INODE
-
extern struct address_space_operations ocfs_aops;
typedef struct _ocfs_find_inode_args
@@ -111,13 +111,13 @@
ocfs_find_inode_args args;
u32 flags = 0;
- LOG_ENTRY_ARGS("(blkno = %llu)\n", blkno);
+ mlog_entry("(blkno = %llu)\n", blkno);
/* 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
* sanity checks to make sure they're OK. */
if (blkno == 0) {
- LOG_ERROR_STATUS(-EINVAL);
+ mlog_errno(-EINVAL);
goto bail;
}
@@ -132,7 +132,7 @@
* us to do our own read_inode call and unlock it
* afterwards. */
if (inode && inode->i_state & I_NEW) {
- LOG_TRACE_STR("Inode was not in inode cache, reading it.");
+ mlog(0, "Inode was not in inode cache, reading it.\n");
ocfs_read_locked_inode(inode, &args);
unlock_new_inode(inode);
}
@@ -140,12 +140,12 @@
inode = iget4 (sb, args.ino, ocfs_find_inode, &args);
#endif
if (inode == NULL) {
- LOG_ERROR_STR("access error");
+ mlog(ML_ERROR, "access error\n");
inode = NULL;
goto bail;
}
if (is_bad_inode (inode)) {
- LOG_ERROR_STR("access error (bad inode)");
+ mlog(ML_ERROR, "access error (bad inode)\n");
iput (inode);
inode = NULL;
goto bail;
@@ -153,10 +153,10 @@
bail:
if (inode)
- LOG_TRACE_ARGS("returning inode with number %llu\n",
- OCFS_I(inode)->ip_blkno);
+ mlog(0, "returning inode with number %llu\n",
+ OCFS_I(inode)->ip_blkno);
- LOG_EXIT_PTR(inode);
+ mlog_exit_ptr(inode);
return inode;
} /* ocfs_iget */
@@ -175,17 +175,17 @@
ocfs_find_inode_args *args = NULL;
int ret = 0;
- LOG_ENTRY_ARGS ("(0x%p, %lu, 0x%p)\n", inode, inode->i_ino, opaque);
+ mlog_entry ("(0x%p, %lu, 0x%p)\n", inode, inode->i_ino, opaque);
args = opaque;
if (!inode->u.generic_ip) {
- LOG_ERROR_ARGS("inode %lu has no generic_ip (is_bad_inode = "
+ mlog(ML_ERROR, "inode %lu has no generic_ip (is_bad_inode = "
"%d)!\n", inode->i_ino, is_bad_inode(inode));
if (args)
- LOG_ERROR_ARGS("args-blkno = %llu, args->ino = %lu, "
- "args->flags = 0x%x\n", args->blkno,
- args->ino, args->flags);
+ mlog(ML_ERROR, "args-blkno = %llu, args->ino = %lu, "
+ "args->flags = 0x%x\n", args->blkno, args->ino,
+ args->flags);
BUG();
}
@@ -197,7 +197,7 @@
ret = 1;
bail:
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
}
@@ -209,11 +209,11 @@
static int ocfs_init_locked_inode(struct inode * inode, void * opaque)
{
ocfs_find_inode_args *args = opaque;
- LOG_ENTRY_ARGS("inode = %p, opaque = %p\n", inode, opaque);
+ mlog_entry("inode = %p, opaque = %p\n", inode, opaque);
inode->i_ino = args->ino;
- LOG_EXIT_STATUS(0);
+ mlog_exit(0);
return 0;
}
@@ -236,17 +236,17 @@
ocfs_find_inode_args *args = NULL;
int ret = 0;
- LOG_ENTRY_ARGS ("(0x%p, %lu, 0x%p)\n", inode, ino, opaque);
+ mlog_entry ("(0x%p, %lu, 0x%p)\n", inode, ino, opaque);
args = opaque;
if (!inode->u.generic_ip) {
- LOG_ERROR_ARGS("inode %lu has no generic_ip (is_bad_inode = "
- "%d)!\n", inode->i_ino, is_bad_inode(inode));
+ mlog(ML_ERROR, "inode %lu has no generic_ip (is_bad_inode = "
+ "%d)!\n", inode->i_ino, is_bad_inode(inode));
if (args)
- LOG_ERROR_ARGS("args-blkno = %llu, args->ino = %lu, "
- "args->flags = 0x%x\n", args->blkno,
- args->ino, args->flags);
+ mlog(ML_ERROR, "args-blkno = %llu, args->ino = %lu, "
+ "args->flags = 0x%x\n", args->blkno, args->ino,
+ args->flags);
BUG();
}
@@ -258,14 +258,14 @@
ret = 1;
bail:
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
}
void ocfs_read_inode2(struct inode *inode, void *opaque)
{
if (ocfs_read_locked_inode(inode, opaque) < 0) {
- LOG_ERROR_ARGS("bad inode: i_ino=%lu\n", inode->i_ino);
+ mlog(ML_ERROR, "bad inode: i_ino=%lu\n", inode->i_ino);
make_bad_inode(inode);
}
}
@@ -330,7 +330,7 @@
ocfs_super *osb;
int status = -EINVAL;
- LOG_ENTRY_ARGS ("(0x%p, size:%llu)\n", inode, fe->i_size);
+ mlog_entry ("(0x%p, size:%llu)\n", inode, fe->i_size);
sb = inode->i_sb;
osb = OCFS_SB(sb);
@@ -338,26 +338,24 @@
// this means that read_inode cannot create a superblock
// inode today. change if needed.
if (!IS_VALID_FILE_ENTRY(fe) || !(fe->i_flags & OCFS2_VALID_FL)) {
- LOG_ERROR_ARGS("invalid file entry! i_ino=%lu, "
- "fe->i_blkno=%llu, valid_flag = %d\n",
- inode->i_ino, fe->i_blkno,
- (fe->i_flags & OCFS2_VALID_FL));
+ mlog(ML_ERROR, "invalid file entry! i_ino=%lu, "
+ "fe->i_blkno=%llu, valid_flag = %d\n",
+ inode->i_ino, fe->i_blkno,
+ (fe->i_flags & OCFS2_VALID_FL));
goto bail;
}
if (le32_to_cpu(fe->i_fs_generation) != osb->fs_generation) {
- LOG_ERROR_ARGS("file entry generation does not match "
- "superblock! osb->fs_generation=%x, "
- "fe->i_fs_generation=%x\n",
- osb->fs_generation,
- le32_to_cpu(fe->i_fs_generation));
+ mlog(ML_ERROR, "file entry generation does not match "
+ "superblock! osb->fs_generation=%x, "
+ "fe->i_fs_generation=%x\n",
+ osb->fs_generation, le32_to_cpu(fe->i_fs_generation));
goto bail;
}
if (!inode->u.generic_ip && ocfs_inode_init_private(inode)) {
/* How can we recover gracefully? */
- LOG_ERROR_STR("unable to allocate private data for "
- "inode");
+ mlog(ML_ERROR, "unable to allocate private data for inode\n");
goto bail;
}
@@ -391,19 +389,18 @@
if (create_ino)
inode->i_ino = ino_from_blkno(inode->i_sb, fe->i_blkno);
- LOG_TRACE_ARGS("blkno = %llu, ino = %lu, create_ino = %s\n",
- fe->i_blkno, inode->i_ino,
- create_ino ? "true" : "false");
+ mlog(0, "blkno = %llu, ino = %lu, create_ino = %s\n",
+ fe->i_blkno, inode->i_ino, create_ino ? "true" : "false");
inode->i_nlink = fe->i_links_count;
if (fe->i_flags & OCFS2_LOCAL_ALLOC_FL) {
OCFS_I(inode)->ip_flags |= OCFS_INODE_BITMAP;
- LOG_TRACE_ARGS("local alloc inode: i_ino=%lu\n", inode->i_ino);
+ mlog(0, "local alloc inode: i_ino=%lu\n", inode->i_ino);
} else if (fe->i_flags & OCFS2_BITMAP_FL) {
OCFS_I(inode)->ip_flags |= OCFS_INODE_BITMAP;
} else if (fe->i_flags & OCFS2_SUPER_BLOCK_FL) {
- LOG_TRACE_ARGS("superblock inode: i_ino=%lu\n", inode->i_ino);
+ mlog(0, "superblock inode: i_ino=%lu\n", inode->i_ino);
// we can't actually hit this as read_inode can't handle
// superblocks today ;-)
BUG();
@@ -441,15 +438,15 @@
status = ocfs2_inode_lock_res_init(&OCFS_I(inode)->ip_meta_lockres,
OCFS_TYPE_META, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs2_inode_lock_res_init(&OCFS_I(inode)->ip_data_lockres,
OCFS_TYPE_DATA, inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_populate_inode */
@@ -462,18 +459,18 @@
int status;
int sysfile = 0;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p)\n", inode, args);
+ mlog_entry ("(0x%p, 0x%p)\n", inode, args);
status = -EINVAL;
if (inode == NULL || inode->i_sb == NULL) {
- LOG_ERROR_STR ("bad inode");
+ mlog(ML_ERROR, "bad inode\n");
goto bail;
}
sb = inode->i_sb;
osb = OCFS_SB(sb);
if (!args) {
- LOG_ERROR_STR("bad inode args");
+ mlog(ML_ERROR, "bad inode args\n");
make_bad_inode (inode);
goto bail;
}
@@ -483,7 +480,7 @@
* exist yet then nobody can be working on it! */
status = ocfs_read_block(osb, args->blkno, &bh, 0, NULL);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
make_bad_inode (inode);
goto bail;
}
@@ -500,8 +497,8 @@
status = -EINVAL;
if (ocfs_populate_inode (inode, fe, 0) < 0) {
- LOG_ERROR_ARGS("populate inode failed! i_blkno=%llu, i_ino=%lu\n",
- fe->i_blkno, inode->i_ino);
+ mlog(ML_ERROR, "populate inode failed! i_blkno=%llu, "
+ "i_ino=%lu\n", fe->i_blkno, inode->i_ino);
make_bad_inode (inode);
goto bail;
}
@@ -518,7 +515,7 @@
if (args && bh)
brelse(bh);
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
}
@@ -540,7 +537,7 @@
ocfs2_truncate_context *tc = NULL;
ocfs2_dinode *fe;
- LOG_ENTRY();
+ mlog_entry_void();
fe = (ocfs2_dinode *) fe_bh->b_data;
@@ -551,13 +548,13 @@
handle = ocfs_start_trans(osb, handle, OCFS_INODE_UPDATE_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_set_inode_size(handle, inode, fe_bh, 0ULL);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -566,13 +563,13 @@
status = ocfs_prepare_truncate(osb, inode, fe_bh, &tc);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_commit_truncate(osb, inode, fe_bh, tc);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bail:
@@ -582,7 +579,7 @@
if (tc)
ocfs_free_truncate_context(tc);
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
}
@@ -602,23 +599,23 @@
struct buffer_head *fe_bh = NULL;
ocfs2_dinode *fe;
- LOG_ENTRY_ARGS("(inode->i_ino = %lu)\n", inode->i_ino);
+ mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino);
if (OCFS_I(inode)->ip_flags & OCFS_INODE_SYSTEM_FILE) {
- LOG_TRACE_STR("Skipping system file delete.");
+ mlog(0, "Skipping system file delete.\n");
goto bail;
}
if (inode == osb->root_inode) {
- LOG_TRACE_STR("Skipping root inode delete.");
+ mlog(0, "Skipping root inode delete.\n");
goto bail;
}
spin_lock(&OCFS_I(inode)->ip_lock);
if (OCFS_I(inode)->ip_flags & OCFS_INODE_SKIP_DELETE) {
spin_unlock(&OCFS_I(inode)->ip_lock);
- LOG_TRACE_ARGS("Skipping delete of %lu because another node "
- "has done this for us.\n", inode->i_ino);
+ mlog(0, "Skipping delete of %lu because another node "
+ "has done this for us.\n", inode->i_ino);
goto bail;
}
spin_unlock(&OCFS_I(inode)->ip_lock);
@@ -629,8 +626,8 @@
* the node who's doing the actual deleting should handle it
* anyway. */
if (current == osb->vote_task) {
- LOG_TRACE_ARGS("Skipping delete of %lu because we're currently"
- "in process_vote\n", inode->i_ino);
+ mlog(0, "Skipping delete of %lu because we're currently"
+ "in process_vote\n", inode->i_ino);
goto bail;
}
@@ -641,7 +638,7 @@
status = ocfs2_meta_lock(inode, NULL, &fe_bh, 1);
atomic_dec(&inode->i_count);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -651,8 +648,8 @@
spin_lock(&OCFS_I(inode)->ip_lock);
if (OCFS_I(inode)->ip_flags & OCFS_INODE_SKIP_DELETE) {
spin_unlock(&OCFS_I(inode)->ip_lock);
- LOG_TRACE_ARGS("Skipping delete of %lu because another node "
- "has done this for us.\n", inode->i_ino);
+ mlog(0, "Skipping delete of %lu because another node "
+ "has done this for us.\n", inode->i_ino);
goto bail;
}
spin_unlock(&OCFS_I(inode)->ip_lock);
@@ -664,7 +661,7 @@
* avoid doing anything on disk and let them worry
* about deleting it. */
if (status != -EBUSY)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -672,20 +669,20 @@
if (!(fe->i_flags & OCFS2_ORPHANED_FL)) {
/* for lack of a better error? */
status = -EEXIST;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
/* has someone already deleted us?! baaad... */
if (fe->i_dtime) {
status = -EEXIST;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (fe->i_links_count) {
status = -EBUSY;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -693,7 +690,7 @@
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -702,13 +699,13 @@
-1);
if (!orphan_dir_inode) {
status = -EEXIST;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
ocfs_handle_add_inode(handle, orphan_dir_inode);
status = ocfs2_meta_lock(orphan_dir_inode, handle, &orphan_dir_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -718,34 +715,34 @@
* truncating the same file! */
status = ocfs_truncate_for_delete(osb, inode, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
inode_alloc_inode = ocfs_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE, le16_to_cpu(fe->i_suballoc_node));
if (!inode_alloc_inode) {
status = -EEXIST;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
ocfs_handle_add_inode(handle, inode_alloc_inode);
status = ocfs2_meta_lock(inode_alloc_inode, handle, &inode_alloc_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
handle = ocfs_start_trans(osb, handle, OCFS_DELETE_INODE_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_orphan_del(osb, handle, orphan_dir_inode, inode,
orphan_dir_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -753,7 +750,7 @@
status = ocfs_journal_access(handle, inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -762,14 +759,14 @@
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs2_free_dinode(handle, inode_alloc_inode,
inode_alloc_bh, fe);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -790,7 +787,7 @@
/* we must clear inode. */
clear_inode(inode);
- LOG_EXIT();
+ mlog_exit_void();
} /* ocfs_delete_inode */
/*
@@ -802,19 +799,19 @@
int status;
ocfs_super *osb;
- LOG_ENTRY();
+ mlog_entry_void();
if (!inode)
goto bail;
- LOG_TRACE_ARGS("Clearing inode: %llu, nlink = %u)\n",
- OCFS_I(inode)->ip_blkno, inode->i_nlink);
+ mlog(0, "Clearing inode: %llu, nlink = %u)\n", OCFS_I(inode)->ip_blkno,
+ inode->i_nlink);
/* we should not really be using osb in this context. */
osb = OCFS_SB(inode->i_sb);
if (!inode->u.generic_ip) {
- LOG_ERROR_ARGS("inode %lu has no generic_ip!\n", inode->i_ino);
+ mlog(ML_ERROR, "inode %lu has no generic_ip!\n", inode->i_ino);
goto bail;
}
@@ -832,7 +829,7 @@
/* blkno == 0 if this inode is newly created and hasn't been
* filled in yet. */
if (OCFS_I(inode)->ip_blkno == 0) {
- LOG_TRACE_STR("uhm, blkno = 0!");
+ mlog(0, "uhm, blkno = 0!\n");
goto bail;
}
@@ -840,7 +837,7 @@
status = ocfs2_drop_inode_locks(inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
ocfs2_lock_res_free(&OCFS_I(inode)->ip_meta_lockres);
ocfs2_lock_res_free(&OCFS_I(inode)->ip_data_lockres);
@@ -856,7 +853,7 @@
inode->u.generic_ip = NULL;
}
- LOG_EXIT ();
+ mlog_exit_void ();
} /* ocfs_clear_inode */
/*
@@ -889,7 +886,7 @@
tmperr = ocfs2_extent_map_get_blocks(inode, block, 1,
&p_blkno, NULL);
if (tmperr < 0) {
- LOG_ERROR_STATUS(tmperr);
+ mlog_errno(tmperr);
goto fail;
}
@@ -925,11 +922,11 @@
int status = 0;
ocfs_super *osb;
- LOG_ENTRY_ARGS("(inode = 0x%p, ino = %llu)\n", inode,
- inode ? OCFS_I(inode)->ip_blkno : 0ULL);
+ mlog_entry("(inode = 0x%p, ino = %llu)\n", inode,
+ inode ? OCFS_I(inode)->ip_blkno : 0ULL);
if (!inode) {
- LOG_TRACE_STR("eep, no inode!\n");
+ mlog(0, "eep, no inode!\n");
status = -ENOENT;
goto bail;
}
@@ -939,7 +936,7 @@
spin_lock(&OCFS_I(inode)->ip_lock);
if (INODE_DELETED(inode)) {
spin_unlock(&OCFS_I(inode)->ip_lock);
- LOG_TRACE_STR("inode deleted!\n");
+ mlog(0, "inode deleted!\n");
status = -ENOENT;
goto bail;
}
@@ -947,12 +944,12 @@
status = ocfs2_meta_lock(inode, NULL, NULL, 0);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
ocfs2_meta_unlock(inode, 0);
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_inode_revalidate */
@@ -972,12 +969,12 @@
ocfs2_dinode *fe = (ocfs2_dinode *) bh->b_data;
#warning "need to check the casts and the endian-ness in this function"
- LOG_ENTRY_ARGS("(inode %llu)\n", OCFS_I(inode)->ip_blkno);
+ mlog_entry("(inode %llu)\n", OCFS_I(inode)->ip_blkno);
status = ocfs_journal_access(handle, inode, bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -998,12 +995,12 @@
status = ocfs_journal_dirty(handle, bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
status = 0;
leave:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_mark_inode_dirty */
Modified: trunk/fs/ocfs2/journal.c
===================================================================
--- trunk/fs/ocfs2/journal.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/journal.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -31,7 +31,9 @@
#include <linux/highmem.h>
#include <linux/kthread.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_JOURNAL
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -50,8 +52,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_JOURNAL
-
spinlock_t trans_inc_lock = SPIN_LOCK_UNLOCKED;
static int ocfs_force_read_journal(struct inode *inode);
@@ -81,7 +81,7 @@
unsigned long old_id;
ocfs_journal * journal = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
journal = osb->journal;
@@ -90,7 +90,7 @@
if (atomic_read(&journal->j_num_trans) == 0) {
up_write(&journal->j_trans_barrier);
- LOG_TRACE_STR("No transactions for me to flush!");
+ mlog(0, "No transactions for me to flush!\n");
goto finally;
}
@@ -99,7 +99,7 @@
journal_unlock_updates(journal->j_journal);
if (status < 0) {
up_write(&journal->j_trans_barrier);
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto finally;
}
@@ -109,15 +109,13 @@
atomic_set(&journal->j_num_trans, 0);
up_write(&journal->j_trans_barrier);
-#ifdef VERBOSE_COMMIT_THREAD
- printk("(%u) commit_thread: flushed transaction %lu (%u handles)\n",
- current->pid, journal->j_trans_id, flushed);
-#endif
+ mlog(0, "commit_thread: flushed transaction %lu (%u handles)\n",
+ journal->j_trans_id, flushed);
ocfs2_kick_vote_thread(osb);
wake_up(&journal->j_checkpointed);
finally:
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_commit_cache */
@@ -213,7 +211,8 @@
retval = kmalloc(sizeof(*retval), GFP_KERNEL);
if (!retval) {
- LOG_ERROR_STR("Failed to allocate memory for journal handle!");
+ mlog(ML_ERROR, "Failed to allocate memory for journal "
+ "handle!\n");
return NULL;
}
memset(retval, 0, sizeof(*retval));
@@ -239,7 +238,7 @@
{
journal_t * journal = osb->journal->j_journal;
- LOG_ENTRY_ARGS ("(max_buffs = %d)\n", max_buffs);
+ mlog_entry ("(max_buffs = %d)\n", max_buffs);
if (!osb || !osb->journal->j_journal)
BUG();
@@ -249,14 +248,15 @@
/* JBD might support this, but our journalling code doesn't yet. */
if (journal_current_handle()) {
- LOG_ERROR_STR("Recursive transaction attempted!");
+ mlog(ML_ERROR, "Recursive transaction attempted!\n");
BUG();
}
if (!handle)
handle = ocfs_alloc_handle(osb);
if (!handle) {
- LOG_ERROR_STR("Failed to allocate memory for journal handle!");
+ mlog(ML_ERROR, "Failed to allocate memory for journal "
+ "handle!\n");
goto done_free;
}
@@ -269,8 +269,8 @@
if (IS_ERR(handle->k_handle)) {
up_read(&osb->journal->j_trans_barrier);
- LOG_ERROR_STR("journal_start() failed!");
- LOG_ERROR_STATUS((int)PTR_ERR(handle->k_handle));
+ mlog(ML_ERROR, "journal_start() failed!\n");
+ mlog_errno((int)PTR_ERR(handle->k_handle));
handle->k_handle = NULL;
goto done_free;
}
@@ -278,7 +278,7 @@
atomic_inc(&(osb->journal->j_num_trans));
handle->flags |= OCFS_HANDLE_STARTED;
- LOG_EXIT_PTR(handle);
+ mlog_exit_ptr(handle);
return handle;
done_free:
@@ -287,7 +287,7 @@
ocfs_commit_unstarted_handle(handle);
kfree(handle);
}
- LOG_EXIT_PTR(NULL);
+ mlog_exit(NULL);
return NULL;
} /* ocfs_start_trans */
@@ -328,28 +328,13 @@
}
}
-/* This for loop is for debug purposes. Basically we want to check the
- * BH_JBD bit on our buffers. If the transaction was checkpointed, then
- * none of them should have that bit set after the revoke
- * stage. Otherwise, they *should* have it set. */
-#define CHECK_JBD_BUFFERS(buffs, num_buffs) \
-do { \
- int __i; \
- for(__i = 0; __i < num_buffs; __i++) { \
- LOG_TRACE_ARGS("Checking block %u\n", buffs[__i]->b_blocknr); \
- if (buffer_jbd(buffs[__i])) \
- LOG_TRACE_ARGS("block %u has jbd bit set!\n", \
- buffs[__i]->b_blocknr); \
- } \
-} while (0)
-
/* This is trivial so we do it out of the main commit
* paths. Beware, it can be called from start_trans too! */
static void ocfs_commit_unstarted_handle(ocfs_journal_handle *handle)
{
ocfs_super *osb;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(!(handle->flags & OCFS_HANDLE_STARTED));
@@ -360,7 +345,7 @@
ocfs_handle_cleanup_locks(osb->journal, handle, 0);
kfree(handle);
- LOG_EXIT();
+ mlog_exit_void();
}
/*
@@ -374,13 +359,13 @@
int retval, sync;
ocfs_journal *journal;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(handle);
if (!(handle->flags & OCFS_HANDLE_STARTED)) {
ocfs_commit_unstarted_handle(handle);
- LOG_EXIT();
+ mlog_exit_void();
return;
}
@@ -402,8 +387,8 @@
* it'll have been committed when we return */
retval = journal_stop(kern_handle);
if (retval < 0) {
- LOG_ERROR_STATUS(retval);
- LOG_ERROR_STR("Could not commit transaction");
+ mlog_errno(retval);
+ mlog(ML_ERROR, "Could not commit transaction\n");
BUG();
}
@@ -414,7 +399,7 @@
handle->k_handle = NULL; /* it's been free'd in journal_stop */
kfree(handle);
- LOG_EXIT();
+ mlog_exit_void();
} /* ocfs_commit_trans */
/*
@@ -438,24 +423,23 @@
OCFS_ASSERT(handle->flags & OCFS_HANDLE_STARTED);
OCFS_ASSERT(nblocks);
- LOG_ENTRY();
+ mlog_entry_void();
- LOG_TRACE_ARGS("Trying to extend transaction by %d blocks\n", nblocks);
+ mlog(0, "Trying to extend transaction by %d blocks\n", nblocks);
status = journal_extend(handle->k_handle, nblocks);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (status > 0) {
- LOG_TRACE_STR("journal_extend failed, "
- "trying journal_restart\n");
+ mlog(0, "journal_extend failed, trying journal_restart\n");
status = journal_restart(handle->k_handle, nblocks);
if (status < 0) {
#warning we need to handle this better
handle->k_handle = NULL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
handle->max_buffs = nblocks;
@@ -465,7 +449,7 @@
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -484,7 +468,7 @@
OCFS_ASSERT(bh);
OCFS_ASSERT((handle->flags & OCFS_HANDLE_STARTED));
- LOG_ENTRY_ARGS("(bh->b_blocknr=%llu, type=%d (\"%s\"), "
+ mlog_entry("(bh->b_blocknr=%llu, type=%d (\"%s\"), "
"bh->b_size = %hu)\n",
(unsigned long long)bh->b_blocknr, type,
(type == OCFS_JOURNAL_ACCESS_CREATE) ?
@@ -493,9 +477,9 @@
/* we can safely remove this assertion after testing. */
if (!buffer_uptodate(bh)) {
- printk("ocfs2: giving me a buffer that's not uptodate!\n");
- printk("ocfs2: b_blocknr=%llu\n",
- (unsigned long long)bh->b_blocknr);
+ mlog(ML_ERROR, "giving me a buffer that's not uptodate!\n");
+ mlog(ML_ERROR, "b_blocknr=%llu\n",
+ (unsigned long long)bh->b_blocknr);
BUG();
}
@@ -512,14 +496,14 @@
default:
status = -EINVAL;
- LOG_ERROR_STR("Uknown access type!");
+ mlog(ML_ERROR, "Uknown access type!\n");
}
up(&OCFS_I(inode)->ip_io_sem);
if (status < 0)
- LOG_ERROR_ARGS("Error %d getting %d access to buffer!\n",
- status, type);
- LOG_EXIT_STATUS(status);
+ mlog(ML_ERROR, "Error %d getting %d access to buffer!\n",
+ status, type);
+ mlog_exit(status);
return status;
} /* ocfs_journal_access */
@@ -534,16 +518,16 @@
OCFS_ASSERT((handle->flags & OCFS_HANDLE_STARTED));
- LOG_ENTRY_ARGS("(bh->b_blocknr=%llu)\n",
+ mlog_entry("(bh->b_blocknr=%llu)\n",
(unsigned long long)bh->b_blocknr);
status = journal_dirty_metadata(handle->k_handle, bh);
if (status < 0)
- LOG_ERROR_ARGS("Could not dirty metadata buffer. "
- "(bh->b_blocknr=%llu)\n",
- (unsigned long long)bh->b_blocknr);
+ mlog(ML_ERROR, "Could not dirty metadata buffer. "
+ "(bh->b_blocknr=%llu)\n",
+ (unsigned long long)bh->b_blocknr);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_journal_dirty */
@@ -558,7 +542,7 @@
lock = kmem_cache_alloc(ocfs2_lock_cache, GFP_NOFS);
if (!lock) {
status = -ENOMEM;
- LOG_ERROR_STATUS(-ENOMEM);
+ mlog_errno(-ENOMEM);
goto bail;
}
@@ -571,7 +555,7 @@
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -593,8 +577,8 @@
ocfs_set_inode_lock_trans(journal, inode);
ocfs2_meta_unlock(inode, 1);
if (atomic_read(&inode->i_count) == 1)
- LOG_ERROR_ARGS("Inode %llu, I'm doing a last iput "
- "for!", OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "Inode %llu, I'm doing a last iput "
+ "for!", OCFS_I(inode)->ip_blkno);
iput(inode);
kmem_cache_free(ocfs2_lock_cache, lock);
}
@@ -614,7 +598,7 @@
struct buffer_head *bh = NULL;
ocfs_super *osb;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(journal);
@@ -624,12 +608,12 @@
inode = ocfs_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
osb->slot_num);
if (inode == NULL) {
- LOG_ERROR_STR("access error");
status = -EACCES;
+ mlog_errno(status);
goto done;
}
if (is_bad_inode (inode)) {
- LOG_ERROR_STR("access error (bad inode)");
+ mlog(ML_ERROR, "access error (bad inode)\n");
iput (inode);
inode = NULL;
status = -EACCES;
@@ -641,44 +625,43 @@
status = ocfs2_meta_lock(inode, NULL, &bh, 1);
if (status < 0) {
if (status != -ERESTARTSYS)
- LOG_ERROR_STR("Could not get lock on journal!");
+ mlog(ML_ERROR, "Could not get lock on journal!\n");
goto done;
}
fe = (ocfs2_dinode *) bh->b_data;
if (fe->i_size < OCFS2_MIN_JOURNAL_SIZE) {
- LOG_ERROR_ARGS("Journal file size (%llu) is too small!",
- fe->i_size);
+ mlog(ML_ERROR, "Journal file size (%llu) is too small!",
+ fe->i_size);
status = -EINVAL;
goto done;
}
- LOG_TRACE_ARGS("fe->i_size = %llu\n", fe->i_size);
- LOG_TRACE_ARGS("fe->i_clusters = %u\n", fe->i_clusters);
- LOG_TRACE_ARGS("fe->i_blkno = %llu\n", fe->i_blkno);
- LOG_TRACE_ARGS("inode->ip_clusters = %u\n",
- OCFS_I(inode)->ip_clusters);
+ mlog(0, "fe->i_size = %llu\n", fe->i_size);
+ mlog(0, "fe->i_clusters = %u\n", fe->i_clusters);
+ mlog(0, "fe->i_blkno = %llu\n", fe->i_blkno);
+ mlog(0, "inode->ip_clusters = %u\n",
+ OCFS_I(inode)->ip_clusters);
if (OCFS_I(inode)->ip_clusters != fe->i_clusters)
- LOG_ERROR_ARGS("inode and fe alloc sizes differ! "
- "(%u != %u", OCFS_I(inode)->ip_clusters,
- fe->i_clusters);
+ mlog(ML_ERROR, "inode and fe alloc sizes differ! (%u != %u",
+ OCFS_I(inode)->ip_clusters, fe->i_clusters);
if (inode->i_size != fe->i_size)
- LOG_ERROR_ARGS("inode and fe i_size's differ! (%llu != %llu",
- inode->i_size, fe->i_size);
+ mlog(ML_ERROR, "inode and fe i_size's differ! (%llu != %llu",
+ inode->i_size, fe->i_size);
OCFS_I(inode)->ip_open_cnt++;
/* call the kernels journal init function now */
j_journal = journal_init_inode(inode);
if (j_journal == NULL) {
- LOG_ERROR_STR("Linux journal layer error");
+ mlog(ML_ERROR, "Linux journal layer error\n");
status = -1;
goto done;
}
- LOG_TRACE_STR("Returned from journal_init_inode");
- LOG_TRACE_ARGS("j_journal->j_maxlen = %u\n", j_journal->j_maxlen);
+ mlog(0, "Returned from journal_init_inode\n");
+ mlog(0, "j_journal->j_maxlen = %u\n", j_journal->j_maxlen);
j_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
*dirty = (le32_to_cpu(fe->id1.journal1.ij_flags) &
@@ -702,7 +685,7 @@
}
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_journal_init */
@@ -715,7 +698,7 @@
struct buffer_head *bh = journal->j_bh;
ocfs2_dinode *fe;
- LOG_ENTRY();
+ mlog_entry_void();
fe = (ocfs2_dinode *) bh->b_data;
OCFS_ASSERT(IS_VALID_FILE_ENTRY(fe));
@@ -729,9 +712,9 @@
status = ocfs_write_block(osb, bh, journal->j_inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -745,7 +728,7 @@
struct inode * inode = NULL;
int num_running_trans = 0;
- LOG_ENTRY();
+ mlog_entry_void();
if (!osb)
BUG();
@@ -755,7 +738,7 @@
if (journal->j_state != OCFS_JOURNAL_LOADED) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto done;
}
@@ -765,8 +748,8 @@
num_running_trans = atomic_read(&(osb->journal->j_num_trans));
if (num_running_trans > 0)
- LOG_TRACE_ARGS("Shutting down journal: must wait on %d"
- " running transactions!\n", 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*
* release any locks that are still held.
@@ -779,7 +762,7 @@
* completely destroy the journal. */
if (osb->commit_task) {
/* Wait for the commit thread */
- LOG_TRACE_STR ("Waiting for ocfs2commit to exit....");
+ mlog(0, "Waiting for ocfs2commit to exit....\n");
kthread_stop(osb->commit_task);
osb->commit_task = NULL;
}
@@ -788,7 +771,7 @@
status = ocfs_journal_toggle_dirty(osb, 0);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
/* Shutdown the kernel journal system */
journal_destroy(journal->j_journal);
@@ -807,7 +790,7 @@
done:
if (inode)
iput(inode);
- LOG_EXIT();
+ mlog_exit_void();
}
int ocfs_journal_load(ocfs_journal *journal)
@@ -816,7 +799,7 @@
int olderr = 0;
ocfs_super *osb;
- LOG_ENTRY();
+ mlog_entry_void();
if (!journal)
BUG();
@@ -825,20 +808,20 @@
status = journal_load(journal->j_journal);
if (status < 0) {
- LOG_ERROR_STR("Failed to load journal!");
+ mlog(ML_ERROR, "Failed to load journal!\n");
goto done;
}
olderr = journal_errno(journal->j_journal);
if (olderr) {
- printk("ocfs2: last journal left error code %d\n", olderr);
+ mlog(ML_ERROR, "last journal left error code %d\n", olderr);
journal_ack_err(journal->j_journal);
journal_clear_err(journal->j_journal);
}
status = ocfs_journal_toggle_dirty(osb, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto done;
}
@@ -848,13 +831,13 @@
if (IS_ERR(osb->commit_task)) {
status = PTR_ERR(osb->commit_task);
osb->commit_task = NULL;
- LOG_ERROR_ARGS ("unable to launch ocfs2commit thread, "
- "error=%d", status);
+ mlog(ML_ERROR, "unable to launch ocfs2commit thread, error=%d",
+ status);
goto done;
}
done:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -865,23 +848,23 @@
{
int status;
- LOG_ENTRY();
+ mlog_entry_void();
if (!journal)
BUG();
status = journal_wipe(journal->j_journal, full);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_journal_toggle_dirty(journal->j_osb, 0);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -904,14 +887,14 @@
#define CONCURRENT_JOURNAL_FILL 32
struct buffer_head *bhs[CONCURRENT_JOURNAL_FILL];
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(inode->i_blocks ==
(inode->i_size >> inode->i_sb->s_blocksize_bits));
memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL);
- LOG_TRACE_ARGS("Force reading %lu blocks\n", inode->i_blocks);
+ mlog(0, "Force reading %lu blocks\n", inode->i_blocks);
v_blkno = 0;
while (v_blkno < inode->i_blocks) {
@@ -919,7 +902,7 @@
1, &p_blkno,
&p_blocks);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -930,7 +913,7 @@
p_blkno, p_blocks, bhs, 0,
inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -946,7 +929,7 @@
for(i = 0; i < CONCURRENT_JOURNAL_FILL; i++)
if (bhs[i])
brelse(bhs[i]);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -974,9 +957,9 @@
struct list_head *p, *n;
LIST_HEAD(tmp_la_list);
- LOG_ENTRY();
+ mlog_entry_void();
- LOG_TRACE_ARGS("completing recovery from keventd\n");
+ mlog(0, "completing recovery from keventd\n");
spin_lock(&journal->j_lock);
list_splice_init(&journal->j_la_cleanups, &tmp_la_list);
@@ -986,8 +969,8 @@
item = list_entry(p, struct ocfs2_la_recovery_item, lri_list);
list_del_init(&item->lri_list);
- LOG_TRACE_ARGS("Clean up local alloc %llu\n",
- item->lri_dinode->i_blkno);
+ mlog(0, "Clean up local alloc %llu\n",
+ item->lri_dinode->i_blkno);
ret = ocfs_complete_local_alloc_recovery(osb,
item->lri_dinode);
@@ -996,7 +979,7 @@
kfree(item);
if (ret < 0)
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
}
spin_lock(&journal->j_lock);
@@ -1005,15 +988,15 @@
spin_unlock(&journal->j_lock);
if (cleanup_orphans) {
- LOG_TRACE_STR("Cleanup the orphan dir\n");
+ mlog(0, "Cleanup the orphan dir\n");
ret = ocfs_recover_orphans(osb);
if (ret < 0)
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
}
- LOG_TRACE_STR("Recovery completion\n");
+ mlog(0, "Recovery completion\n");
- LOG_EXIT();
+ mlog_exit_void();
}
/* NOTE: This function always eats the reference to la_dinode, either
@@ -1030,7 +1013,7 @@
* than capable of reclaiming unused space. */
kfree(la_dinode);
- LOG_ERROR_STATUS(-ENOMEM);
+ mlog_errno(-ENOMEM);
return;
}
@@ -1061,7 +1044,7 @@
ocfs_super *osb = arg;
ocfs2_dinode *la_dinode_cp;
- LOG_ENTRY();
+ mlog_entry_void();
status = ocfs_wait_on_mount(osb);
if (status < 0) {
@@ -1073,7 +1056,7 @@
restart:
status = ocfs2_super_lock(osb, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1082,25 +1065,25 @@
node_num = ocfs_node_map_first_set_bit(osb,
&osb->recovery_map);
if (node_num == OCFS_INVALID_NODE_NUM) {
- LOG_TRACE_ARGS("Out of nodes to recover.\n");
+ mlog(0, "Out of nodes to recover.\n");
break;
}
la_dinode_cp = NULL;
status = ocfs_recover_node(osb, node_num, &la_dinode_cp);
if (status < 0) {
- printk("ocfs2: Error %d recovering node %d on device "
- "(%u,%u)!\n", status, node_num,
- MAJOR(osb->sb->s_dev),MINOR(osb->sb->s_dev));
- printk("ocfs2: Volume requires unmount.\n");
+ mlog(ML_ERROR, "Error %d recovering node %d on device "
+ "(%u,%u)!\n", status, node_num,
+ MAJOR(osb->sb->s_dev),MINOR(osb->sb->s_dev));
+ mlog(ML_ERROR, "Volume requires unmount.\n");
continue;
}
ocfs_recovery_map_clear(osb, node_num);
if (la_dinode_cp) {
- LOG_TRACE_ARGS("queueing local alloc cleanup for "
- "node %d\n", node_num);
+ mlog(0, "queueing local alloc cleanup for node %d\n",
+ node_num);
ocfs2_queue_local_alloc_cleanup(osb->journal,
la_dinode_cp);
}
@@ -1126,7 +1109,7 @@
up(&osb->recovery_lock);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
/* no one is callint kthread_stop() for us so the kthread() api
* requires that we call do_exit(). And it isn't exported, but
* complete_and_exit() seems to be a minimal wrapper around it. */
@@ -1136,7 +1119,7 @@
void ocfs_recovery_thread(ocfs_super *osb, int node_num)
{
- LOG_ENTRY_ARGS("(node_num=%d, osb->node_num = %d)\n",
+ mlog_entry("(node_num=%d, osb->node_num = %d)\n",
node_num, osb->node_num);
down(&osb->recovery_lock);
@@ -1146,7 +1129,7 @@
* the recovery map to empty. */
ocfs_recovery_map_set(osb, node_num);
- LOG_TRACE_STR("starting recovery thread...");
+ mlog(0, "starting recovery thread...\n");
if (osb->recovery_thread_task)
goto out;
@@ -1154,7 +1137,7 @@
osb->recovery_thread_task = kthread_run(__ocfs_recovery_thread, osb,
"ocfs2rec-%d", osb->osb_id);
if (IS_ERR(osb->recovery_thread_task)) {
- LOG_ERROR_STATUS((int)PTR_ERR(osb->recovery_thread_task));
+ mlog_errno((int)PTR_ERR(osb->recovery_thread_task));
osb->recovery_thread_task = NULL;
}
@@ -1162,7 +1145,7 @@
up(&osb->recovery_lock);
wake_up(&osb->recovery_event);
- LOG_EXIT();
+ mlog_exit_void();
}
/* Does the actual journal replay and marks the journal inode as
@@ -1183,14 +1166,14 @@
slot_num);
if (inode == NULL) {
status = -EACCES;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto done;
}
if (is_bad_inode (inode)) {
status = -EACCES;
iput (inode);
inode = NULL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto done;
}
SET_INODE_JOURNAL(inode);
@@ -1198,10 +1181,9 @@
status = ocfs2_meta_lock_flags(inode, NULL, &bh, 1,
OCFS2_META_LOCK_RECOVERY);
if (status < 0) {
- LOG_TRACE_ARGS("status returned from ocfs2_meta_lock=%d\n",
- status);
+ mlog(0, "status returned from ocfs2_meta_lock=%d\n", status);
if (status != -ERESTARTSYS)
- LOG_ERROR_STR("Could not lock journal!");
+ mlog(ML_ERROR, "Could not lock journal!\n");
goto done;
}
got_lock = 1;
@@ -1211,33 +1193,33 @@
flags = le32_to_cpu(fe->id1.journal1.ij_flags);
if (!(flags & OCFS2_JOURNAL_DIRTY_FL)) {
- LOG_TRACE_ARGS("No recovery required for node %d\n", node_num);
+ mlog(0, "No recovery required for node %d\n", node_num);
goto done;
}
- printk("ocfs2: Recovering node %d from slot %d on device (%u,%u)\n",
- node_num, slot_num, MAJOR(osb->sb->s_dev),
- MINOR(osb->sb->s_dev));
+ mlog(ML_NOTICE, "Recovering node %d from slot %d on device (%u,%u)\n",
+ node_num, slot_num, MAJOR(osb->sb->s_dev),
+ MINOR(osb->sb->s_dev));
OCFS_I(inode)->ip_clusters = fe->i_clusters;
status = ocfs_force_read_journal(inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto done;
}
- LOG_TRACE_STR("calling journal_init_inode");
+ mlog(0, "calling journal_init_inode\n");
journal = journal_init_inode(inode);
if (journal == NULL) {
- LOG_ERROR_STR("Linux journal layer error");
+ mlog(ML_ERROR, "Linux journal layer error\n");
status = -EIO;
goto done;
}
status = journal_load(journal);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
if (!igrab(inode))
BUG();
journal_destroy(journal);
@@ -1245,12 +1227,12 @@
}
/* wipe the journal */
- LOG_TRACE_STR("flushing the journal.");
+ mlog(0, "flushing the journal.\n");
journal_lock_updates(journal);
status = journal_flush(journal);
journal_unlock_updates(journal);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
/* This will mark the node clean */
flags = le32_to_cpu(fe->id1.journal1.ij_flags);
@@ -1259,7 +1241,7 @@
status = ocfs_write_block(osb, bh, inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
if (!igrab(inode))
BUG();
@@ -1277,7 +1259,7 @@
if (bh)
brelse(bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1305,12 +1287,12 @@
int slot_num;
ocfs2_slot_info *si = osb->slot_info;
- LOG_ENTRY_ARGS("(node_num=%d, osb->node_num = %d)\n",
+ mlog_entry("(node_num=%d, osb->node_num = %d)\n",
node_num, osb->node_num);
*la_copy = NULL;
- LOG_TRACE_ARGS("ocfs2_recover_node: checking node %d\n", node_num);
+ mlog(0, "ocfs2_recover_node: checking node %d\n", node_num);
/* Should not ever be called to recover ourselves -- in that
* case we should've called ocfs_journal_load instead. */
@@ -1321,24 +1303,24 @@
slot_num = ocfs2_node_num_to_slot(si, node_num);
if (slot_num == OCFS_INVALID_NODE_NUM) {
status = 0;
- LOG_TRACE_STR("ocfs2_recover_node: no slot for this node, so "
- "no recovery required.");
+ mlog(0, "ocfs2_recover_node: no slot for this node, so "
+ "no recovery required.\n");
goto done;
}
- LOG_TRACE_ARGS("ocfs2_recover_node: node %d was using slot %d\n",
- node_num, slot_num);
+ mlog(0, "ocfs2_recover_node: node %d was using slot %d\n",
+ node_num, slot_num);
status = ocfs2_replay_journal(osb, node_num, slot_num);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto done;
}
/* Stamp a clean local alloc file AFTER recovering the journal... */
status = ocfs_begin_local_alloc_recovery(osb, slot_num, la_copy);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto done;
}
@@ -1347,12 +1329,12 @@
ocfs2_clear_slot(si, slot_num);
status = ocfs2_update_disk_slots(osb, si);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
status = 0;
done:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1368,12 +1350,12 @@
inode = ocfs_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
slot_num);
if (inode == NULL) {
- LOG_ERROR_STR("access error");
+ mlog(ML_ERROR, "access error\n");
status = -EACCES;
goto bail;
}
if (is_bad_inode (inode)) {
- LOG_ERROR_STR("access error (bad inode)");
+ mlog(ML_ERROR, "access error (bad inode)\n");
iput (inode);
inode = NULL;
status = -EACCES;
@@ -1385,7 +1367,7 @@
status = ocfs2_meta_lock_flags(inode, NULL, NULL, 1, flags);
if (status < 0) {
if (status != -EAGAIN)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1428,7 +1410,7 @@
* setting / checking the recovery bits. */
ocfs_recovery_thread(osb, node_num);
} else if ((status < 0) && (status != -EAGAIN)) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1438,7 +1420,7 @@
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1459,7 +1441,7 @@
-1);
if (!orphan_dir_inode) {
status = -ENOENT;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1467,7 +1449,7 @@
status = ocfs2_meta_lock(orphan_dir_inode, NULL, NULL, 0);
if (status < 0) {
up(&orphan_dir_inode->i_sem);
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
have_disk_lock = 1;
@@ -1484,7 +1466,7 @@
up(&orphan_dir_inode->i_sem);
if (bh)
brelse(bh);
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1497,7 +1479,7 @@
de, bh, local)) {
up(&orphan_dir_inode->i_sem);
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
brelse (bh);
goto bail;
}
@@ -1509,17 +1491,17 @@
if (!le64_to_cpu(de->inode))
continue;
if (de->file_type > OCFS2_FT_MAX) {
- LOG_ERROR_ARGS("block %llu contains invalid "
- "de: inode = %llu, rec_len = "
- "%u, name_len = %u, file_type "
- "= %u, name='%.*s'\n",
- (unsigned long long) bh->b_blocknr,
- le64_to_cpu(de->inode),
- le16_to_cpu(de->rec_len),
- de->name_len,
- de->file_type,
- de->name_len,
- de->name);
+ mlog(ML_ERROR, "block %llu contains invalid "
+ "de: inode = %llu, rec_len = %u, "
+ "name_len = %u, file_type = %u, "
+ "name='%.*s'\n",
+ (unsigned long long) bh->b_blocknr,
+ le64_to_cpu(de->inode),
+ le16_to_cpu(de->rec_len),
+ de->name_len,
+ de->file_type,
+ de->name_len,
+ de->name);
continue;
}
if (de->name_len == 1 && !strncmp(".", de->name, 1))
@@ -1570,12 +1552,11 @@
* MOUNTED flag, but this is set right before
* dismount_volume() so we can trust it. */
if (atomic_read(&osb->vol_state) == VOLUME_DISABLED) {
- LOG_TRACE_STR("mount error, exiting!");
+ mlog(0, "mount error, exiting!\n");
return -EBUSY;
}
- LOG_TRACE_ARGS("vol_state = %d, waiting!\n",
- atomic_read(&osb->vol_state));
+ mlog(0, "vol_state = %d, waiting!\n", atomic_read(&osb->vol_state));
/* one day my prince will bring me a wait queue. */
schedule();
@@ -1600,23 +1581,22 @@
|| kthread_should_stop(),
OCFS_CHECKPOINT_INTERVAL);
if (status == 0)
- LOG_TRACE_STR("timed out");
+ mlog(0, "timed out\n");
else if (status == -ERESTARTSYS)
- LOG_TRACE_STR("signal pending\n");
+ mlog(0, "signal pending\n");
else
- LOG_TRACE_STR("woken");
+ mlog(0, "woken\n");
status = ocfs_commit_cache(osb);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
-#ifdef VERBOSE_COMMIT_THREAD
if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){
- printk("(%u) commit_thread: %u transactions pending "
- "on shutdown\n", current->pid,
- atomic_read(&journal->j_num_trans));
+ mlog(ML_KTHREAD, "commit_thread: %u transactions "
+ "pending on shutdown\n",
+ atomic_read(&journal->j_num_trans));
}
-#endif
+
}
return 0;
Modified: trunk/fs/ocfs2/localalloc.c
===================================================================
--- trunk/fs/ocfs2/localalloc.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/localalloc.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -23,8 +23,6 @@
* Boston, MA 021110-1307, USA.
*/
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_LOCALALLOC
-
#include "ocfs_compat.h"
#include <linux/fs.h>
@@ -33,7 +31,9 @@
#include <linux/highmem.h>
#include <linux/bitops.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_DISK_ALLOC
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -140,7 +140,7 @@
u32 num_used;
struct inode *inode = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
/* we don't enable local alloc on cluster sizes >= 128k */
if (osb->s_clustersize > OCFS_LOCAL_ALLOC_MAX_CSIZE)
@@ -151,20 +151,20 @@
osb->slot_num);
if (!inode) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_read_block(osb, OCFS_I(inode)->ip_blkno, &alloc_bh, 0,
inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
alloc = (ocfs2_dinode *) alloc_bh->b_data;
if (!(alloc->i_flags & (OCFS2_LOCAL_ALLOC_FL|OCFS2_BITMAP_FL))) {
- LOG_ERROR_ARGS("Invalid local alloc inode, %llu\n",
+ mlog(ML_ERROR, "Invalid local alloc inode, %llu\n",
OCFS_I(inode)->ip_blkno);
status = -EINVAL;
goto bail;
@@ -180,7 +180,7 @@
|| alloc->id1.bitmap1.i_used
|| alloc->id1.bitmap1.i_total
|| OCFS2_LOCAL_ALLOC(alloc)->la_bm_off) {
- LOG_ERROR_ARGS("Local alloc hasn't been recovered!\n"
+ mlog(ML_ERROR, "Local alloc hasn't been recovered!\n"
"found = %u, set = %u, taken = %u, off = %u\n",
num_used,
le32_to_cpu(alloc->id1.bitmap1.i_used),
@@ -192,7 +192,7 @@
if ((OCFS2_LOCAL_ALLOC(alloc)->la_size == 0) ||
(OCFS2_LOCAL_ALLOC(alloc)->la_size > ocfs2_local_alloc_size(inode->i_sb))) {
- LOG_ERROR_ARGS("Local alloc size is invalid (la_size = %u)\n",
+ mlog(ML_ERROR, "Local alloc size is invalid (la_size = %u)\n",
OCFS2_LOCAL_ALLOC(alloc)->la_size);
status = -EINVAL;
goto bail;
@@ -208,7 +208,7 @@
if (inode)
iput(inode);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_load_local_alloc */
@@ -233,7 +233,7 @@
ocfs2_dinode *alloc_copy = NULL;
ocfs2_dinode *alloc = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
local_alloc_inode =
ocfs_get_system_file_inode(osb,
@@ -241,7 +241,7 @@
osb->slot_num);
if (!local_alloc_inode) {
status = -ENOENT;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
oip = OCFS_I(local_alloc_inode);
@@ -259,7 +259,7 @@
handle = ocfs_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -268,21 +268,21 @@
-1);
if (!main_bm_inode) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
ocfs_handle_add_inode(handle, main_bm_inode);
status = ocfs2_meta_lock(main_bm_inode, handle, &main_bm_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
/* WINDOW_MOVE_CREDITS is a bit heavy... */
handle = ocfs_start_trans(osb, handle, OCFS_WINDOW_MOVE_CREDITS);
if (!handle) {
- LOG_ERROR_STATUS(-ENOMEM);
+ mlog_errno(-ENOMEM);
goto bail;
}
@@ -299,7 +299,7 @@
status = ocfs_journal_access(handle, local_alloc_inode, bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -307,7 +307,7 @@
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -317,7 +317,7 @@
status = ocfs_sync_local_to_main(osb, handle, alloc_copy,
main_bm_inode, main_bm_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
if (handle)
@@ -335,7 +335,7 @@
if (alloc_copy)
kfree(alloc_copy);
- LOG_EXIT();
+ mlog_exit_void();
} /* ocfs_shutdown_local_alloc */
/*
@@ -356,7 +356,7 @@
struct inode *inode = NULL;
ocfs2_dinode *alloc;
- LOG_ENTRY_ARGS("(slot_num = %d)\n", slot_num);
+ mlog_entry("(slot_num = %d)\n", slot_num);
*alloc_copy = NULL;
@@ -365,14 +365,14 @@
slot_num);
if (!inode) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_read_block(osb, OCFS_I(inode)->ip_blkno, &alloc_bh, 0,
inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -388,7 +388,7 @@
status = ocfs_write_block(osb, alloc_bh, inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
if ((status < 0) && (*alloc_copy)) {
@@ -402,7 +402,7 @@
if (inode)
iput(inode);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_begin_local_alloc_recovery */
@@ -420,12 +420,12 @@
struct buffer_head *main_bm_bh = NULL;
struct inode *main_bm_inode = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
handle = ocfs_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -434,21 +434,21 @@
-1);
if (!main_bm_inode) {
status = -EINVAL;
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
ocfs_handle_add_inode(handle, main_bm_inode);
status = ocfs2_meta_lock(main_bm_inode, handle, &main_bm_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
handle = ocfs_start_trans(osb, handle, OCFS_WINDOW_MOVE_CREDITS);
if (!handle) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -458,7 +458,7 @@
status = ocfs_sync_local_to_main(osb, handle, alloc,
main_bm_inode, main_bm_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
if (handle)
@@ -470,7 +470,7 @@
if (main_bm_inode)
iput(main_bm_inode);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -493,7 +493,7 @@
struct inode *local_alloc_inode;
unsigned int free_bits;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(passed_handle);
OCFS_ASSERT(ac);
@@ -505,7 +505,7 @@
osb->slot_num);
if (!local_alloc_inode) {
status = -ENOENT;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
ocfs_handle_add_inode(passed_handle, local_alloc_inode);
@@ -517,13 +517,13 @@
if (bits_wanted > ocfs2_clusters_for_bytes(osb->sb,
OCFS_LOCAL_ALLOC_MAX_ALLOC)) {
- LOG_TRACE_STR("Asking for more than max local alloction!\n");
+ mlog(0, "Asking for more than max local alloction!\n");
status = -ENOSPC;
goto bail;
}
if (bits_wanted > ocfs_local_alloc_window_bits(osb)) {
- LOG_TRACE_STR("Asking for more than my max window size!\n");
+ mlog(0, "Asking for more than my max window size!\n");
status = -ENOSPC;
goto bail;
}
@@ -541,7 +541,7 @@
ocfs_local_alloc_slide_window(osb, local_alloc_inode);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -555,7 +555,7 @@
if (local_alloc_inode)
iput(local_alloc_inode);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -572,7 +572,7 @@
void *bitmap;
ocfs2_dinode *alloc;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(ac->ac_which == OCFS_AC_USE_LOCAL);
bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given;
@@ -583,7 +583,7 @@
if (start == -1) {
/* TODO: Shouldn't we just BUG here? */
status = -ENOSPC;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -597,7 +597,7 @@
osb->local_alloc_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -609,13 +609,13 @@
status = ocfs_journal_dirty(handle, osb->local_alloc_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -628,13 +628,13 @@
u8 *buffer;
u32 count = 0;
- LOG_ENTRY();
+ mlog_entry_void();
buffer = OCFS2_LOCAL_ALLOC(alloc)->la_bitmap;
for (i = 0; i < OCFS2_LOCAL_ALLOC(alloc)->la_size; i++)
count += hweight8(buffer[i]);
- LOG_EXIT_ULONG ((unsigned long)count);
+ mlog_exit(count);
return count;
} /* ocfs_local_alloc_count_bits */
@@ -648,10 +648,10 @@
int numfound, bitoff, left, startoff, lastzero;
void *bitmap = NULL;
- LOG_ENTRY_ARGS("(numbits wanted = %u)\n", numbits);
+ mlog_entry("(numbits wanted = %u)\n", numbits);
if (!alloc->id1.bitmap1.i_total) {
- LOG_TRACE_STR("No bits in my window!");
+ mlog(0, "No bits in my window!\n");
bitoff = -1;
goto bail;
}
@@ -663,10 +663,10 @@
left = le32_to_cpu(alloc->id1.bitmap1.i_total);
while ((bitoff = ocfs2_find_next_zero_bit(bitmap, left, startoff)) != -1) {
if (bitoff == left) {
- /* LOG_TRACE_ARGS("bitoff (%d) == left", bitoff); */
+ /* mlog(0, "bitoff (%d) == left", bitoff); */
break;
}
- /* LOG_TRACE_ARGS("Found a zero: bitoff = %d, startoff = %d, "
+ /* mlog(0, "Found a zero: bitoff = %d, startoff = %d, "
"numfound = %d\n", bitoff, startoff, numfound);*/
/* Ok, we found a zero bit... is it contig. or do we
@@ -682,13 +682,13 @@
}
/* we got everything we needed */
if (numfound == numbits) {
- /* LOG_TRACE_STR("Found it all!"); */
+ /* mlog(0, "Found it all!\n"); */
break;
}
}
- LOG_TRACE_ARGS("Exiting loop, bitoff = %d, numfound = %d\n", bitoff,
- numfound);
+ mlog(0, "Exiting loop, bitoff = %d, numfound = %d\n", bitoff,
+ numfound);
if (numfound == numbits)
bitoff = startoff - numfound;
@@ -696,7 +696,7 @@
bitoff = -1;
bail:
- LOG_EXIT_STATUS(bitoff);
+ mlog_exit(bitoff);
return bitoff;
} /* ocfs_local_find_alloc_clear_bits */
@@ -706,7 +706,7 @@
static void ocfs_clear_local_alloc(ocfs2_dinode *alloc)
{
int i;
- LOG_ENTRY();
+ mlog_entry_void();
alloc->id1.bitmap1.i_total = 0;
alloc->id1.bitmap1.i_used = 0;
@@ -714,7 +714,7 @@
for(i = 0; i < OCFS2_LOCAL_ALLOC(alloc)->la_size; i++)
OCFS2_LOCAL_ALLOC(alloc)->la_bitmap[i] = 0;
- LOG_EXIT();
+ mlog_exit_void();
} /* ocfs_clear_local_alloc */
#if 0
@@ -756,18 +756,18 @@
u64 blkno;
void *bitmap;
- LOG_ENTRY_ARGS("total = %u, COUNT = %u, used = %u\n",
+ mlog_entry("total = %u, COUNT = %u, used = %u\n",
le32_to_cpu(alloc->id1.bitmap1.i_total),
ocfs_local_alloc_count_bits(alloc),
le32_to_cpu(alloc->id1.bitmap1.i_used));
if (!alloc->id1.bitmap1.i_total) {
- LOG_TRACE_STR("nothing to sync!");
+ mlog(0, "nothing to sync!\n");
goto bail;
}
if (alloc->id1.bitmap1.i_used == alloc->id1.bitmap1.i_total) {
- LOG_TRACE_STR("all bits were taken!");
+ mlog(0, "all bits were taken!\n");
goto bail;
}
@@ -791,15 +791,15 @@
ocfs2_clusters_to_blocks(osb->sb,
start - count);
- LOG_TRACE_ARGS("freeing %u bits starting at local "
- "alloc bit %u (la_start_blk = %llu, "
- "blkno = %llu)\n", count, start - count,
- la_start_blk, blkno);
+ mlog(0, "freeing %u bits starting at local "
+ "alloc bit %u (la_start_blk = %llu, "
+ "blkno = %llu)\n", count, start - count,
+ la_start_blk, blkno);
status = ocfs_free_clusters(handle, main_bm_inode,
main_bm_bh, blkno, count);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -810,7 +810,7 @@
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_sync_local_to_main */
@@ -825,7 +825,7 @@
*ac = kmalloc(sizeof(ocfs2_alloc_context), GFP_KERNEL);
if (!(*ac)) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(*ac, 0, sizeof(ocfs2_alloc_context));
@@ -834,7 +834,7 @@
status = ocfs_reserve_cluster_bitmap_bits(osb, *ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -849,7 +849,7 @@
*ac = NULL;
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -866,15 +866,15 @@
u32 cluster_off, cluster_count;
ocfs2_dinode *alloc = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
if (alloc->id1.bitmap1.i_total)
- LOG_TRACE_STR("asking me to alloc a new window over a"
- " non-empty one");
+ mlog(0, "asking me to alloc a new window over a non-empty "
+ "one\n");
- LOG_TRACE_ARGS("Allocating %u clusters for a new window.\n",
- ocfs_local_alloc_window_bits(osb));
+ mlog(0, "Allocating %u clusters for a new window.\n",
+ ocfs_local_alloc_window_bits(osb));
/* we used the generic suballoc reserve function, but we set
* everything up nicely, so there's no reason why we can't use
* the more specific cluster api to claim bits. */
@@ -883,7 +883,7 @@
&cluster_off, &cluster_count);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
atomic_inc(&osb->alloc_stats.bitmap_data);
@@ -900,13 +900,13 @@
memset(OCFS2_LOCAL_ALLOC(alloc)->la_bitmap, 0,
OCFS2_LOCAL_ALLOC(alloc)->la_size);
- LOG_TRACE_STR("New window allocated:");
- LOG_TRACE_ARGS("window la_bm_off = %u\n",
- OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
- LOG_TRACE_ARGS("window bits = %u\n", le32_to_cpu(alloc->id1.bitmap1.i_total));
+ mlog(0, "New window allocated:\n");
+ mlog(0, "window la_bm_off = %u\n",
+ OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
+ mlog(0, "window bits = %u\n", le32_to_cpu(alloc->id1.bitmap1.i_total));
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_local_alloc_new_window */
@@ -923,12 +923,12 @@
ocfs2_dinode *alloc_copy = NULL;
ocfs2_alloc_context *ac = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
handle = ocfs_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -939,14 +939,14 @@
&main_bm_inode,
&main_bm_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
handle = ocfs_start_trans(osb, handle, OCFS_WINDOW_MOVE_CREDITS);
if (!handle) {
status = -ENOMEM;
- LOG_ERROR_STATUS (status);
+ mlog_errno (status);
goto bail;
}
@@ -960,7 +960,7 @@
alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_KERNEL);
if (!alloc_copy) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size);
@@ -969,7 +969,7 @@
osb->local_alloc_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -977,21 +977,21 @@
status = ocfs_journal_dirty(handle, osb->local_alloc_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_sync_local_to_main(osb, handle, alloc_copy,
main_bm_inode, main_bm_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_local_alloc_new_window(osb, handle, ac);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1014,7 +1014,7 @@
if (ac)
ocfs_free_alloc_context(ac);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
Modified: trunk/fs/ocfs2/mmap.c
===================================================================
--- trunk/fs/ocfs2/mmap.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/mmap.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -33,7 +33,9 @@
#include <linux/uio.h>
#include <linux/rbtree.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_FILE_IO
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -42,8 +44,6 @@
#include "inode.h"
#include "mmap.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_MMAP
-
static inline u64 ocfs2_binode_blkno(ocfs2_backing_inode *binode);
static inline struct rb_node * __ocfs2_buffer_lock_ctxt_root(
ocfs2_buffer_lock_ctxt *ctxt);
@@ -73,8 +73,8 @@
struct page *page = NULL;
DECLARE_IO_MARKER(io_marker);
- LOG_ENTRY_ARGS("(inode %lu, address %lu)\n", inode->i_ino,
- address);
+ mlog_entry("(inode %lu, address %lu)\n", inode->i_ino,
+ address);
locked = ocfs2_is_in_io_marker_list(inode, current);
@@ -83,13 +83,13 @@
* worry about read locking here. */
status = ocfs2_meta_lock(inode, NULL, NULL, 0);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs2_data_lock(inode, 0);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
ocfs2_meta_unlock(inode, 0);
goto bail;
}
@@ -107,7 +107,7 @@
ocfs2_meta_unlock(inode, 0);
}
bail:
- LOG_EXIT_PTR(page);
+ mlog_exit_ptr(page);
return page;
}
@@ -124,8 +124,7 @@
/* We don't want to support shared writable mappings yet. */
if (((vma->vm_flags & VM_SHARED) || (vma->vm_flags & VM_MAYSHARE))
&& ((vma->vm_flags & VM_WRITE) || (vma->vm_flags & VM_MAYWRITE))) {
- LOG_TRACE_ARGS("disallow shared writable mmaps %lx\n",
- vma->vm_flags);
+ mlog(0, "disallow shared writable mmaps %lx\n", vma->vm_flags);
/* This is -EINVAL because generic_file_readonly_mmap
* returns it in a similar situation. */
return -EINVAL;
@@ -283,7 +282,7 @@
up_read(&mm->mmap_sem);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
ocfs2_unlock_buffer_inodes(ctxt);
goto bail;
}
@@ -356,7 +355,7 @@
ctxt->b_cb,
ctxt->b_cb_data);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
binode->ba_meta_locked = 1;
@@ -372,7 +371,7 @@
ocfs2_meta_unlock(inode,
binode->ba_lock_meta_level);
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -451,7 +450,7 @@
&info->wl_target_binode);
if (ret < 0) {
BUG_ON(ret == -EIOCBQUEUED);
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto bail;
}
}
@@ -462,7 +461,7 @@
info->wl_unlock_ctxt = 1;
ret = ocfs2_lock_buffer_inodes(ctxt, inode);
if (ret < 0) {
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto bail;
}
info->wl_have_before = 1;
@@ -479,7 +478,7 @@
if (!info->wl_have_target_meta) {
status = ocfs2_meta_lock(inode, NULL, NULL, level);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
ret = status;
goto bail;
}
@@ -497,7 +496,7 @@
if (filp->f_flags & O_APPEND) {
saved_ppos = i_size_read(inode);
- LOG_TRACE_ARGS("O_APPEND: inode->i_size=%llu\n", saved_ppos);
+ mlog(0, "O_APPEND: inode->i_size=%llu\n", saved_ppos);
/* ugh, work around some applications which open
* everything O_DIRECT + O_APPEND and really don't
@@ -508,7 +507,7 @@
if (filp->f_flags & O_DIRECT) {
/* anything special for o_direct? */
- LOG_TRACE_STR ("O_DIRECT");
+ mlog(0, "O_DIRECT\n");
if ((saved_ppos & (sector_size - 1)) ||
(count & (sector_size - 1)) ||
((unsigned long)buf & (sector_size - 1))) {
@@ -524,15 +523,15 @@
if (filp->f_flags & O_APPEND)
info->wl_newsize = count + i_size_read(inode);
- LOG_TRACE_ARGS ("ppos=%llu newsize=%llu cursize=%llu\n",
- saved_ppos, info->wl_newsize, i_size_read(inode));
+ mlog(0, "ppos=%llu newsize=%llu cursize=%llu\n", saved_ppos,
+ info->wl_newsize, i_size_read(inode));
if (info->wl_newsize > i_size_read(inode)) {
if (!level) {
/* we want an extend, but need a higher
* level cluster lock. */
- LOG_TRACE_ARGS("inode %llu, had a PR, looping back "
- "for EX\n", OCFS_I(inode)->ip_blkno);
+ mlog(0, "inode %llu, had a PR, looping back for EX\n",
+ OCFS_I(inode)->ip_blkno);
ocfs2_meta_unlock(inode, level);
info->wl_have_target_meta = 0;
level = 1;
@@ -540,9 +539,9 @@
}
info->wl_extended = 1;
- LOG_TRACE_ARGS("Writing at EOF, will need more allocation: "
- "i_size=%llu, need=%llu\n",
- i_size_read(inode), info->wl_newsize);
+ mlog(0, "Writing at EOF, will need more allocation: "
+ "i_size=%llu, need=%llu\n", i_size_read(inode),
+ info->wl_newsize);
/* If we extend AT ALL here then we update our state
* and continue the write call, regardless of error --
@@ -553,11 +552,11 @@
if (status != -ERESTARTSYS
&& status != -EINTR
&& status != -ENOSPC) {
- LOG_ERROR_STATUS(status);
- LOG_ERROR_ARGS("Failed to extend inode %llu "
- "from %llu to %llu",
- OCFS_I(inode)->ip_blkno,
- *ppos, info->wl_newsize);
+ mlog_errno(status);
+ mlog(ML_ERROR, "Failed to extend inode %llu "
+ "from %llu to %llu",
+ OCFS_I(inode)->ip_blkno,
+ *ppos, info->wl_newsize);
}
ret = status;
@@ -577,9 +576,8 @@
&& status != -ENOSPC
&& status != -EINTR
&& status != -ERESTARTSYS)
- LOG_ERROR_ARGS("status return of %d extending inode "
- "%llu\n", status,
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "status return of %d extending inode "
+ "%llu\n", status, OCFS_I(inode)->ip_blkno);
status = 0;
}
@@ -590,7 +588,7 @@
if (!info->wl_do_direct_io && !info->wl_have_data_lock) {
status = ocfs2_data_lock(inode, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
ret = status;
info->wl_have_target_meta = 0;
@@ -608,12 +606,12 @@
/* This will lock everyone who's order puts them *after* our inode. */
ret = ocfs2_lock_buffer_inodes(ctxt, NULL);
if (ret < 0) {
- LOG_ERROR_STATUS(ret);
+ mlog_errno(ret);
goto bail;
}
bail:
- LOG_EXIT_INT(ret);
+ mlog_exit(ret);
return ret;
}
Modified: trunk/fs/ocfs2/namei.c
===================================================================
--- trunk/fs/ocfs2/namei.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/namei.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -43,7 +43,9 @@
#include <linux/slab.h>
#include <linux/highmem.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_NAMEI
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -63,8 +65,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_NAMEI
-
static int inline search_dirblock(struct buffer_head *bh,
struct inode *dir,
const char *name, int namelen,
@@ -147,7 +147,7 @@
ocfs_super *osb = OCFS_SB(sb);
struct ocfs2_dir_entry *dirent;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
+ mlog_entry ("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
dentry->d_name.len, dentry->d_name.name);
if (dentry->d_name.len > OCFS2_MAX_FILENAME_LEN) {
@@ -155,8 +155,7 @@
goto bail;
}
- LOG_TRACE_ARGS("about to call find_files_on_disk with inode=%p\n",
- dir);
+ mlog(0, "about to call find_files_on_disk with inode=%p\n", dir);
status = ocfs_find_files_on_disk(osb, dentry->d_name.name,
dentry->d_name.len, &blkno,
@@ -166,7 +165,7 @@
inode = ocfs_iget(osb, blkno);
if (!inode) {
- LOG_ERROR_STR("Could not create inode!");
+ mlog(ML_ERROR, "Could not create inode!\n");
ret = ERR_PTR (-EACCES);
goto bail;
}
@@ -180,7 +179,7 @@
if (dirent_bh)
brelse(dirent_bh);
- LOG_EXIT_PTR (ret);
+ mlog_exit_ptr(ret);
return ret;
} /* ocfs_lookup */
@@ -201,11 +200,10 @@
struct buffer_head *dirent_bh = NULL;
struct ocfs2_dir_entry *dirent;
- LOG_ENTRY_ARGS ("(0x%p, '%.*s')\n", child,
+ mlog_entry ("(0x%p, '%.*s')\n", child,
child->d_name.len, child->d_name.name);
- LOG_TRACE_ARGS("about to call find_files_on_disk with inode=%p\n",
- dir);
+ mlog(0, "about to call find_files_on_disk with inode=%p\n", dir);
status = ocfs_find_files_on_disk(osb, "..", 2, &blkno,
dir, 1, &dirent_bh, &dirent);
@@ -216,7 +214,7 @@
inode = ocfs_iget(osb, blkno);
if (!inode) {
- LOG_ERROR_STR("Could not create inode!");
+ mlog(ML_ERROR, "Could not create inode!\n");
parent = ERR_PTR(-EACCES);
goto bail;
}
@@ -231,7 +229,7 @@
if (dirent_bh)
brelse(dirent_bh);
- LOG_EXIT_PTR (parent);
+ mlog_exit_ptr(parent);
return parent;
} /* ocfs_get_parent */
@@ -247,12 +245,12 @@
struct buffer_head *new_bh = NULL;
struct ocfs2_dir_entry *de = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
status = ocfs_do_extend_dir(osb->sb, handle, inode, fe_bh,
data_ac, NULL, &new_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -261,7 +259,7 @@
status = ocfs_journal_access(handle, inode, new_bh,
OCFS_JOURNAL_ACCESS_CREATE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(new_bh->b_data, 0, osb->sb->s_blocksize);
@@ -283,7 +281,7 @@
status = ocfs_journal_dirty(handle, new_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -292,7 +290,7 @@
inode->i_blocks = 1;
status = ocfs_mark_inode_dirty(handle, inode, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -301,7 +299,7 @@
if (new_bh)
brelse(new_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -321,15 +319,15 @@
ocfs2_alloc_context *inode_ac = NULL;
ocfs2_alloc_context *data_ac = NULL;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
+ mlog_entry ("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
(unsigned long)dev, dentry->d_name.len, dentry->d_name.name);
/* get our super block */
osb = OCFS_SB(dir->i_sb);
if (S_ISDIR(mode) && (dir->i_nlink >= OCFS2_LINK_MAX)) {
- printk("inode %llu has i_nlink of %u\n",
- OCFS_I(dir)->ip_blkno, dir->i_nlink);
+ mlog(ML_ERROR, "inode %llu has i_nlink of %u\n",
+ OCFS_I(dir)->ip_blkno, dir->i_nlink);
status = -EMLINK;
goto leave;
}
@@ -337,26 +335,26 @@
inode = new_inode (dir->i_sb);
if (IS_ERR (inode)) {
status = PTR_ERR(inode);
- LOG_ERROR_STR("new_inode failed!");
+ mlog(ML_ERROR, "new_inode failed!\n");
goto leave;
}
if (ocfs_inode_init_private(inode)) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -372,7 +370,7 @@
dentry->d_name.name,
dentry->d_name.len, &de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -380,7 +378,7 @@
status = ocfs_reserve_new_inode(osb, handle, &inode_ac);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -389,7 +387,7 @@
if (S_ISDIR(mode)) {
status = ocfs_reserve_clusters(osb, handle, 1, &data_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
}
@@ -397,7 +395,7 @@
handle = ocfs_start_trans(osb, handle, OCFS_MKNOD_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -406,24 +404,24 @@
&new_fe_bh, parent_fe_bh, handle,
inode, inode_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
fe = (ocfs2_dinode *)new_fe_bh->b_data;
if (ocfs_populate_inode(inode, fe, 1) < 0) {
- LOG_ERROR_ARGS("populate inode failed! bh->b_blocknr=%llu, "
- "i_blkno=%llu, i_ino=%lu\n",
- (unsigned long long)new_fe_bh->b_blocknr,
- fe->i_blkno, inode->i_ino);
+ mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, "
+ "i_blkno=%llu, i_ino=%lu\n",
+ (unsigned long long)new_fe_bh->b_blocknr,
+ fe->i_blkno, inode->i_ino);
BUG();
}
ocfs_inode_set_new(osb, inode);
status = ocfs2_create_new_inode_locks(inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
file_off = fe->i_blkno << dir->i_sb->s_blocksize_bits;
@@ -431,20 +429,20 @@
status = ocfs_fill_new_dir(osb, handle, dir, inode,
new_fe_bh, data_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs_journal_access(handle, dir, parent_fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
dirfe->i_links_count++;
status = ocfs_journal_dirty(handle, parent_fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
dir->i_nlink++;
@@ -453,7 +451,7 @@
status = ocfs_add_entry(handle, dentry, inode, fe->i_blkno,
parent_fe_bh, de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -466,9 +464,9 @@
ocfs_commit_trans(handle);
if (status == -ENOSPC)
- LOG_TRACE_STR ("Disk is full");
+ mlog(0, "Disk is full\n");
else if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
if (new_fe_bh)
brelse(new_fe_bh);
@@ -488,7 +486,7 @@
if (data_ac)
ocfs_free_alloc_context(data_ac);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_mknod */
@@ -512,7 +510,7 @@
u64 fe_blkno = 0;
u16 suballoc_bit;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
+ mlog_entry ("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
(unsigned long)dev, dentry->d_name.len, dentry->d_name.name);
OCFS_ASSERT(new_fe_bh);
@@ -521,14 +519,14 @@
status = ocfs_claim_new_inode(osb, handle, inode_ac, &suballoc_bit,
&fe_blkno);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
*new_fe_bh = sb_getblk(osb->sb, fe_blkno);
if (!*new_fe_bh) {
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
set_buffer_uptodate(*new_fe_bh);
@@ -537,7 +535,7 @@
status = ocfs_journal_access(handle, inode, *new_fe_bh,
OCFS_JOURNAL_ACCESS_CREATE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -587,7 +585,7 @@
status = ocfs_journal_dirty(handle, *new_fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -600,7 +598,7 @@
*new_fe_bh = NULL;
}
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_mknod_locked */
@@ -612,10 +610,10 @@
{
int ret;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
+ mlog_entry ("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
dentry->d_name.len, dentry->d_name.name);
ret = ocfs_mknod (dir, dentry, mode | S_IFDIR, 0);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_mkdir */
@@ -628,10 +626,10 @@
{
int ret;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
+ mlog_entry ("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
dentry->d_name.len, dentry->d_name.name);
ret = ocfs_mknod (dir, dentry, mode | S_IFREG, 0);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_create */
@@ -652,7 +650,7 @@
ocfs2_dinode *fe = NULL;
ocfs_super *osb = OCFS_SB(dir->i_sb);
- LOG_ENTRY_ARGS ("(inode=%lu, old='%.*s' new='%.*s')\n",
+ mlog_entry ("(inode=%lu, old='%.*s' new='%.*s')\n",
inode->i_ino, old_dentry->d_name.len,
old_dentry->d_name.name, dentry->d_name.len,
dentry->d_name.name);
@@ -675,7 +673,7 @@
err = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
if (err < 0) {
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
@@ -683,13 +681,13 @@
dentry->d_name.name,
dentry->d_name.len, &de_bh);
if (err < 0) {
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
err = ocfs2_meta_lock(inode, handle, &fe_bh, 1);
if (err < 0) {
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
@@ -708,7 +706,7 @@
err = ocfs_journal_access(handle, inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (err < 0) {
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
@@ -721,7 +719,7 @@
if (err < 0) {
fe->i_links_count--;
inode->i_nlink--;
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
@@ -730,7 +728,7 @@
if (err) {
fe->i_links_count--;
inode->i_nlink--;
- LOG_ERROR_STATUS(err);
+ mlog_errno(err);
goto bail;
}
@@ -746,7 +744,7 @@
if (parent_fe_bh)
brelse(parent_fe_bh);
- LOG_EXIT_STATUS(err);
+ mlog_exit(err);
return err;
} /* ocfs_link */
@@ -771,17 +769,17 @@
char *orphan_name = NULL;
struct buffer_head *orphan_entry_bh = NULL;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
+ mlog_entry ("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
dentry->d_name.len, dentry->d_name.name);
OCFS_ASSERT((dentry->d_parent->d_inode == dir));
- LOG_TRACE_ARGS("ino = %llu\n", OCFS_I(inode)->ip_blkno);
+ mlog(0, "ino = %llu\n", OCFS_I(inode)->ip_blkno);
status = -EBUSY;
if (inode == osb->root_inode) {
- LOG_TRACE_STR ("Cannot delete the root directory");
+ mlog(0, "Cannot delete the root directory\n");
status = -EPERM;
goto leave;
}
@@ -789,13 +787,13 @@
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs2_meta_lock(dir, handle, &parent_node_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -804,7 +802,7 @@
dir, 0, &dirent_bh,
&dirent);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -813,14 +811,14 @@
status = ocfs2_meta_lock(inode, handle, &fe_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs2_request_unlink_vote(inode);
if (status < 0) {
/* This vote should succeed under all normal circumstances. */
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -839,7 +837,7 @@
&orphan_name,
&orphan_entry_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
}
@@ -847,22 +845,22 @@
handle = ocfs_start_trans(osb, handle, OCFS_UNLINK_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs_journal_access(handle, inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
fe = (ocfs2_dinode *) fe_bh->b_data;
if (fe->i_links_count != inode->i_nlink) {
- printk("ocfs_unlink: hmm, inode has nlink = %u, fe has "
- "link_cnt = %u. Setting inode from fe.\n",
- inode->i_nlink, fe->i_links_count);
+ mlog(ML_NOTICE, "inode has nlink = %u, fe has link_cnt = %u. "
+ "Setting inode from fe.\n", inode->i_nlink,
+ fe->i_links_count);
inode->i_nlink = fe->i_links_count;
}
@@ -870,7 +868,7 @@
status = ocfs_orphan_add(osb, handle, inode, fe, orphan_name,
orphan_entry_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
}
@@ -878,7 +876,7 @@
/* delete the name from the parent dir */
status = ocfs_delete_entry (handle, dir, dirent, dirent_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -892,7 +890,7 @@
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -901,7 +899,7 @@
status = ocfs_mark_inode_dirty(handle, dir,
parent_node_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
dir->i_nlink++;
}
}
@@ -916,7 +914,7 @@
&& status != -EBUSY
&& status != -EINTR
&& status != -ERESTARTSYS) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
retval = -EBUSY;
} else
retval = status;
@@ -936,7 +934,7 @@
if (orphan_name)
kfree(orphan_name);
- LOG_EXIT_INT (retval);
+ mlog_exit (retval);
return retval;
} /* ocfs_unlink */
@@ -960,7 +958,7 @@
struct buffer_head **tmpbh;
struct inode *tmpinode;
- LOG_ENTRY_ARGS("(inode1 = %llu, inode2 = %llu)\n",
+ mlog_entry("(inode1 = %llu, inode2 = %llu)\n",
OCFS_I(inode1)->ip_blkno,
OCFS_I(inode2)->ip_blkno);
@@ -975,7 +973,7 @@
if (oip1->ip_blkno != oip2->ip_blkno) {
if (oip1->ip_blkno < oip2->ip_blkno) {
/* switch id1 and id2 around */
- LOG_TRACE_STR("switching them around...");
+ mlog(0, "switching them around...\n");
tmpbh = bh2;
bh2 = bh1;
bh1 = tmpbh;
@@ -987,18 +985,18 @@
/* lock id2 */
status = ocfs2_meta_lock(inode2, handle, bh2, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
/* lock id1 */
status = ocfs2_meta_lock(inode1, handle, bh1, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_double_lock */
@@ -1033,7 +1031,7 @@
// this is the 1st dirent bh
nlink_t old_dir_nlink = old_dir->i_nlink, new_dir_nlink = new_dir->i_nlink;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, 0x%p, 0x%p, from='%.*s' to='%.*s')\n",
+ mlog_entry ("(0x%p, 0x%p, 0x%p, 0x%p, from='%.*s' to='%.*s')\n",
old_dir, old_dentry, new_dir, new_dentry,
old_dentry->d_name.len, old_dentry->d_name.name,
new_dentry->d_name.len, new_dentry->d_name.name);
@@ -1056,7 +1054,7 @@
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1065,7 +1063,7 @@
&old_dir_bh, old_dir,
&new_dir_bh, new_dir);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1076,7 +1074,7 @@
new_dir_bh = old_dir_bh;
get_bh(new_dir_bh);
} else {
- LOG_ERROR_STR("no old_dir_bh!");
+ mlog(ML_ERROR, "no old_dir_bh!\n");
status = -EIO;
goto bail;
}
@@ -1088,13 +1086,13 @@
* doing node locking on it. */
status = ocfs2_meta_lock(old_inode, handle, NULL, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs2_request_rename_vote(old_inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1116,7 +1114,7 @@
* message. */
status = ocfs2_request_rename_vote(old_inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1148,13 +1146,13 @@
if ((status < 0) && (status != -ENOENT)) {
/* If we cannot find the file specified we should just */
/* return the error... */
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (!new_de && new_inode)
- LOG_ERROR_ARGS("inode %lu does not exist in it's parent "
- "directory!", new_inode->i_ino);
+ mlog(ML_ERROR, "inode %lu does not exist in it's parent "
+ "directory!", new_inode->i_ino);
/* In case we need to overwrite an existing file, we blow it
* away first */
@@ -1167,22 +1165,22 @@
status = ocfs2_meta_lock(new_inode, handle, &newfe_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs2_request_unlink_vote(new_inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
newfe = (ocfs2_dinode *) newfe_bh->b_data;
- LOG_TRACE_ARGS("aha rename over existing... new_de=%p "
- "new_blkno=%llu newfebh=%p bhblocknr=%llu\n",
- new_de, newfe_blkno, newfe_bh, newfe_bh ?
- (unsigned long long)newfe_bh->b_blocknr : 0ULL);
+ mlog(0, "aha rename over existing... new_de=%p "
+ "new_blkno=%llu newfebh=%p bhblocknr=%llu\n",
+ new_de, newfe_blkno, newfe_bh, newfe_bh ?
+ (unsigned long long)newfe_bh->b_blocknr : 0ULL);
if (S_ISDIR(new_inode->i_mode) || (new_inode->i_nlink == 1)) {
status = ocfs_prepare_orphan_dir(osb, handle,
@@ -1190,7 +1188,7 @@
&orphan_name,
&orphan_entry_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1201,7 +1199,7 @@
new_dentry->d_name.len,
&insert_entry_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1209,7 +1207,7 @@
handle = ocfs_start_trans(osb, handle, OCFS_RENAME_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1223,7 +1221,7 @@
status = ocfs_journal_access(handle, new_inode, newfe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1232,7 +1230,7 @@
newfe, orphan_name,
orphan_entry_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1241,7 +1239,7 @@
status = ocfs_journal_access(handle, new_dir, new_de_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
new_de->inode =
@@ -1250,7 +1248,7 @@
new_dir->i_version++;
status = ocfs_journal_dirty(handle, new_de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1261,7 +1259,7 @@
status = ocfs_journal_dirty(handle, newfe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
} else {
@@ -1277,7 +1275,7 @@
/* now that the name has been added to new_dir, remove the old name */
status = ocfs_delete_entry(handle, old_dir, old_de, old_de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1308,9 +1306,10 @@
if (old_dir != new_dir)
if (new_dir_nlink != new_dir->i_nlink) {
if (!new_dir_bh) {
- LOG_ERROR_ARGS("need to change nlink for new dir %llu from %d to %d "
- "but bh is NULL!\n", OCFS_I(new_dir)->ip_blkno,
- (int)new_dir_nlink, new_dir->i_nlink);
+ mlog(ML_ERROR, "need to change nlink for new "
+ "dir %llu from %d to %d but bh is NULL\n",
+ OCFS_I(new_dir)->ip_blkno,
+ (int)new_dir_nlink, new_dir->i_nlink);
} else {
ocfs2_dinode *fe;
status = ocfs_journal_access(handle,
@@ -1325,9 +1324,10 @@
if (old_dir_nlink != old_dir->i_nlink) {
if (!old_dir_bh) {
- LOG_ERROR_ARGS("need to change nlink for old dir %llu from %d to %d "
- "but bh is NULL!\n", OCFS_I(old_dir)->ip_blkno,
- (int)old_dir_nlink, old_dir->i_nlink);
+ mlog(ML_ERROR, "need to change nlink for old dir %llu "
+ "from %d to %d but bh is NULL!\n",
+ OCFS_I(old_dir)->ip_blkno, (int)old_dir_nlink,
+ old_dir->i_nlink);
} else {
ocfs2_dinode *fe;
status = ocfs_journal_access(handle, old_dir,
@@ -1368,7 +1368,7 @@
kfree(orphan_name);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_rename */
@@ -1396,20 +1396,20 @@
* write i_size + 1 bytes. */
blocks = (bytes_left + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
- LOG_ENTRY_ARGS("i_blocks = %lu, i_size = %llu, blocks = %d\n",
+ mlog_entry("i_blocks = %lu, i_size = %llu, blocks = %d\n",
inode->i_blocks, i_size_read(inode), blocks);
/* Sanity check -- make sure we're going to fit. */
if (bytes_left > ocfs2_clusters_to_bytes(sb, OCFS_I(inode)->ip_clusters)) {
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bhs = kmalloc(sizeof(struct buffer_head *) * blocks, GFP_KERNEL);
if (!bhs) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(bhs, 0, sizeof(struct buffer_head *) * blocks);
@@ -1418,7 +1418,7 @@
status = ocfs2_extent_map_get_blocks(inode, 0, 1, &p_blkno,
&p_blocks);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1427,7 +1427,7 @@
* anyway. */
if ((p_blocks << sb->s_blocksize_bits) < bytes_left) {
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1438,7 +1438,7 @@
bhs[virtual] = sb_getblk(sb, p_blkno);
if (!bhs[virtual]) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1447,7 +1447,7 @@
status = ocfs_journal_access(handle, inode, bhs[virtual],
OCFS_JOURNAL_ACCESS_CREATE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1459,7 +1459,7 @@
status = ocfs_journal_dirty(handle, bhs[virtual]);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1478,7 +1478,7 @@
kfree(bhs);
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_create_symlink_data */
@@ -1502,7 +1502,7 @@
ocfs2_alloc_context *inode_ac = NULL;
ocfs2_alloc_context *data_ac = NULL;
- LOG_ENTRY_ARGS ("(0x%p, 0x%p, symname='%s' actual='%.*s')\n", dir,
+ mlog_entry ("(0x%p, 0x%p, symname='%s' actual='%.*s')\n", dir,
dentry, symname, dentry->d_name.len,
dentry->d_name.name);
@@ -1515,13 +1515,13 @@
if (IS_ERR (inode)) {
status = PTR_ERR(inode);
inode = NULL;
- LOG_ERROR_STR("new_inode failed!");
+ mlog(ML_ERROR, "new_inode failed!\n");
goto bail;
}
if (ocfs_inode_init_private(inode)) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
iput(inode);
inode = NULL;
goto bail;
@@ -1532,14 +1532,14 @@
handle = ocfs_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
/* lock the parent directory */
status = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1554,13 +1554,13 @@
dentry->d_name.name,
dentry->d_name.len, &de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_reserve_new_inode(osb, handle, &inode_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1568,7 +1568,7 @@
if (l > ocfs2_fast_symlink_chars(sb)) {
status = ocfs_reserve_clusters(osb, handle, 1, &data_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1576,7 +1576,7 @@
handle = ocfs_start_trans(osb, handle, credits);
if (handle == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1585,24 +1585,24 @@
&new_fe_bh, parent_fe_bh, handle,
inode, inode_ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
fe = (ocfs2_dinode *) new_fe_bh->b_data;
if (ocfs_populate_inode (inode, fe, 1) < 0) {
- LOG_ERROR_ARGS("populate inode failed! bh->b_blocknr=%llu, "
- "i_blkno=%llu, i_ino=%lu\n",
- (unsigned long long)new_fe_bh->b_blocknr,
- fe->i_blkno, inode->i_ino);
+ mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, "
+ "i_blkno=%llu, i_ino=%lu\n",
+ (unsigned long long)new_fe_bh->b_blocknr,
+ fe->i_blkno, inode->i_ino);
BUG();
}
ocfs_inode_set_new(osb, inode);
status = ocfs2_create_new_inode_locks(inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
inode->i_rdev = 0;
newsize = l - 1;
@@ -1612,9 +1612,9 @@
handle, data_ac, NULL, NULL);
if (status < 0) {
if (status != -ENOSPC && status != -EINTR) {
- LOG_ERROR_ARGS("Failed to extend file to %llu",
- newsize);
- LOG_ERROR_STATUS(status);
+ mlog(ML_ERROR, "Failed to extend file to %llu",
+ newsize);
+ mlog_errno(status);
status = -ENOSPC;
}
goto bail;
@@ -1630,14 +1630,14 @@
status = ocfs_mark_inode_dirty(handle, inode, new_fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (!ocfs2_inode_is_fast_symlink(inode)) {
status = ocfs_create_symlink_data(osb, handle, inode, symname);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1645,7 +1645,7 @@
status = ocfs_add_entry(handle, dentry, inode, fe->i_blkno,
parent_fe_bh, de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1665,7 +1665,7 @@
if (data_ac)
ocfs_free_alloc_context(data_ac);
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_symlink */
@@ -1687,11 +1687,10 @@
error_msg = "directory entry across blocks";
if (error_msg != NULL)
- LOG_ERROR_ARGS("bad entry in directory #%llu: %s - "
- "offset=%lu, inode=%llu, rec_len=%d, name_len=%d",
- OCFS_I(dir)->ip_blkno, error_msg, offset,
- le64_to_cpu(de->inode),
- rlen, de->name_len);
+ mlog(ML_ERROR, "bad entry in directory #%llu: %s - "
+ "offset=%lu, inode=%llu, rec_len=%d, name_len=%d",
+ OCFS_I(dir)->ip_blkno, error_msg, offset,
+ le64_to_cpu(de->inode), rlen, de->name_len);
return error_msg == NULL ? 1 : 0;
}
@@ -1713,7 +1712,7 @@
struct super_block * sb;
int retval, status;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(insert_bh);
sb = dir->i_sb;
@@ -1778,7 +1777,7 @@
retval = -ENOSPC;
bail:
- LOG_EXIT_STATUS(retval);
+ mlog_exit(retval);
return retval;
}
@@ -1792,7 +1791,7 @@
struct ocfs2_dir_entry * de, * pde;
int i, status = -ENOENT;
- LOG_ENTRY_ARGS("(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);
+ mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);
i = 0;
pde = NULL;
@@ -1823,7 +1822,7 @@
de = (struct ocfs2_dir_entry *)((char *) de + le16_to_cpu(de->rec_len));
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1841,7 +1840,7 @@
int de_len;
int ret = 0;
- LOG_ENTRY();
+ mlog_entry_void();
de = (struct ocfs2_dir_entry *) bh->b_data;
dlimit = (char *)de + dir->i_sb->s_blocksize;
@@ -1871,7 +1870,7 @@
}
bail:
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
@@ -1892,7 +1891,7 @@
int num = 0;
int nblocks, i, err;
- LOG_ENTRY();
+ mlog_entry_void();
*res_dir = NULL;
sb = dir->i_sb;
@@ -1972,7 +1971,7 @@
for (; ra_ptr < ra_max; ra_ptr++)
brelse (bh_use[ra_ptr]);
- LOG_EXIT_PTR(ret);
+ mlog_exit_ptr(ret);
return ret;
}
@@ -1981,13 +1980,13 @@
char *name = NULL;
int namelen;
- LOG_ENTRY();
+ mlog_entry_void();
*retval = NULL;
name = kmalloc(OCFS2_MAX_FILENAME_LEN + 1, GFP_KERNEL);
if (!name) {
namelen = -ENOMEM;
- LOG_ERROR_STATUS(namelen);
+ mlog_errno(namelen);
goto bail;
}
@@ -1997,16 +1996,16 @@
kfree(name);
if (!namelen)
namelen = -EFAULT;
- LOG_ERROR_STATUS(namelen);
+ mlog_errno(namelen);
goto bail;
}
- LOG_TRACE_ARGS("built filename '%s' for orphan dir (len=%d)\n", name,
- namelen);
+ mlog(0, "built filename '%s' for orphan dir (len=%d)\n", name,
+ namelen);
*retval = name;
bail:
- LOG_EXIT_STATUS(namelen);
+ mlog_exit(namelen);
return namelen;
}
@@ -2028,7 +2027,7 @@
namelen = ocfs_blkno_stringify(OCFS_I(inode)->ip_blkno, &name);
if (namelen < 0) {
status = namelen;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2037,14 +2036,14 @@
-1);
if (!orphan_dir_inode) {
status = -ENOENT;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
ocfs_handle_add_inode(handle, orphan_dir_inode);
status = ocfs2_meta_lock(orphan_dir_inode, handle, &orphan_dir_bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2052,7 +2051,7 @@
orphan_dir_bh, name, namelen,
de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2067,7 +2066,7 @@
if (orphan_dir_bh)
brelse(orphan_dir_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -2085,7 +2084,7 @@
int namelen;
ocfs2_dinode *orphan_fe;
- LOG_ENTRY_ARGS("(inode->i_ino = %lu)\n", inode->i_ino);
+ mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino);
namelen = strlen(name);
@@ -2094,7 +2093,7 @@
-1);
if (!orphan_dir_inode) {
status = -ENOENT;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2102,14 +2101,14 @@
&orphan_dir_bh, OCFS_BH_CACHED,
orphan_dir_inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs_journal_access(handle, orphan_dir_inode, orphan_dir_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2122,7 +2121,7 @@
status = ocfs_journal_dirty(handle, orphan_dir_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2130,7 +2129,7 @@
inode, OCFS_I(inode)->ip_blkno,
orphan_dir_bh, de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2142,7 +2141,7 @@
if (orphan_dir_bh)
brelse(orphan_dir_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_orphan_add */
@@ -2158,12 +2157,12 @@
struct buffer_head *target_de_bh = NULL;
struct ocfs2_dir_entry *target_de = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
name = kmalloc(OCFS2_MAX_FILENAME_LEN + 1, GFP_KERNEL);
if (!name) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2174,19 +2173,18 @@
status = namelen;
else
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
- LOG_TRACE_ARGS("removing '%s' from orphan dir (len=%d)\n", name,
- namelen);
+ mlog(0, "removing '%s' from orphan dir (len=%d)\n", name, namelen);
/* find it's spot in the orphan directory */
target_de_bh = ocfs_find_entry(name, namelen, orphan_dir_inode,
&target_de);
if (!target_de_bh) {
status = -ENOENT;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2194,14 +2192,14 @@
status = ocfs_delete_entry(handle, orphan_dir_inode, target_de,
target_de_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs_journal_access(handle,orphan_dir_inode, orphan_dir_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2213,7 +2211,7 @@
status = ocfs_journal_dirty(handle, orphan_dir_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -2224,7 +2222,7 @@
if (target_de_bh)
brelse(target_de_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
Modified: trunk/fs/ocfs2/ocfs_compat.c
===================================================================
--- trunk/fs/ocfs2/ocfs_compat.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/ocfs_compat.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -35,12 +35,9 @@
#include <linux/uio.h>
#include <linux/rbtree.h>
-#include "ocfs_log.h"
#include "ocfs.h"
#include "ocfs2.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_COMPAT
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
/*
* This function returns the first node (in sort order) of the tree.
Deleted: trunk/fs/ocfs2/ocfs_log.h
===================================================================
--- trunk/fs/ocfs2/ocfs_log.h 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/ocfs_log.h 2005-04-26 00:43:42 UTC (rev 2172)
@@ -1,318 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * ocfs_log.h
- *
- * Defines macros and flags used for logging.
- *
- * Copyright (C) 2004 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation, version
- * 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-#ifndef OCFS_LOG_H
-#define OCFS_LOG_H
-
-extern u32 debug_context;
-extern u32 debug_level;
-extern u32 debug_exclude;
-
-/* Tracing Levels */
-#define OCFS_DEBUG_LEVEL_ERROR 0x00000001
-#define OCFS_DEBUG_LEVEL_TRACE 0x00000002
-
-#define OCFS_DEBUG_LEVEL_ENTRY 0x00000010
-#define OCFS_DEBUG_LEVEL_EXIT 0x00000020
-
-#define OCFS_DEBUG_LEVEL_TIMING 0x00000100
-#define OCFS_DEBUG_LEVEL_STACK 0x00000200
-
-#define OCFS_DEBUG_LEVEL_PRINTK 0x00001000
-#define OCFS_DEBUG_LEVEL_MALLOC 0x00002000
-
-/* Tracing Contexts */
-#define OCFS_DEBUG_CONTEXT_ALLOC 0x00000001 /* alloc.c */
-#define OCFS_DEBUG_CONTEXT_DIR 0x00000002 /* dir.c */
-#define OCFS_DEBUG_CONTEXT_EXTMAP 0x00000004 /* extmap.c */
-#define OCFS_DEBUG_CONTEXT_SLOTMAP 0x00000008 /* slotmap.c */
-#define OCFS_DEBUG_CONTEXT_IOCTL 0x00000010 /* ioctl.c */
-#define OCFS_DEBUG_CONTEXT_VOTE 0x00000020 /* vote.c */
-#define OCFS_DEBUG_CONTEXT_PROC 0x00000040 /* proc.c */
-#define OCFS_DEBUG_CONTEXT_SYMLINK 0x00000080 /* symlink.c */
-#define OCFS_DEBUG_CONTEXT_BITMAP 0x00000100 /* bitmap.c */
-#define OCFS_DEBUG_CONTEXT_FILE 0x00000200 /* file.c */
-#define OCFS_DEBUG_CONTEXT_INODE 0x00000400 /* inode.c */
-#define OCFS_DEBUG_CONTEXT_JOURNAL 0x00000800 /* journal.c */
-#define OCFS_DEBUG_CONTEXT_CHAINALLOC 0x00001000 /* chainalloc */
-#define OCFS_DEBUG_CONTEXT_LOCALALLOC 0x00002000 /* localalloc */
-#define OCFS_DEBUG_CONTEXT_SYSFILE 0x00004000 /* sysfile.c */
-#define OCFS_DEBUG_CONTEXT_VOLCFG 0x00008000 /* volcfg.c */
-#define OCFS_DEBUG_CONTEXT_DCACHE 0x00010000 /* dcache.c */
-#define OCFS_DEBUG_CONTEXT_DLMGLUE 0x00020000 /* dlmglue.c */
-#define OCFS_DEBUG_CONTEXT_COMPAT 0x00040000 /* */
-#define OCFS_DEBUG_CONTEXT_IO 0x00080000 /* io.c */
-#define OCFS_DEBUG_CONTEXT_NAMEI 0x00100000 /* namei.c */
-#define OCFS_DEBUG_CONTEXT_OSB 0x00200000 /* osb.c */
-#define OCFS_DEBUG_CONTEXT_SUPER 0x00400000 /* super.c */
-#define OCFS_DEBUG_CONTEXT_UTIL 0x00800000 /* util.c */
-#define OCFS_DEBUG_CONTEXT_MMAP 0x01000000 /* mmap.c */
-#define OCFS_DEBUG_CONTEXT_HEARTBEAT 0x02000000 /* */
-
-
-#ifdef OCFS_DBG_TIMING
-typedef union _my_timing_t
-{
- u64 q;
- u32 lohi[2];
-} my_timing_t;
-
-#define IO_FUNC_TIMING_DECL my_timing_t begin, end; rdtsc (begin.lohi[0], begin.lohi[1]);
-
-#define IO_FUNC_TIMING_PRINT(_fn,_ret) \
- do { \
- rdtsc (end.lohi[0], end.lohi[1]); \
- IF_LEVEL_NO_CONTEXT(OCFS_DEBUG_LEVEL_TIMING) \
- printk("(%d) EXIT : %s() = %d => [%llu]\n", \
- current->pid, _fn, _ret, \
- end.q-begin.q); \
- } while(0)
-#else
-#define IO_FUNC_TIMING_DECL
-#define IO_FUNC_TIMING_PRINT(_fn,_ret)
-#endif
-
-
-#ifndef OCFS_DBG_TIMING
-#define DECL_U8_ARRAY(__t, __s)
-#define INIT_U8_ARRAY(__s)
-#define PRINT_STRING(__t) printk("\n");
-#define PRINT_ENTRY(__t) printk("(%d) ENTRY: %s", current->pid, __FUNCTION__)
-#else
-#define DECL_U8_ARRAY(__t, __s) u8 (__t)[(__s)]
-#define INIT_U8_ARRAY(__s) *(__s) = '\0'
-#define PRINT_STRING(__t) printk("%s\n", (__t))
-#define PRINT_ENTRY(__t) printk("(%d) %sENTRY: %s", current->pid, (__t), __FUNCTION__)
-#endif
-
-
-#ifndef OCFS_DBG_TIMING
-# define GET_STACK(s)
-#else
-# define GET_STACK(s) \
- IF_LEVEL(OCFS_DEBUG_LEVEL_STACK) { \
- __s32 esp; \
- __asm__ __volatile__("andl %%esp,%0" : "=r" (esp) : \
- "0" (8191)); \
- esp -= sizeof(struct task_struct); \
- sprintf((s), "[%ld] ", esp); \
- }
-#endif
-
-/* privately used macros */
-# define IF_LEVEL_CONTEXT(level) \
- if ((debug_context & OCFS_DEBUG_CONTEXT) && (debug_level & level) && \
- current->pid!=debug_exclude)
-# define IF_LEVEL_NO_CONTEXT(level) \
- if ((debug_level & level) && current->pid!=debug_exclude)
-
-# define IF_LEVEL(level) IF_LEVEL_CONTEXT(level)
-
-#ifndef OCFS_DBG_TIMING
-# define ENTRY_TIMING_DECLS
-# define GET_TIMING(s, hi, lo)
-#else
-# define ENTRY_TIMING_DECLS u32 _HI = 0, _LO = 0
-# define GET_TIMING(s, hi, lo) \
- do { \
- IF_LEVEL_CONTEXT(OCFS_DEBUG_LEVEL_TIMING) { \
- u32 _lo, _hi; \
- rdtsc (_lo, _hi); \
- if ((s) == NULL) { \
- (hi) = _hi; (lo) = _lo; \
- } else { \
- u64 _b, _e; \
- _b = hi; _b <<= 32; _b |= lo; \
- _e = _hi; _e <<= 32; _e |= _lo; \
- _e -= _b; \
- sprintf((s), " => [%llu]", _e); \
- } \
- } \
- } while (0)
-#endif
-
-/* IF macro */
-#define IF_TRACE(func) \
- do { \
- if ((debug_context & OCFS_DEBUG_CONTEXT) && \
- (debug_level & OCFS_DEBUG_LEVEL_TRACE)) \
- func; \
- } while (0)
-
-#define IF_LEVEL_PID() \
- if ((debug_level & OCFS_DEBUG_LEVEL_PRINTK) && \
- (current->pid!=debug_exclude))
-
-static inline void eat_value_int(int val)
-{
- return;
-}
-
-static inline void eat_value_uint(unsigned int val)
-{
- return;
-}
-
-static inline void eat_value_long(long val)
-{
- return;
-}
-
-static inline void eat_value_ulong(unsigned long val)
-{
- return;
-}
-
-static inline void eat_value_ptr(void *val)
-{
- return;
-}
-
-/* TRACE disabled. ERROR macros are never disabled. */
-#if !defined(TRACE)
-# define LOG_ENTRY()
-# define LOG_EXIT()
-# define LOG_EXIT_STATUS(val) eat_value_int(val)
-# define LOG_EXIT_INT(val) eat_value_int(val)
-# define LOG_EXIT_UINT(val) eat_value_uint(val)
-# define LOG_EXIT_LONG(val) eat_value_long(val)
-# define LOG_EXIT_ULONG(val) eat_value_ulong(val)
-# define LOG_EXIT_PTR(val) eat_value_ptr(val)
-# define LOG_TRACE_STR(str)
-# define LOG_TRACE_STATUS(val) eat_value_int(val)
-# define LOG_ENTRY_ARGS(fmt, arg...)
-# define LOG_EXIT_ARGS(fmt, arg...)
-# define LOG_TRACE_ARGS(fmt, arg...)
-# define LOG_PID_PRINTK(fmt, arg...)
-# define LOG_PID_STR(str)
-# define LOG_TRACE_PROCESS_VOTE(fmt, arg...)
-#endif /* !defined(TRACE) */
-
-
-
-/* TRACE enabled */
-#if defined(TRACE)
-
-#define LOG_PID_PRINTK(fmt, arg...) \
- do { \
- IF_LEVEL_PID() { \
- printk("(%d) %s(): ", current->pid, \
- __FUNCTION__); \
- printk(fmt, ## arg); \
- } \
- } while (0)
-
-#define LOG_PID_STR(str) LOG_PID_PRINTK("%s\n", str)
-
-/* ENTRY macros */
-/* LOG_ENTRY_ARGS()
- *
- * Note: The macro expects the args to be terminated by a newline.
- */
-#define LOG_ENTRY_ARGS(fmt, arg...) \
- ENTRY_TIMING_DECLS; \
- do { \
- DECL_U8_ARRAY(_t, 16); \
- INIT_U8_ARRAY(_t); \
- GET_STACK(_t); \
- GET_TIMING(NULL, _HI, _LO); \
- IF_LEVEL(OCFS_DEBUG_LEVEL_ENTRY) { \
- PRINT_ENTRY(_t); \
- printk(fmt, ##arg); \
- } \
- } while (0)
-
-#define LOG_ENTRY() LOG_ENTRY_ARGS("() \n")
-
-
-
-/* EXIT macros */
-/* LOG_EXIT_ARGS()
- *
- */
-#define LOG_EXIT_ARGS(fmt, arg...) \
- do { \
- IF_LEVEL(OCFS_DEBUG_LEVEL_EXIT) { \
- DECL_U8_ARRAY(_t, 50); \
- INIT_U8_ARRAY(_t); \
- GET_TIMING(_t, _HI, _LO); \
- printk("(%d) EXIT : %s() %s", \
- current->pid, __FUNCTION__, \
- (*fmt == '\n' ? "" : "= ")); \
- if (*fmt != '\n') \
- printk(fmt, ## arg); \
- PRINT_STRING(_t); \
- } \
- } while (0)
-
-#define LOG_EXIT() LOG_EXIT_ARGS("\n") /* I hate you Sunil */
-#define LOG_EXIT_STATUS(val) LOG_EXIT_ARGS("%d ", val)
-#define LOG_EXIT_INT(val) LOG_EXIT_ARGS("%d ", val)
-#define LOG_EXIT_UINT(val) LOG_EXIT_ARGS("%u ", val)
-#define LOG_EXIT_LONG(val) LOG_EXIT_ARGS("%ld ", val)
-#define LOG_EXIT_ULONG(val) LOG_EXIT_ARGS("%lu ", val)
-#define LOG_EXIT_PTR(val) LOG_EXIT_ARGS("0x%p ", val)
-
-
-/* TRACE macros */
-/* LOG_TRACE_ARGS()
- *
- * Note: The macro expects the args to be terminated by a newline.
- */
-#define LOG_TRACE_ARGS(fmt, arg...) \
- do { \
- IF_LEVEL(OCFS_DEBUG_LEVEL_TRACE) { \
- printk("(%d) TRACE: %s() ", current->pid, \
- __FUNCTION__); \
- printk(fmt, ## arg); \
- } \
- } while (0)
-
-#define LOG_TRACE_STR(str) LOG_TRACE_ARGS("%s\n", str)
-#define LOG_TRACE_STATUS(val) LOG_TRACE_ARGS("%d\n", val);
-
-#endif /* TRACE */
-
-
-
-/* ERROR macros are not compiled out */
-/* LOG_ERROR_ARGS()
- *
- * Note: The macro expects the args to be terminated by a newline.
- */
-#define LOG_ERROR_ARGS(fmt, arg...) \
- do { \
- printk(KERN_ERR "(%d) ERROR at %s, %d: ", current->pid, __FILE__, __LINE__); \
- printk(KERN_ERR fmt, ## arg); \
- } while (0)
-
-#define LOG_ERROR_STR(str) LOG_ERROR_ARGS("%s\n", str)
-#define LOG_ERROR_STATUS(st) \
- do { \
- if ((st) != -ERESTARTSYS && (st) != -EINTR) \
- LOG_ERROR_ARGS("status = %lld\n", (long long)(st)); \
- } while (0)
-
-#endif /* OCFS_LOG_H */
Modified: trunk/fs/ocfs2/proc.c
===================================================================
--- trunk/fs/ocfs2/proc.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/proc.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -31,7 +31,9 @@
#include <linux/proc_fs.h>
#include <linux/socket.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_SUPER
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -41,12 +43,8 @@
#include "journal.h"
#include "ver.h"
+#define OCFS2_PROC_BASENAME "fs/ocfs2"
-/* Tracing */
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_PROC
-
-#define OCFS2_PROC_BASENAME "fs/ocfs2"
-
static struct proc_dir_entry *ocfs2_proc_root_dir = NULL; /* points to /proc/fs/ocfs2 */
static int ocfs_proc_version (char *page, char **start, off_t off, int count, int *eof, void *data);
@@ -97,7 +95,7 @@
ocfs_proc_list *p;
struct proc_dir_entry* entry;
- LOG_ENTRY ();
+ mlog_entry_void ();
parent = proc_mkdir (OCFS2_PROC_BASENAME, 0);
if (parent) {
@@ -115,7 +113,7 @@
}
}
- LOG_EXIT ();
+ mlog_exit_void ();
return 0;
} /* ocfs_proc_init */
@@ -128,7 +126,7 @@
struct proc_dir_entry *parent = ocfs2_proc_root_dir;
ocfs_proc_list *p;
- LOG_ENTRY ();
+ mlog_entry_void ();
if (parent) {
for (p = top_dir; p->name; p++)
@@ -136,7 +134,7 @@
remove_proc_entry (OCFS2_PROC_BASENAME, 0);
}
- LOG_EXIT ();
+ mlog_exit_void ();
} /* ocfs_proc_deinit */
/*
@@ -146,7 +144,7 @@
static int ocfs_proc_calc_metrics (char *page, char **start, off_t off,
int count, int *eof, int len)
{
- LOG_ENTRY ();
+ mlog_entry_void ();
if (len <= off + count)
*eof = 1;
@@ -161,7 +159,7 @@
if (len < 0)
len = 0;
- LOG_EXIT ();
+ mlog_exit_void ();
return len;
} /* ocfs_proc_calc_metrics */
@@ -176,7 +174,7 @@
int ret;
ocfs_super *osb = data;
- LOG_ENTRY ();
+ mlog_entry_void ();
#define ALLOC_STATS_HDR "%-25s %10u\n"
@@ -206,7 +204,7 @@
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
}
@@ -221,12 +219,12 @@
int len;
int ret;
- LOG_ENTRY ();
+ mlog_entry_void ();
len = ocfs2_str_version(page);
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_version */
@@ -241,12 +239,12 @@
int ret;
ocfs_super *osb = data;
- LOG_ENTRY ();
+ mlog_entry_void ();
len = sprintf (page, "%d\n", osb->node_num);
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_nodenum */
@@ -261,12 +259,12 @@
int ret;
ocfs_super *osb = data;
- LOG_ENTRY ();
+ mlog_entry_void ();
len = sprintf (page, "%d\n", osb->slot_num);
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_slotnum */
@@ -281,7 +279,7 @@
int ret;
struct nm_node *node;
- LOG_ENTRY ();
+ mlog_entry_void ();
node = nm_get_node_by_num(nm_this_node());
@@ -293,7 +291,7 @@
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_nodename */
@@ -308,7 +306,7 @@
struct proc_dir_entry* entry;
ocfs_proc_list *p;
- LOG_ENTRY();
+ mlog_entry_void();
snprintf(newdir, sizeof(newdir), "%u_%u", MAJOR(osb->sb->s_dev),
MINOR(osb->sb->s_dev));
@@ -316,7 +314,7 @@
osb->proc_sub_dir = parent;
if (!parent) {
- LOG_EXIT();
+ mlog_exit_void();
return;
}
@@ -334,7 +332,7 @@
}
}
- LOG_EXIT();
+ mlog_exit_void();
} /* ocfs_proc_add_volume */
/*
@@ -346,7 +344,7 @@
ocfs_proc_list *p;
char dir[20];
- LOG_ENTRY ();
+ mlog_entry_void ();
if (osb->proc_sub_dir) {
for (p = sub_dir; p->name; p++)
@@ -357,7 +355,7 @@
remove_proc_entry (dir, ocfs2_proc_root_dir);
}
- LOG_EXIT ();
+ mlog_exit_void ();
} /* ocfs_proc_remove_volume */
/*
@@ -370,12 +368,12 @@
int len;
int ret;
- LOG_ENTRY ();
+ mlog_entry_void ();
len = sprintf(page, "unknown\n");
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_mountpoint */
@@ -390,7 +388,7 @@
int ret = 0;
ocfs_super *osb = data;
- LOG_ENTRY ();
+ mlog_entry_void ();
#define PROC_STATS \
"Number of nodes : %u\n" \
@@ -404,7 +402,7 @@
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_statistics */
@@ -419,12 +417,12 @@
int ret;
ocfs_super *osb = data;
- LOG_ENTRY ();
+ mlog_entry_void ();
len = snprintf (page, sizeof(osb->dev_str), "%s\n", osb->dev_str);
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_device */
@@ -441,7 +439,7 @@
ocfs_super *osb = data;
char mount;
- LOG_ENTRY ();
+ mlog_entry_void ();
if (osb) {
for (i = 0; i < OCFS_NODE_MAP_MAX_NODES; i++) {
@@ -452,7 +450,7 @@
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_nodes */
@@ -467,12 +465,12 @@
int ret;
ocfs_super *osb = data;
- LOG_ENTRY ();
+ mlog_entry_void ();
len = sprintf (page, "%s\n", osb->vol_label);
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
- LOG_EXIT_INT (ret);
+ mlog_exit (ret);
return ret;
} /* ocfs_proc_label */
Modified: trunk/fs/ocfs2/slot_map.c
===================================================================
--- trunk/fs/ocfs2/slot_map.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/slot_map.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -30,7 +30,9 @@
#include <linux/highmem.h>
#include <linux/smp_lock.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_SUPER
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -42,8 +44,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_SLOTMAP
-
static s16 __ocfs2_node_num_to_slot(ocfs2_slot_info *si,
s16 global);
static void __ocfs2_fill_slot(ocfs2_slot_info *si,
@@ -101,7 +101,7 @@
status = ocfs_write_block(osb, si->si_bh, si->si_inode);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
return status;
}
@@ -165,7 +165,7 @@
si = kmalloc(sizeof(ocfs2_slot_info), GFP_KERNEL);
if (!si) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(si, 0, sizeof(ocfs2_slot_info));
@@ -179,19 +179,19 @@
inode = ocfs_get_system_file_inode(osb, SLOT_MAP_SYSTEM_INODE, -1);
if (!inode) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs2_extent_map_get_blocks(inode, 0ULL, 1, &blkno, NULL);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_read_block(osb, blkno, &bh, 0, inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -220,7 +220,7 @@
s16 slot;
ocfs2_slot_info *si;
- LOG_ENTRY();
+ mlog_entry_void();
si = osb->slot_info;
@@ -238,26 +238,26 @@
slot = __ocfs2_node_num_to_slot(si, OCFS_INVALID_NODE_NUM);
if (slot == OCFS_INVALID_NODE_NUM) {
spin_unlock(&si->si_lock);
- printk("ocfs2: no free slots available!\n");
+ mlog(ML_ERROR, "no free slots available!\n");
status = -EINVAL;
goto bail;
}
} else
- printk("ocfs2: slot %d is already allocated to this node!\n",
- slot);
+ mlog(ML_NOTICE, "slot %d is already allocated to this node!\n",
+ slot);
__ocfs2_fill_slot(si, slot, osb->node_num);
osb->slot_num = slot;
spin_unlock(&si->si_lock);
- printk("ocfs2: taking node slot %d\n", osb->slot_num);
+ mlog(ML_NOTICE, "taking node slot %d\n", osb->slot_num);
status = ocfs2_update_disk_slots(osb, si);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -278,7 +278,7 @@
status = ocfs2_update_disk_slots(osb, si);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
Modified: trunk/fs/ocfs2/suballoc.c
===================================================================
--- trunk/fs/ocfs2/suballoc.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/suballoc.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -31,7 +31,9 @@
#include <linux/slab.h>
#include <linux/highmem.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_DISK_ALLOC
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -44,8 +46,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_CHAINALLOC
-
static inline void debug_bg(ocfs2_group_desc *bg);
static inline void debug_suballoc_inode(ocfs2_dinode *fe);
static inline u16 ocfs2_find_victim_chain(ocfs2_chain_list *cl);
@@ -149,7 +149,7 @@
ocfs2_group_desc *bg = (ocfs2_group_desc *) bg_bh->b_data;
struct super_block * sb = alloc_inode->i_sb;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(((unsigned long long) bg_bh->b_blocknr) == group_blkno);
@@ -158,7 +158,7 @@
bg_bh,
OCFS_JOURNAL_ACCESS_CREATE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -177,10 +177,10 @@
status = ocfs_journal_dirty(handle, bg_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
#warning "we need to zero out the other blocks in the group! (only inode alloc?)"
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -206,12 +206,12 @@
u64 blkno;
int i;
- LOG_ENTRY();
+ mlog_entry_void();
blocks = ocfs2_clusters_to_blocks(osb->sb, (u32) clusters) - 1ULL;
bhs = kmalloc(blocks * sizeof(struct buffer_head *), GFP_KERNEL);
if (!bhs) {
- LOG_ERROR_STATUS(-ENOMEM);
+ mlog_errno(-ENOMEM);
goto bail;
}
memset(bhs, 0, blocks * sizeof(struct buffer_head *));
@@ -222,7 +222,7 @@
if (!bhs[i]) {
kfree(bhs);
bhs = NULL;
- LOG_ERROR_STATUS(-EIO);
+ mlog_errno(-EIO);
goto bail;
}
lock_buffer(bhs[i]);
@@ -240,7 +240,7 @@
submit_bh(WRITE, bhs[i]);
}
bail:
- LOG_EXIT();
+ mlog_exit_void();
return bhs;
}
@@ -284,12 +284,12 @@
OCFS_ASSERT(!ocfs2_is_cluster_bitmap(alloc_inode));
- LOG_ENTRY();
+ mlog_entry_void();
handle = ocfs_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -299,7 +299,7 @@
cl->cl_cpg,
&ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -307,7 +307,7 @@
handle = ocfs_start_trans(osb, handle, credits);
if (!handle) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -319,14 +319,14 @@
&num_bits);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
#ifdef OCFS_BG_ZERO
status = ocfs_block_group_zero_start(osb, bit_off, cl->cpg, &zero_bhs);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
#endif
@@ -334,13 +334,13 @@
/* setup the group */
bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off);
- LOG_TRACE_ARGS("new descriptor, record %u, at block %llu\n",
- alloc_rec, bg_blkno);
+ mlog(0, "new descriptor, record %u, at block %llu\n",
+ alloc_rec, bg_blkno);
bg_bh = sb_getblk(osb->sb, bg_blkno);
if (!bg_bh) {
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
set_buffer_uptodate(bg_bh);
@@ -353,7 +353,7 @@
alloc_rec,
cl);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -362,7 +362,7 @@
status = ocfs_journal_access(handle, alloc_inode,
bh, OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -384,7 +384,7 @@
status = ocfs_journal_dirty(handle, bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -411,7 +411,7 @@
if (bg_bh)
brelse(bg_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -426,14 +426,14 @@
ocfs2_dinode *fe;
u32 free_bits;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(!(handle->flags & OCFS_HANDLE_STARTED));
ocfs_handle_add_inode(handle, alloc_inode);
status = ocfs2_meta_lock(alloc_inode, handle, &bh, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -447,7 +447,7 @@
if (bits_wanted > free_bits) {
/* cluster bitmap never grows */
if (ocfs2_is_cluster_bitmap(alloc_inode)) {
- LOG_ERROR_ARGS("Disk Full: wanted=%u, free_bits=%u\n",
+ mlog(ML_ERROR, "Disk Full: wanted=%u, free_bits=%u\n",
bits_wanted, free_bits);
status = -ENOSPC;
goto bail;
@@ -456,7 +456,7 @@
status = ocfs_block_group_alloc(osb, alloc_inode, bh);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
/* You should never ask for this much metadata */
@@ -471,7 +471,7 @@
if (bh)
brelse(bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -486,7 +486,7 @@
*ac = kmalloc(sizeof(ocfs2_alloc_context), GFP_KERNEL);
if (!(*ac)) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(*ac, 0, sizeof(ocfs2_alloc_context));
@@ -501,7 +501,7 @@
#endif
if (!alloc_inode) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -510,7 +510,7 @@
status = ocfs_reserve_suballoc_bits(osb, (*ac));
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -524,7 +524,7 @@
if (alloc_inode)
iput(alloc_inode);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -538,7 +538,7 @@
*ac = kmalloc(sizeof(ocfs2_alloc_context), GFP_KERNEL);
if (!(*ac)) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(*ac, 0, sizeof(ocfs2_alloc_context));
@@ -549,7 +549,7 @@
alloc_inode = ocfs_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE, osb->slot_num);
if (!alloc_inode) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -559,7 +559,7 @@
status = ocfs_reserve_suballoc_bits(osb, *ac);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -573,7 +573,7 @@
if (alloc_inode)
iput(alloc_inode);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -589,7 +589,7 @@
-1);
if (!ac->ac_inode) {
status = -EINVAL;
- LOG_ERROR_STR("Could not get bitmap inode!");
+ mlog(ML_ERROR, "Could not get bitmap inode!\n");
goto bail;
}
ac->ac_which = OCFS_AC_USE_MAIN;
@@ -597,7 +597,7 @@
status = ocfs_reserve_suballoc_bits(osb, ac);
if (status < 0 && status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
return status;
}
@@ -612,14 +612,14 @@
{
int status;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(handle);
*ac = kmalloc(sizeof(ocfs2_alloc_context), GFP_KERNEL);
if (!(*ac)) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(*ac, 0, sizeof(ocfs2_alloc_context));
@@ -633,14 +633,14 @@
bits_wanted,
*ac);
if ((status < 0) && (status != -ENOSPC)) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
} else if (status == -ENOSPC) {
#warning "need to deal with disabling local alloc better"
/* reserve_local_bits will return enospc with
* the local alloc inode still locked, so we
* can change this safely here. */
- LOG_ERROR_STR("Disabling local alloc");
+ mlog(ML_ERROR, "Disabling local alloc\n");
osb->have_local_alloc = 0;
// ocfs_shutdown_local_alloc(osb);
}
@@ -650,7 +650,7 @@
status = ocfs_reserve_cluster_bitmap_bits(osb, *ac);
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -662,7 +662,7 @@
*ac = NULL;
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -745,7 +745,7 @@
}
/* we got everything we needed */
if (found == bits_wanted) {
- /* LOG_TRACE_STR("Found it all!"); */
+ /* mlog(0, "Found it all!\n"); */
break;
}
}
@@ -760,7 +760,7 @@
*bits_found = best_size;
} else {
status = -ENOSPC;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
}
return status;
@@ -777,13 +777,13 @@
void *bitmap = bg->bg_bitmap;
int journal_type = OCFS_JOURNAL_ACCESS_WRITE;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(bg));
OCFS_ASSERT(bg->bg_free_bits_count >= num_bits);
- LOG_TRACE_ARGS("block_group_set_bits: off = %u, num = %u\n", bit_off,
- num_bits);
+ mlog(0, "block_group_set_bits: off = %u, num = %u\n", bit_off,
+ num_bits);
if (ocfs2_is_cluster_bitmap(alloc_inode))
journal_type = OCFS_JOURNAL_ACCESS_UNDO;
@@ -793,7 +793,7 @@
group_bh,
journal_type);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -805,12 +805,12 @@
status = ocfs_journal_dirty(handle,
group_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -851,9 +851,9 @@
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(bg));
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(prev_bg));
- LOG_TRACE_ARGS("In suballoc %llu, chain %u, move group %llu to top, "
- "prev = %llu\n", fe->i_blkno, chain, bg->bg_blkno,
- prev_bg->bg_blkno);
+ mlog(0, "In suballoc %llu, chain %u, move group %llu to top, "
+ "prev = %llu\n", fe->i_blkno, chain, bg->bg_blkno,
+ prev_bg->bg_blkno);
fe_ptr = fe->id2.i_chain.cl_recs[chain].c_blkno;
bg_ptr = bg->bg_next_group;
@@ -862,7 +862,7 @@
status = ocfs_journal_access(handle, alloc_inode, prev_bg_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -870,14 +870,14 @@
status = ocfs_journal_dirty(handle, prev_bg_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_journal_access(handle, alloc_inode, bg_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -885,14 +885,14 @@
status = ocfs_journal_dirty(handle, bg_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_journal_access(handle, alloc_inode, fe_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -900,7 +900,7 @@
status = ocfs_journal_dirty(handle, fe_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -912,7 +912,7 @@
prev_bg->bg_next_group = prev_bg_ptr;
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -991,14 +991,14 @@
ocfs2_group_desc *bg;
chain = ac->ac_chain;
- LOG_TRACE_ARGS("trying to alloc %u bits from chain %u, inode %llu\n",
- bits_wanted, chain, OCFS_I(alloc_inode)->ip_blkno);
+ mlog(0, "trying to alloc %u bits from chain %u, inode %llu\n",
+ bits_wanted, chain, OCFS_I(alloc_inode)->ip_blkno);
status = ocfs_read_block(OCFS2_SB(alloc_inode->i_sb),
cl->cl_recs[chain].c_blkno, &group_bh,
OCFS_BH_CACHED, alloc_inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bg = (ocfs2_group_desc *) group_bh->b_data;
@@ -1024,7 +1024,7 @@
next_group, &group_bh,
OCFS_BH_CACHED, alloc_inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bg = (ocfs2_group_desc *) group_bh->b_data;
@@ -1032,12 +1032,12 @@
}
if (status < 0) {
if (status != -ENOSPC)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
- LOG_TRACE_ARGS("alloc succeeds: we give %u bits from block group "
- "%llu\n", tmp_bits, bg->bg_blkno);
+ mlog(0, "alloc succeeds: we give %u bits from block group "
+ "%llu\n", tmp_bits, bg->bg_blkno);
*num_bits = tmp_bits;
@@ -1063,7 +1063,7 @@
ac->ac_bh, group_bh,
prev_group_bh, chain);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
@@ -1075,7 +1075,7 @@
ac->ac_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1086,7 +1086,7 @@
status = ocfs_journal_dirty(handle,
ac->ac_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1097,12 +1097,12 @@
*bit_off,
*num_bits);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
- LOG_TRACE_ARGS("Allocated %u bits from suballocator %llu\n",
- *num_bits, fe->i_blkno);
+ mlog(0, "Allocated %u bits from suballocator %llu\n",
+ *num_bits, fe->i_blkno);
*bg_blkno = bg->bg_blkno;
bail:
@@ -1111,7 +1111,7 @@
if (prev_group_bh)
brelse(prev_group_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1129,7 +1129,7 @@
ocfs2_chain_list *cl;
ocfs2_dinode *fe;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(ac->ac_bits_given < ac->ac_bits_wanted);
OCFS_ASSERT(bits_wanted <= (ac->ac_bits_wanted - ac->ac_bits_given));
@@ -1151,12 +1151,12 @@
if (!status)
goto bail;
if (status < 0 && status != -ENOSPC) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
- LOG_TRACE_ARGS("Search of victim chain %u came up with nothing, "
- "trying all chains now.\n", victim);
+ mlog(0, "Search of victim chain %u came up with nothing, "
+ "trying all chains now.\n", victim);
/* If we didn't pick a good victim, then just default to
* searching each chain in order. Don't allow chain relinking
@@ -1176,13 +1176,13 @@
if (!status)
break;
if (status < 0 && status != -ENOSPC) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1210,7 +1210,7 @@
num_bits,
&bg_blkno);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1218,7 +1218,7 @@
ac->ac_bits_given += (*num_bits);
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1232,7 +1232,7 @@
unsigned int num_bits;
u64 bg_blkno;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(ac);
OCFS_ASSERT(ac->ac_bits_given == 0);
@@ -1248,7 +1248,7 @@
&num_bits,
&bg_blkno);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1258,7 +1258,7 @@
ac->ac_bits_given++;
status = 0;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1336,7 +1336,7 @@
u64 bg_blkno;
u16 bg_bit_off;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT(ac);
OCFS_ASSERT(ac->ac_bits_given < ac->ac_bits_wanted);
@@ -1356,7 +1356,7 @@
if (min_clusters > (osb->bitmap_cpg - 1)) {
/* The only paths asking for contiguousness
* should know about this already. */
- LOG_ERROR_ARGS("minimum allocation requested exceeds "
+ mlog(ML_ERROR, "minimum allocation requested exceeds "
"group bitmap size!");
status = -ENOSPC;
goto bail;
@@ -1383,14 +1383,14 @@
* the reserve function should've given you enough,
* and ENOSPC this is a real error. */
if ((status != -ENOSPC) || (min_clusters == 1))
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
ac->ac_bits_given += *num_clusters;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1406,11 +1406,11 @@
int journal_type = OCFS_JOURNAL_ACCESS_WRITE;
ocfs2_group_desc *undo_bg = NULL;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(bg));
- LOG_TRACE_ARGS("off = %u, num = %u\n", bit_off, num_bits);
+ mlog(0, "off = %u, num = %u\n", bit_off, num_bits);
if (ocfs2_is_cluster_bitmap(alloc_inode))
journal_type = OCFS_JOURNAL_ACCESS_UNDO;
@@ -1418,7 +1418,7 @@
status = ocfs_journal_access(handle, alloc_inode, group_bh,
journal_type);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1437,7 +1437,7 @@
status = ocfs_journal_dirty(handle, group_bh);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
bail:
return status;
}
@@ -1460,21 +1460,20 @@
struct buffer_head *group_bh = NULL;
ocfs2_group_desc *group;
- LOG_ENTRY();
+ mlog_entry_void();
OCFS_ASSERT_RO(IS_VALID_FILE_ENTRY(fe));
OCFS_ASSERT((count + start_bit)
<= ((u32) cl->cl_cpg * (u32) cl->cl_bpc));
- LOG_TRACE_ARGS("suballocator %llu: freeing %u bits from group %llu, "
- "starting at %u\n",
- OCFS_I(alloc_inode)->ip_blkno, count, bg_blkno,
- start_bit);
+ mlog(0, "suballocator %llu: freeing %u bits from group %llu, "
+ "starting at %u\n", OCFS_I(alloc_inode)->ip_blkno, count,
+ bg_blkno, start_bit);
status = ocfs_read_block(osb, bg_blkno, &group_bh, OCFS_BH_CACHED,
alloc_inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1486,14 +1485,14 @@
group, group_bh,
start_bit, count);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
status = ocfs_journal_access(handle, alloc_inode, alloc_bh,
OCFS_JOURNAL_ACCESS_WRITE);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1503,7 +1502,7 @@
status = ocfs_journal_dirty(handle, alloc_bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1511,7 +1510,7 @@
if (group_bh)
brelse(group_bh);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -1563,25 +1562,25 @@
* bigger than a block group bitmap so we never have to worry
* about looping on them. */
- LOG_ENTRY();
+ mlog_entry_void();
fe = (ocfs2_dinode *) bitmap_bh->b_data;
ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno,
&bg_start_bit);
- LOG_TRACE_ARGS("want to free %u clusters starting at block %llu\n",
- num_clusters, start_blk);
- LOG_TRACE_ARGS("bg_blkno = %llu, bg_start_bit = %u\n", bg_blkno,
- bg_start_bit);
+ mlog(0, "want to free %u clusters starting at block %llu\n",
+ num_clusters, start_blk);
+ mlog(0, "bg_blkno = %llu, bg_start_bit = %u\n", bg_blkno,
+ bg_start_bit);
status = ocfs_free_suballoc_bits(handle, bitmap_inode, bitmap_bh,
bg_start_bit, bg_blkno,
num_clusters);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
Modified: trunk/fs/ocfs2/super.c
===================================================================
--- trunk/fs/ocfs2/super.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/super.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -44,7 +44,9 @@
#include <cluster/nodemanager.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_SUPER
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
#include "aio.h"
@@ -68,8 +70,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_SUPER
-
/*
* Globals
*/
@@ -253,12 +253,12 @@
int status = 0;
int i;
- LOG_ENTRY();
+ mlog_entry_void();
new = ocfs_iget(osb, osb->root_blkno);
if (!new) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
osb->root_inode = new;
@@ -266,7 +266,7 @@
new = ocfs_iget(osb, osb->system_dir_blkno);
if (!new) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
osb->sys_root_inode = new;
@@ -277,9 +277,10 @@
if (!new) {
ocfs_release_system_inodes(osb);
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
/* FIXME: Should ERROR_RO_FS */
- LOG_ERROR_ARGS("Unable to load system inode %d, possibly corrupt fs?", i);
+ mlog(ML_ERROR, "Unable to load system inode %d, "
+ "possibly corrupt fs?", i);
goto bail;
}
// the array now has one ref, so drop this one
@@ -287,7 +288,7 @@
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_init_global_system_inodes */
@@ -300,14 +301,14 @@
int status = 0;
int i;
- LOG_ENTRY();
+ mlog_entry_void();
for (i = OCFS2_LAST_GLOBAL_SYSTEM_INODE + 1; i < NUM_SYSTEM_INODES ; i++) {
new = ocfs_get_system_file_inode(osb, i, osb->slot_num);
if (!new) {
ocfs_release_system_inodes(osb);
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
// the array now has one ref, so drop this one
@@ -315,7 +316,7 @@
}
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_init_local_system_inodes */
@@ -327,7 +328,7 @@
int status = 0, i;
struct inode *inode;
- LOG_ENTRY();
+ mlog_entry_void();
for (i = 0; i < NUM_SYSTEM_INODES; i++) {
inode = osb->system_inodes[i];
@@ -343,7 +344,7 @@
osb->sys_root_inode = NULL;
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
} /* ocfs_release_system_inodes */
@@ -389,7 +390,7 @@
struct inode *inode = NULL;
ocfs_super *osb = NULL;
- LOG_ENTRY_ARGS ("%p, %p, %i", sb, data, silent);
+ mlog_entry ("%p, %p, %i", sb, data, silent);
/* for now we only have one cluster/node, make sure we see it
* in the heartbeat universe */
@@ -402,7 +403,7 @@
if (!data || strcmp(data, OCFS2_HB_OK)) {
status = -EINVAL;
if (data)
- LOG_ERROR_ARGS("Invalid options: %s\n", (char *)data);
+ mlog(ML_ERROR, "Invalid options: %s\n", (char *)data);
goto read_super_error;
}
@@ -427,14 +428,14 @@
inode = osb->root_inode;
if (!inode) {
status = -EIO;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto read_super_error;
}
root = d_alloc_root (inode);
if (!root) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
iput (inode);
inode = NULL;
goto read_super_error;
@@ -442,9 +443,9 @@
sb->s_root = root;
- printk ("ocfs2: Mounting device (%u,%u) on (node %d, slot %d)\n",
- MAJOR(sb->s_dev), MINOR(sb->s_dev), osb->node_num,
- osb->slot_num);
+ printk("ocfs2: Mounting device (%u,%u) on (node %d, slot %d)\n",
+ MAJOR(sb->s_dev), MINOR(sb->s_dev), osb->node_num,
+ osb->slot_num);
atomic_set(&osb->vol_state, VOLUME_MOUNTED);
@@ -453,10 +454,10 @@
* MOUNTED as we may sleep on any recovery threads. */
status = ocfs2_complete_mount_recovery(osb);
if (status < 0)
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
read_super_error:
@@ -468,7 +469,7 @@
if (inode)
iput (inode);
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -503,7 +504,7 @@
{
int status;
- LOG_ENTRY ();
+ mlog_entry_void ();
ocfs2_print_version();
@@ -513,14 +514,14 @@
ocfs_table_header = register_sysctl_table(ocfs_root_table, 0);
if (!ocfs_table_header) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
/* Initialize the memory slabs for oin and file entry */
status = ocfs_initialize_mem_caches();
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -541,7 +542,7 @@
exit_ocfs2_extent_maps();
}
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
if (status >= 0) {
return register_filesystem (&ocfs_fs_type);
@@ -552,7 +553,7 @@
static void __exit ocfs2_exit(void)
{
- LOG_ENTRY ();
+ mlog_entry_void ();
if (ocfs_table_header)
unregister_sysctl_table(ocfs_table_header);
@@ -566,8 +567,7 @@
exit_ocfs2_extent_maps();
- printk("Unloaded OCFS2\n");
- LOG_EXIT ();
+ mlog_exit_void ();
}
@@ -577,12 +577,12 @@
*/
static void ocfs_put_super (struct super_block *sb)
{
- LOG_ENTRY_ARGS ("(0x%p)\n", sb);
+ mlog_entry ("(0x%p)\n", sb);
ocfs_sync_blockdev(sb);
ocfs_dismount_volume (sb);
- LOG_EXIT ();
+ mlog_exit_void ();
} /* ocfs_put_super */
@@ -600,7 +600,7 @@
struct buffer_head *bh = NULL;
struct inode *inode = NULL;
- LOG_ENTRY_ARGS ("(%p, %p)\n", sb, buf);
+ mlog_entry ("(%p, %p)\n", sb, buf);
osb = OCFS_SB(sb);
@@ -608,14 +608,14 @@
GLOBAL_BITMAP_SYSTEM_INODE,
-1);
if (!inode) {
- LOG_ERROR_STR("failed to get bitmap inode");
+ mlog(ML_ERROR, "failed to get bitmap inode\n");
status = -EIO;
goto bail;
}
status = ocfs2_meta_lock(inode, NULL, &bh, 0);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -643,7 +643,7 @@
if (inode)
iput (inode);
- LOG_EXIT_INT (status);
+ mlog_exit (status);
return status;
} /* ocfs_statfs */
@@ -699,7 +699,8 @@
/* may be > 512 */
*sector_size = bdev_hardsect_size(sb->s_bdev);
if (*sector_size > OCFS2_MAX_BLOCKSIZE) {
- LOG_ERROR_ARGS("Hardware sector size too large: %d (max=%d)\n", *sector_size, OCFS2_MAX_BLOCKSIZE);
+ mlog(ML_ERROR, "Hardware sector size too large: %d (max=%d)\n",
+ *sector_size, OCFS2_MAX_BLOCKSIZE);
status = -EINVAL;
goto bail;
}
@@ -711,26 +712,26 @@
/* check block zero for old format */
status = ocfs2_get_sector(sb, bh, 0, *sector_size);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
hdr = (ocfs1_vol_disk_hdr *) (*bh)->b_data;
if (hdr->major_version == OCFS1_MAJOR_VERSION) {
- LOG_ERROR_ARGS("incompatible version: %u.%u\n",
- hdr->major_version, hdr->minor_version);
+ mlog(ML_ERROR, "incompatible version: %u.%u\n",
+ hdr->major_version, hdr->minor_version);
status = -EINVAL;
}
if (memcmp (hdr->signature, OCFS1_VOLUME_SIGNATURE,
strlen (OCFS1_VOLUME_SIGNATURE)) == 0) {
- LOG_ERROR_ARGS("incompatible volume signature: %8s\n",
- hdr->signature);
+ mlog(ML_ERROR, "incompatible volume signature: %8s\n",
+ hdr->signature);
status = -EINVAL;
}
brelse(*bh);
*bh = NULL;
if (status < 0) {
- LOG_ERROR_STR("This is an ocfs v1 filesystem which must be upgraded "
- "before mounting with ocfs v2");
+ mlog(ML_ERROR, "This is an ocfs v1 filesystem which must be "
+ "upgraded before mounting with ocfs v2\n");
goto bail;
}
@@ -746,7 +747,7 @@
blksize);
if (tmpstat < 0) {
status = tmpstat;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
di = (ocfs2_dinode *) (*bh)->b_data;
@@ -766,13 +767,13 @@
static int ocfs2_get_sector(struct super_block *sb, struct buffer_head **bh, int block, int sect_size)
{
if (!sb_set_blocksize(sb, sect_size)) {
- LOG_ERROR_STR("unable to set blocksize");
+ mlog(ML_ERROR, "unable to set blocksize\n");
return -EIO;
}
*bh = sb_getblk(sb, block);
if (!*bh) {
- LOG_ERROR_STATUS(-EIO);
+ mlog_errno(-EIO);
return -EIO;
}
lock_buffer(*bh);
@@ -793,12 +794,12 @@
* desirable. */
osb->node_num = nm_this_node();
if (osb->node_num == NM_MAX_NODES) {
- printk("ocfs2: could not find this host's node number\n");
+ mlog(ML_ERROR, "could not find this host's node number\n");
status = -ENOENT;
goto bail;
}
- printk("ocfs2: I am node %d\n", osb->node_num);
+ mlog(ML_NOTICE, "I am node %d\n", osb->node_num);
status = 0;
bail:
@@ -816,18 +817,18 @@
ocfs_super *osb = NULL;
struct buffer_head *bh = NULL;
- LOG_ENTRY ();
+ mlog_entry_void ();
/* probe for superblock */
status = ocfs2_sb_probe(sb, &bh, §or_size);
if (status < 0) {
- LOG_ERROR_STR("superblock probe failed!");
+ mlog(ML_ERROR, "superblock probe failed!\n");
goto leave;
}
if ((osb = kmalloc (sizeof(ocfs_super), GFP_KERNEL)) == NULL) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
memset(osb, 0, sizeof(ocfs_super));
@@ -844,38 +845,38 @@
/* s_blocksize was set in the probe */
status = ocfs_initialize_osb(osb, bh);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs2_fill_local_node_info(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs2_register_hb_callbacks(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs2_dlm_init(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
/* requires vote_thread to be running. */
status = ocfs2_register_net_handlers(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
status = ocfs2_super_lock(osb, 1);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
unlock_super = 1;
@@ -883,7 +884,7 @@
/* This will load up the node map and add ourselves to it. */
status = ocfs2_find_slot(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -892,7 +893,7 @@
/* load all node-local system inodes */
status = ocfs_init_local_system_inodes(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -901,10 +902,10 @@
/* Read the publish sector for this node and cleanup dirent being */
/* modified when we crashed. */
- LOG_TRACE_STR ("ocfs_check_volume...");
+ mlog(0, "ocfs_check_volume...\n");
status = ocfs_check_volume (osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto leave;
}
@@ -915,7 +916,7 @@
* try to clean us up while we're live! */
status = ocfs2_request_mount_vote(osb);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
leave:
if (unlock_super)
@@ -923,7 +924,7 @@
if (bh != NULL)
brelse(bh);
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_mount_volume */
@@ -946,7 +947,7 @@
int tmp;
ocfs_super *osb = NULL;
- LOG_ENTRY_ARGS ("(0x%p)\n", sb);
+ mlog_entry ("(0x%p)\n", sb);
OCFS_ASSERT(sb);
osb = OCFS_SB(sb);
@@ -975,13 +976,13 @@
tmp = ocfs2_super_lock(osb, 1);
if (tmp < 0) {
- LOG_ERROR_STATUS(tmp);
+ mlog_errno(tmp);
return;
}
tmp = ocfs2_request_umount_vote(osb);
if (tmp < 0)
- LOG_ERROR_STATUS(tmp);
+ mlog_errno(tmp);
ocfs2_wait_for_okp_destruction(osb);
@@ -999,8 +1000,8 @@
atomic_set(&osb->vol_state, VOLUME_DISMOUNTED);
- printk ("ocfs2: Unmounting device (%u,%u) on (node %d)\n",
- MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev), osb->node_num);
+ printk("ocfs2: Unmounting device (%u,%u) on (node %d)\n",
+ MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev), osb->node_num);
ocfs_delete_osb (osb);
kfree(osb);
@@ -1046,19 +1047,19 @@
struct buffer_head *bitmap_bh = NULL;
ocfs_journal *journal;
- LOG_ENTRY ();
+ mlog_entry_void ();
INIT_LIST_HEAD(&osb->osb_net_handlers);
osb->vol_label = kmalloc(64, GFP_KERNEL);
if (!osb->vol_label) {
- LOG_ERROR_STR("unable to alloc vol label");
+ mlog(ML_ERROR, "unable to alloc vol label\n");
status = -ENOMEM;
goto bail;
}
osb->uuid = kmalloc(OCFS2_VOL_UUID_LEN, GFP_KERNEL);
if (!osb->uuid) {
- LOG_ERROR_STR("unable to alloc uuid");
+ mlog(ML_ERROR, "unable to alloc uuid\n");
status = -ENOMEM;
goto bail;
}
@@ -1067,12 +1068,12 @@
di = (ocfs2_dinode *) bh->b_data;
osb->max_nodes = le16_to_cpu(di->id2.i_super.s_max_nodes);
if (osb->max_nodes > OCFS2_MAX_NODES) {
- LOG_ERROR_ARGS("Invalid number of nodes (%u)\n",
- osb->max_nodes);
+ mlog(ML_ERROR, "Invalid number of nodes (%u)\n",
+ osb->max_nodes);
status = -EINVAL;
goto bail;
}
- printk("max_nodes for this device: %u\n", osb->max_nodes);
+ mlog(ML_NOTICE, "max_nodes for this device: %u\n", osb->max_nodes);
osb->s_feature_compat =
le32_to_cpu(OCFS2_RAW_SB(di)->s_feature_compat);
@@ -1082,16 +1083,15 @@
le32_to_cpu(OCFS2_RAW_SB(di)->s_feature_incompat);
if ((i = OCFS2_HAS_INCOMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_INCOMPAT_SUPP))) {
- LOG_ERROR_ARGS("couldn't mount because of unsupported "
- "optional features (%x).\n", i);
+ mlog(ML_ERROR, "couldn't mount because of unsupported "
+ "optional features (%x).\n", i);
status = -EINVAL;
goto bail;
}
if (!(osb->sb->s_flags & MS_RDONLY) &&
(i = OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP))) {
- LOG_ERROR_ARGS("couldn't mount RDWR because of "
- "unsupported optional features (%x).\n",
- i);
+ mlog(ML_ERROR, "couldn't mount RDWR because of "
+ "unsupported optional features (%x).\n", i);
status = -EINVAL;
goto bail;
}
@@ -1125,7 +1125,7 @@
journal = kmalloc(sizeof(ocfs_journal), GFP_KERNEL);
if (!journal) {
- LOG_ERROR_STR("unable to alloc journal");
+ mlog(ML_ERROR, "unable to alloc journal\n");
status = -ENOMEM;
goto bail;
}
@@ -1169,20 +1169,20 @@
/* get some pseudo constants for clustersize bits */
osb->s_clustersize_bits = le32_to_cpu(di->id2.i_super.s_clustersize_bits);
osb->s_clustersize = 1 << osb->s_clustersize_bits;
- printk("clusterbits=%d\n", osb->s_clustersize_bits);
+ mlog(0, "clusterbits=%d\n", osb->s_clustersize_bits);
OCFS_ASSERT(osb->s_clustersize_bits);
if (ocfs2_clusters_to_blocks(osb->sb, di->i_clusters - 1)
> (u32)~0UL) {
- LOG_ERROR_ARGS("Volume might try to write to blocks beyond "
- "what jbd can address in 32 bits.\n");
+ mlog(ML_ERROR, "Volume might try to write to blocks beyond "
+ "what jbd can address in 32 bits.\n");
status = -EINVAL;
goto bail;
}
if (osb_setup_uuid(osb, di->id2.i_super.s_uuid,
sizeof(di->id2.i_super.s_uuid))) {
- LOG_ERROR_ARGS("Out of memory trying to setup our uuid.\n");
+ mlog(ML_ERROR, "Out of memory trying to setup our uuid.\n");
status = -ENOMEM;
goto bail;
}
@@ -1193,16 +1193,17 @@
osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.s_system_dir_blkno);
osb->first_cluster_group_blkno = le64_to_cpu(di->id2.i_super.s_first_cluster_group);
osb->fs_generation = le32_to_cpu(di->i_fs_generation);
- printk("vol_label: %s\n", osb->vol_label);
- printk("uuid: %s\n", osb->uuid_str);
- printk("root_blkno=%llu, system_dir_blkno=%llu\n", osb->root_blkno, osb->system_dir_blkno);
+ mlog(0, "vol_label: %s\n", osb->vol_label);
+ mlog(0, "uuid: %s\n", osb->uuid_str);
+ mlog(0, "root_blkno=%llu, system_dir_blkno=%llu\n", osb->root_blkno,
+ osb->system_dir_blkno);
atomic_set (&osb->vol_state, VOLUME_INIT);
/* load root, system_dir, and all global system inodes */
status = ocfs_init_global_system_inodes(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1212,15 +1213,14 @@
inode = ocfs_get_system_file_inode(osb, HEARTBEAT_SYSTEM_INODE, -1);
if (!inode) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
if (inode->i_size >> osb->sb->s_blocksize_bits < OCFS2_MAX_NODES) {
- LOG_ERROR_ARGS("heartbeat area size incorrect: "
- "found=%llu, need=%u\n",
- inode->i_size,
- OCFS2_MAX_NODES << osb->sb->s_blocksize_bits);
+ mlog(ML_ERROR, "heartbeat area size incorrect: found=%llu, "
+ "need=%u\n", inode->i_size,
+ OCFS2_MAX_NODES << osb->sb->s_blocksize_bits);
status = -EINVAL;
goto bail;
@@ -1233,7 +1233,7 @@
inode = ocfs_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE, -1);
if (!inode) {
status = -EINVAL;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1242,7 +1242,7 @@
status = ocfs_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0, inode);
iput(inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1250,12 +1250,12 @@
osb->bitmap_cpg = di->id2.i_chain.cl_cpg;
osb->num_clusters = le32_to_cpu(di->id1.bitmap1.i_total);
brelse(bitmap_bh);
- printk("cluster bitmap inode: %llu, clusters per group: %u\n",
- osb->bitmap_blkno, osb->bitmap_cpg);
+ mlog(0, "cluster bitmap inode: %llu, clusters per group: %u\n",
+ osb->bitmap_blkno, osb->bitmap_cpg);
status = ocfs2_init_slot_info(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -1267,14 +1267,14 @@
osb_id++;
else {
spin_unlock (&ocfs2_globals_lock);
- LOG_ERROR_STR ("Too many volumes mounted");
+ mlog(ML_ERROR, "Too many volumes mounted\n");
status = -ENOMEM;
goto bail;
}
spin_unlock (&ocfs2_globals_lock);
bail:
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_initialize_osb */
@@ -1289,51 +1289,50 @@
{
int status = -EAGAIN;
- LOG_ENTRY ();
+ mlog_entry_void ();
if (memcmp(di->i_signature, OCFS2_SUPER_BLOCK_SIGNATURE,
strlen(OCFS2_SUPER_BLOCK_SIGNATURE)) == 0) {
status = -EINVAL;
if ((1 << le32_to_cpu(di->id2.i_super.s_blocksize_bits)) != blksz) {
- LOG_ERROR_ARGS("found superblock with incorrect block size: "
- "found %u, should be %u\n",
- 1 << le32_to_cpu(di->id2.i_super.s_blocksize_bits),
+ mlog(ML_ERROR, "found superblock with incorrect block "
+ "size: found %u, should be %u\n",
+ 1 << le32_to_cpu(di->id2.i_super.s_blocksize_bits),
blksz);
} else if (le16_to_cpu(di->id2.i_super.s_major_rev_level) !=
OCFS2_MAJOR_REV_LEVEL ||
le16_to_cpu(di->id2.i_super.s_minor_rev_level) !=
OCFS2_MINOR_REV_LEVEL) {
- LOG_ERROR_ARGS("found superblock with bad version: "
- "found %u.%u, should be %u.%u\n",
- le16_to_cpu(di->id2.i_super.s_major_rev_level),
- le16_to_cpu(di->id2.i_super.s_minor_rev_level),
- OCFS2_MAJOR_REV_LEVEL,
- OCFS2_MINOR_REV_LEVEL);
+ mlog(ML_ERROR, "found superblock with bad version: "
+ "found %u.%u, should be %u.%u\n",
+ le16_to_cpu(di->id2.i_super.s_major_rev_level),
+ le16_to_cpu(di->id2.i_super.s_minor_rev_level),
+ OCFS2_MAJOR_REV_LEVEL,
+ OCFS2_MINOR_REV_LEVEL);
} else if (bh->b_blocknr != di->i_blkno) {
- LOG_ERROR_ARGS("bad block number on superblock: "
- "found %llu, should be %llu\n",
- di->i_blkno,
- (unsigned long long)bh->b_blocknr);
+ mlog(ML_ERROR, "bad block number on superblock: "
+ "found %llu, should be %llu\n",
+ di->i_blkno, (unsigned long long)bh->b_blocknr);
} else if (le32_to_cpu(di->id2.i_super.s_clustersize_bits) < 12 ||
le32_to_cpu(di->id2.i_super.s_clustersize_bits) > 20) {
- LOG_ERROR_ARGS("bad cluster size found: %u\n",
- 1 << le32_to_cpu(di->id2.i_super.s_clustersize_bits));
+ mlog(ML_ERROR, "bad cluster size found: %u\n",
+ 1 << le32_to_cpu(di->id2.i_super.s_clustersize_bits));
} else if (!le64_to_cpu(di->id2.i_super.s_root_blkno)) {
- LOG_ERROR_STR("bad root_blkno: 0");
+ mlog(ML_ERROR, "bad root_blkno: 0\n");
} else if (!le64_to_cpu(di->id2.i_super.s_system_dir_blkno)) {
- LOG_ERROR_STR("bad system_dir_blkno: 0");
+ mlog(ML_ERROR, "bad system_dir_blkno: 0\n");
} else if (le16_to_cpu(di->id2.i_super.s_max_nodes) > OCFS2_MAX_NODES) {
- LOG_ERROR_ARGS("max_nodes found greater than maximum: "
- "found %u, max %u\n",
- le16_to_cpu(di->id2.i_super.s_max_nodes),
- OCFS2_MAX_NODES);
+ mlog(ML_ERROR, "max_nodes found greater than maximum: "
+ "found %u, max %u\n",
+ le16_to_cpu(di->id2.i_super.s_max_nodes),
+ OCFS2_MAX_NODES);
} else {
/* found it! */
status = 0;
}
}
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_verify_volume */
@@ -1350,13 +1349,13 @@
if (osb->dirty) {
status = ocfs_complete_local_alloc_recovery(osb, local_alloc);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto finally;
}
status = ocfs_recover_orphans(osb);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
}
osb->dirty = 0;
@@ -1378,12 +1377,12 @@
* recover
* ourselves. */
- LOG_ENTRY ();
+ mlog_entry_void ();
/* Init our journal object. */
status = ocfs_journal_init(osb->journal, &dirty);
if (status < 0) {
- LOG_ERROR_STR("Could not initialize journal!");
+ mlog(ML_ERROR, "Could not initialize journal!\n");
goto finally;
}
@@ -1393,12 +1392,12 @@
if (!dirty) {
status = ocfs_journal_wipe(osb->journal, 0);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto finally;
}
} else {
- printk(KERN_NOTICE "ocfs2: File system was not unmounted "
- "cleanly, recovering volume.\n");
+ mlog(ML_NOTICE, "File system was not unmounted cleanly, "
+ "recovering volume.\n");
}
/* will play back anything left in the journal. */
@@ -1410,18 +1409,18 @@
osb->slot_num,
&local_alloc);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto finally;
}
/* we complete the recovery process after we've marked
* ourselves as mounted. */
}
- LOG_TRACE_STR("Journal loaded.");
+ mlog(0, "Journal loaded.\n");
status = ocfs_load_local_alloc(osb);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto finally;
}
@@ -1438,13 +1437,13 @@
* map and launch a recovery thread for it. */
status = ocfs2_mark_dead_nodes(osb);
if (status < 0)
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
finally:
if (local_alloc)
kfree(local_alloc);
- LOG_EXIT_STATUS (status);
+ mlog_exit (status);
return status;
} /* ocfs_check_volume */
@@ -1459,7 +1458,7 @@
*/
static void ocfs_delete_osb (ocfs_super * osb)
{
- LOG_ENTRY ();
+ mlog_entry_void ();
/* This function assumes that the caller has the main osb resource */
@@ -1477,7 +1476,7 @@
kfree(osb->uuid_str);
memset (osb, 0, sizeof (ocfs_super));
- LOG_EXIT ();
+ mlog_exit_void ();
} /* ocfs_delete_osb */
Modified: trunk/fs/ocfs2/symlink.c
===================================================================
--- trunk/fs/ocfs2/symlink.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/symlink.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -42,7 +42,9 @@
#include <linux/pagemap.h>
#include <linux/utsname.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_NAMEI
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -54,8 +56,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_SYMLINK
-
struct ocfs_symlink_ops {
const char *name;
const unsigned int len;
@@ -249,7 +249,7 @@
char *link = NULL;
ocfs2_dinode *fe;
- LOG_ENTRY();
+ mlog_entry_void();
status = ocfs_read_block(OCFS2_SB(inode->i_sb),
OCFS_I(inode)->ip_blkno,
@@ -257,7 +257,7 @@
OCFS_BH_CACHED,
inode);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
link = ERR_PTR(status);
goto bail;
}
@@ -265,7 +265,7 @@
fe = (ocfs2_dinode *) (*bh)->b_data;
link = (char *) fe->id2.i_symlink;
bail:
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return link;
}
@@ -381,7 +381,7 @@
struct buffer_head *bh = NULL;
struct inode *inode = dentry->d_inode;
- LOG_ENTRY();
+ mlog_entry_void();
link = ocfs2_fast_symlink_getlink(inode, &bh);
if (IS_ERR(link)) {
@@ -393,7 +393,7 @@
brelse(bh);
out:
- LOG_EXIT_STATUS(ret);
+ mlog_exit(ret);
return ret;
}
Modified: trunk/fs/ocfs2/sysfile.c
===================================================================
--- trunk/fs/ocfs2/sysfile.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/sysfile.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -30,10 +30,12 @@
#include <linux/slab.h>
#include <linux/highmem.h>
-#include "ocfs_log.h"
#include "ocfs.h"
#include "ocfs2.h"
+#define MLOG_MASK_PREFIX ML_INODE
+#include <cluster/masklog.h>
+
#include "alloc.h"
#include "dir.h"
#include "inode.h"
@@ -42,9 +44,6 @@
#include "buffer_head_io.h"
-/* Tracing */
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_SYSFILE
-
static struct inode * _ocfs_get_system_file_inode(ocfs_super *osb, int type, u32 slot);
static inline int is_global_system_inode(int type);
@@ -114,7 +113,7 @@
inode = ocfs_iget(osb, blkno);
if (!inode) {
- LOG_ERROR_STR("Could not create inode!");
+ mlog(ML_ERROR, "Could not create inode!\n");
goto bail;
}
bail:
Modified: trunk/fs/ocfs2/vote.c
===================================================================
--- trunk/fs/ocfs2/vote.c 2005-04-26 00:40:17 UTC (rev 2171)
+++ trunk/fs/ocfs2/vote.c 2005-04-26 00:43:42 UTC (rev 2172)
@@ -37,7 +37,9 @@
#include <dlm/dlmapi.h>
-#include "ocfs_log.h"
+#define MLOG_MASK_PREFIX ML_DLM_GLUE
+#include <cluster/masklog.h>
+
#include "ocfs.h"
#include "ocfs2.h"
@@ -52,8 +54,6 @@
#include "buffer_head_io.h"
-#define OCFS_DEBUG_CONTEXT OCFS_DEBUG_CONTEXT_VOTE
-
#define OCFS2_MESSAGE_TYPE_VOTE (0x1)
#define OCFS2_MESSAGE_TYPE_RESPONSE (0x2)
typedef struct _ocfs2_msg_hdr
@@ -121,7 +121,7 @@
static void ocfs2_process_mount_request(ocfs_super *osb,
unsigned int node_num)
{
- LOG_TRACE_ARGS("MOUNT vote from node %u\n", node_num);
+ mlog(0, "MOUNT vote from node %u\n", node_num);
/* The other node only sends us this message when he has an EX
* on the superblock, so our recovery threads (if having been
* launched) are waiting on it.*/
@@ -137,7 +137,7 @@
static void ocfs2_process_umount_request(ocfs_super *osb,
unsigned int node_num)
{
- LOG_TRACE_ARGS("UMOUNT vote from node %u\n", node_num);
+ mlog(0, "UMOUNT vote from node %u\n", node_num);
ocfs_node_map_clear_bit(osb, &osb->mounted_map, node_num);
ocfs_node_map_set_bit(osb, &osb->umount_map, node_num);
}
@@ -146,9 +146,8 @@
{
int response = -EBUSY;
- LOG_TRACE_ARGS("DELETE vote on inode %lu, read "
- "lnk_cnt = %u\n", inode->i_ino,
- inode->i_nlink);
+ mlog(0, "DELETE vote on inode %lu, read lnk_cnt = %u\n", inode->i_ino,
+ inode->i_nlink);
/* force this as ours may be out of date. */
inode->i_nlink = 0;
@@ -156,8 +155,7 @@
spin_lock(&OCFS_I(inode)->ip_lock);
/* vote no if the file is still open. */
if (OCFS_I(inode)->ip_open_cnt > 0) {
- LOG_TRACE_ARGS("open count = %u\n",
- OCFS_I(inode)->ip_open_cnt);
+ mlog(0, "open count = %u\n", OCFS_I(inode)->ip_open_cnt);
spin_unlock(&OCFS_I(inode)->ip_lock);
goto done;
}
@@ -167,13 +165,13 @@
* it? We want to make sure the inode is removed completely as
* a result of the iput in process_vote. */
if (S_ISDIR(inode->i_mode) && (atomic_read(&inode->i_count) != 1)) {
- LOG_TRACE_ARGS("i_count = %u\n", atomic_read(&inode->i_count));
+ mlog(0, "i_count = %u\n", atomic_read(&inode->i_count));
goto done;
}
if (filemap_fdatawrite(inode->i_mapping)) {
- LOG_ERROR_ARGS("Could not sync inode %llu for delete!\n",
- OCFS_I(inode)->ip_blkno);
+ mlog(ML_ERROR, "Could not sync inode %llu for delete!\n",
+ OCFS_I(inode)->ip_blkno);
goto done;
}
sync_mapping_buffers(inode->i_mapping);
@@ -229,13 +227,13 @@
generation = ntohl(hdr->h_generation);
node_num = ntohl(hdr->h_node_num);
- LOG_TRACE_ARGS("ocfs2: processing vote: request = %u, blkno = %llu, "
- "generation = %u, node_num = %u\n", request, blkno,
- generation, node_num);
+ mlog(0, "processing vote: request = %u, blkno = %llu, "
+ "generation = %u, node_num = %u\n", request, blkno,
+ generation, node_num);
if (!ocfs2_is_valid_vote_request(request)) {
- LOG_ERROR_ARGS("Invalid vote request %d from node %u\n",
- request, node_num);
+ mlog(ML_ERROR, "Invalid vote request %d from node %u\n",
+ request, node_num);
vote_response = -EINVAL;
goto respond;
}
@@ -285,8 +283,8 @@
ocfs2_process_dentry_request(inode, rename);
break;
default:
- LOG_ERROR_ARGS("node %u, invalid request: %u\n",
- node_num, request);
+ mlog(ML_ERROR, "node %u, invalid request: %u\n",
+ node_num, request);
vote_response = -EINVAL;
}
@@ -312,8 +310,8 @@
if (net_status < 0
&& net_status != -ETIMEDOUT
&& net_status != -ENOTCONN)
- LOG_ERROR_ARGS("message to node %u fails with error "
- "%d!\n", node_num, net_status);
+ mlog(ML_ERROR, "message to node %u fails with error %d!\n",
+ node_num, net_status);
if (inode)
iput(inode);
@@ -325,7 +323,7 @@
ocfs2_lock_res *lockres;
ocfs2_vote_work *work;
- LOG_ENTRY();
+ mlog_entry_void();
spin_lock(&osb->vote_task_lock);
/* grab this early so we know to try again if a state change and
@@ -365,7 +363,7 @@
}
spin_unlock(&osb->vote_task_lock);
- LOG_EXIT();
+ mlog_exit_void();
}
@@ -408,7 +406,7 @@
ocfs2_vote_thread_should_wake(osb) ||
kthread_should_stop());
- LOG_TRACE_STR("vote_thread: awoken");
+ mlog(0, "vote_thread: awoken\n");
ocfs2_vote_thread_do_work(osb);
}
@@ -423,7 +421,7 @@
w = kmalloc(sizeof(*w), GFP_KERNEL);
if (!w) {
- LOG_ERROR_STATUS(-ENOMEM);
+ mlog_errno(-ENOMEM);
goto bail;
}
memset(w, 0, sizeof(*w));
@@ -503,12 +501,12 @@
ocfs2_net_wait_ctxt *w = NULL;
int dequeued = 0;
- LOG_ENTRY();
+ mlog_entry_void();
w = ocfs2_new_net_wait_ctxt(response_id);
if (!w) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -520,8 +518,7 @@
while (i != OCFS_INVALID_NODE_NUM) {
if (i != osb->node_num) {
- LOG_TRACE_ARGS("trying to send request to node %i\n",
- i);
+ mlog(0, "trying to send request to node %i\n", i);
ocfs_node_map_set_bit(osb, &w->n_node_map, i);
remote_err = 0;
@@ -532,28 +529,27 @@
i,
&remote_err);
if (status == -ETIMEDOUT) {
- LOG_TRACE_ARGS("remote node %d timed out!\n",
- i);
+ mlog(0, "remote node %d timed out!\n", i);
status = -EAGAIN;
goto bail;
}
if (remote_err < 0) {
status = remote_err;
- LOG_TRACE_ARGS("remote error %d on node %d!\n",
- remote_err, i);
- LOG_ERROR_STATUS(status);
+ mlog(0, "remote error %d on node %d!\n",
+ remote_err, i);
+ mlog_errno(status);
goto bail;
}
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
}
i++;
i = ocfs_node_map_iterate(osb, &osb->mounted_map, i);
- LOG_TRACE_ARGS("next is %d, i am %d\n", i, osb->node_num);
+ mlog(0, "next is %d, i am %d\n", i, osb->node_num);
}
- LOG_TRACE_STR("done sending, now waiting on responses...");
+ mlog(0, "done sending, now waiting on responses...\n");
wait_event(w->n_event, ocfs_node_map_is_empty(osb, &w->n_node_map));
@@ -569,7 +565,7 @@
kfree(w);
}
- LOG_EXIT_STATUS(status);
+ mlog_exit(status);
return status;
}
@@ -588,7 +584,7 @@
request = kmalloc(sizeof(*request), GFP_KERNEL);
if (!request) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
memset(request, 0, sizeof(*request));
@@ -604,7 +600,7 @@
status = ocfs2_broadcast_vote(osb, request, response_id, &response);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -632,7 +628,7 @@
status = ocfs2_super_lock(osb, 0);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
break;
}
@@ -735,18 +731,18 @@
node_num = ntohl(resp->r_hdr.h_node_num);
response_status = ntohl(resp->r_response);
- LOG_TRACE_STR("received response message:");
- LOG_TRACE_ARGS("h_response_id = %u\n", response_id);
- LOG_TRACE_ARGS("h_request = %u\n", ntohl(resp->r_hdr.h_request));
- LOG_TRACE_ARGS("h_blkno = %llu\n", be64_to_cpu(resp->r_hdr.h_blkno));
- LOG_TRACE_ARGS("h_generation = %u\n", ntohl(resp->r_hdr.h_generation));
- LOG_TRACE_ARGS("h_node_num = %u\n", node_num);
- LOG_TRACE_ARGS("r_response = %d\n", response_status);
+ mlog(0, "received response message:\n");
+ mlog(0, "h_response_id = %u\n", response_id);
+ mlog(0, "h_request = %u\n", ntohl(resp->r_hdr.h_request));
+ mlog(0, "h_blkno = %llu\n", be64_to_cpu(resp->r_hdr.h_blkno));
+ mlog(0, "h_generation = %u\n", ntohl(resp->r_hdr.h_generation));
+ mlog(0, "h_node_num = %u\n", node_num);
+ mlog(0, "r_response = %d\n", response_status);
spin_lock(&osb->net_response_lock);
w = __ocfs2_find_net_wait_ctxt(osb, response_id);
if (!w) {
- LOG_TRACE_ARGS("request not found!\n");
+ mlog(0, "request not found!\n");
goto bail;
}
@@ -774,20 +770,19 @@
work = kmalloc(sizeof(ocfs2_vote_work), GFP_KERNEL);
if (!work) {
status = -ENOMEM;
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
INIT_LIST_HEAD(&work->w_list);
memcpy(&work->w_msg, msg->buf, sizeof(ocfs2_vote_msg));
- LOG_TRACE_STR("scheduling vote request:\n");
- LOG_TRACE_ARGS("h_response_id = %u\n",
- work->w_msg.v_hdr.h_response_id);
- LOG_TRACE_ARGS("h_request = %u\n", work->w_msg.v_hdr.h_request);
- LOG_TRACE_ARGS("h_blkno = %llu\n", work->w_msg.v_hdr.h_blkno);
- LOG_TRACE_ARGS("h_generation = %u\n", work->w_msg.v_hdr.h_generation);
- LOG_TRACE_ARGS("h_node_num = %u\n", work->w_msg.v_hdr.h_node_num);
+ mlog(0, "scheduling vote request:\n");
+ mlog(0, "h_response_id = %u\n", work->w_msg.v_hdr.h_response_id);
+ mlog(0, "h_request = %u\n", work->w_msg.v_hdr.h_request);
+ mlog(0, "h_blkno = %llu\n", work->w_msg.v_hdr.h_blkno);
+ mlog(0, "h_generation = %u\n", work->w_msg.v_hdr.h_generation);
+ mlog(0, "h_node_num = %u\n", work->w_msg.v_hdr.h_node_num);
spin_lock(&osb->vote_task_lock);
list_add_tail(&work->w_list, &osb->vote_list);
@@ -809,7 +804,7 @@
net_unregister_handler_list(&osb->osb_net_handlers);
if (!list_empty(&osb->net_response_list))
- LOG_ERROR_STR("net response list not empty!\n");
+ mlog(ML_ERROR, "net response list not empty!\n");
osb->net_key = 0;
}
@@ -830,7 +825,7 @@
ocfs2_handle_response_message,
osb, &osb->osb_net_handlers);
if (status) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
@@ -840,7 +835,7 @@
ocfs2_handle_vote_message,
osb, &osb->osb_net_handlers);
if (status) {
- LOG_ERROR_STATUS(status);
+ mlog_errno(status);
goto bail;
}
bail:
More information about the Ocfs2-commits
mailing list