[Ocfs2-commits] zab commits r2158 - in trunk/fs/ocfs2: . cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Apr 20 18:44:35 CDT 2005
Author: zab
Signed-off-by: jlbec
Date: 2005-04-20 18:44:34 -0500 (Wed, 20 Apr 2005)
New Revision: 2158
Modified:
trunk/fs/ocfs2/aio.c
trunk/fs/ocfs2/cluster/masklog.c
trunk/fs/ocfs2/cluster/masklog.h
trunk/fs/ocfs2/cluster/tcp.c
Log:
o add debugging to aio and fix up the masklog api just a little
Signed-off-by: jlbec
Modified: trunk/fs/ocfs2/aio.c
===================================================================
--- trunk/fs/ocfs2/aio.c 2005-04-20 23:31:24 UTC (rev 2157)
+++ trunk/fs/ocfs2/aio.c 2005-04-20 23:44:34 UTC (rev 2158)
@@ -34,6 +34,9 @@
#include <linux/pagemap.h>
#include <linux/uio.h>
+#define MLOG_MASK_PREFIX ML_AIO
+#include <cluster/masklog.h>
+
#include "ocfs_log.h"
#include "ocfs.h"
#include "ocfs2.h"
@@ -48,6 +51,7 @@
#include "mmap.h"
#include "suballoc.h"
+
struct ocfs2_kiocb_private {
struct list_head kp_teardown_item;
ocfs_super *kp_osb;
@@ -61,8 +65,9 @@
static void okp_teardown(struct ocfs2_kiocb_private *okp)
{
+ mlog(0, "okp %p\n", okp);
+
BUG_ON(okp->kp_inode == NULL);
-
BUG_ON(!list_empty(&okp->kp_teardown_item));
BUG_ON(!list_empty(&okp->kp_pending_item));
@@ -115,6 +120,8 @@
unsigned long flags;
ocfs_super *osb = okp->kp_osb;
+ mlog(0, "iocb %p okp %p\n", iocb, okp);
+
/* okp_alloc only assigns the iocb->private and ->ki_dtor pointers if
* it was able to alloc the okp and get an inode reference */
BUG_ON(okp == NULL);
@@ -174,6 +181,7 @@
* iocb without ki_cancel */
static int ocfs2_ki_cancel(struct kiocb *iocb, struct io_event *ev)
{
+ mlog(0, "iocb %p\n", iocb);
aio_put_req(iocb);
return -EAGAIN;
}
@@ -213,6 +221,7 @@
list_add_tail(&okp->kp_pending_item, &osb->osb_okp_pending_list);
spin_unlock_irqrestore(&okp->kp_osb->osb_okp_teardown_lock, flags);
out:
+ mlog(0, "iocb %p returning %p\n", iocb, okp);
return okp;
}
@@ -226,6 +235,7 @@
{
struct kiocb *iocb = (struct kiocb *)data;
/* XXX worry about racing with ki_cancel once we set it */
+ mlog(0, "iocb %p\n", iocb);
kick_iocb(iocb);
}
@@ -240,6 +250,8 @@
ocfs2_backing_inode *target_binode;
ssize_t ret;
+ mlog(0, "iocb %p okp %p\n", iocb, okp);
+
if (okp == NULL) {
okp = okp_alloc(iocb);
if (IS_ERR(okp)) {
@@ -279,6 +291,7 @@
ret = generic_file_aio_read(iocb, buf, count, pos);
out:
/* ki_dtor will always be called eventually, no tear down here */
+ mlog(0, "iocb %p returning %lld\n", iocb, (long long)ret);
return ret;
}
@@ -294,6 +307,8 @@
struct iovec local_iov = { .iov_base = (void *)buf,
.iov_len = count };
+ mlog(0, "iocb %p okp %p\n", iocb, okp);
+
if (okp == NULL) {
okp = okp_alloc(iocb);
if (IS_ERR(okp)) {
@@ -353,5 +368,6 @@
&iocb->ki_pos);
/* ki_dtor will always be called eventually, no tear down here */
+ mlog(0, "iocb %p returning %lld\n", iocb, (long long)ret);
return ret;
}
Modified: trunk/fs/ocfs2/cluster/masklog.c
===================================================================
--- trunk/fs/ocfs2/cluster/masklog.c 2005-04-20 23:31:24 UTC (rev 2157)
+++ trunk/fs/ocfs2/cluster/masklog.c 2005-04-20 23:44:34 UTC (rev 2158)
@@ -167,6 +167,7 @@
set_a_string(TCP);
set_a_string(MSG);
set_a_string(SOCKET);
+ set_a_string(AIO);
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-20 23:31:24 UTC (rev 2157)
+++ trunk/fs/ocfs2/cluster/masklog.h 2005-04-20 23:44:34 UTC (rev 2158)
@@ -84,12 +84,16 @@
#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 */
/* 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 */
#define ML_KTHREAD 0x0000000400000000ULL /* kernel thread activity */
#define MLOG_INITIAL_MASK (ML_ERROR|ML_NOTICE)
+#ifndef MLOG_MASK_PREFIX
+#define MLOG_MASK_PREFIX 0
+#endif
#define MLOG_MAX_BITS 64
@@ -136,7 +140,7 @@
smp_processor_id(), __PRETTY_FUNCTION__, __LINE__, ##args)
#define mlog(mask, fmt, args...) do { \
- u64 __m = MLOG_MASK_PREFIX (mask); \
+ u64 __m = MLOG_MASK_PREFIX | (mask); \
if (__mlog_test_u64(__m, mlog_active_bits)) { \
if (__m & ML_ERROR) \
__mlog_printk(KERN_ERR, "ERROR: "fmt, ##args); \
@@ -146,6 +150,7 @@
} \
} while (0)
+#include <linux/proc_fs.h>
int mlog_init_proc(struct proc_dir_entry *parent);
void mlog_remove_proc(struct proc_dir_entry *parent);
Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c 2005-04-20 23:31:24 UTC (rev 2157)
+++ trunk/fs/ocfs2/cluster/tcp.c 2005-04-20 23:44:34 UTC (rev 2158)
@@ -105,9 +105,9 @@
#include "heartbeat.h"
#include "tcp.h"
#include "nodemanager.h"
+#define MLOG_MASK_PREFIX ML_TCP
#include "masklog.h"
-#define MLOG_MASK_PREFIX ML_TCP|
#define __msg_fmt "[mag %u len %u typ %u status %d key %u num %u] "
#define __msg_args __hdr->magic, __hdr->data_len, __hdr->msg_type, \
More information about the Ocfs2-commits
mailing list