From 0ab0c02f934230015fa6c4376b5ad1302d44f1c2 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 21 Jan 2000 01:15:39 +0000 Subject: [PATCH] Debugging for page lists --- lustre/include/linux/obdfs.h | 10 ++++++++++ lustre/obdfs/rw.c | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lustre/include/linux/obdfs.h b/lustre/include/linux/obdfs.h index 7fb17f1..cbdf71b 100644 --- a/lustre/include/linux/obdfs.h +++ b/lustre/include/linux/obdfs.h @@ -59,6 +59,16 @@ struct obdfs_pgrq { struct page *rq_page; /* page to be written */ }; +void obdfs_print_list(struct list_head *page_list) { + struct list_head *tmp; + + while ( (tmp = tmp->next) != page_list) { + struct obdfs_pgrq *pgrq; + pgrq = list_entry(tmp, struct obdfs_pgrq, rq_plist); + CDEBUG(D_INODE, "page %p\n", pgrq->rq_page); + } +} + inline void obdfs_pgrq_del(struct obdfs_pgrq *pgrq); int obdfs_do_vec_wr(struct super_block *sb, obd_count num_io, obd_count num_oa, struct obdo **obdos, obd_count *oa_bufs, diff --git a/lustre/obdfs/rw.c b/lustre/obdfs/rw.c index ee4ee93..1bdbf9e 100644 --- a/lustre/obdfs/rw.c +++ b/lustre/obdfs/rw.c @@ -144,7 +144,6 @@ obdfs_find_in_page_list(struct inode *inode, struct page *page) { struct list_head *page_list = obdfs_iplist(inode); struct list_head *tmp; - struct obdfs_pgrq *pgrq; ENTRY; CDEBUG(D_INODE, "looking for inode %ld page %p\n", inode->i_ino, page); @@ -155,6 +154,8 @@ obdfs_find_in_page_list(struct inode *inode, struct page *page) } tmp = page_list; while ( (tmp = tmp->next) != page_list ) { + struct obdfs_pgrq *pgrq; + pgrq = list_entry(tmp, struct obdfs_pgrq, rq_plist); CDEBUG(D_INODE, "checking page %p\n", pgrq->rq_page); if (pgrq->rq_page == page) { @@ -229,6 +230,7 @@ static int obdfs_add_page_to_cache(struct inode *inode, struct page *page) list_add(obdfs_islist(inode), obdfs_slist(inode)); } + EXIT; /* XXX For testing purposes, we write out the page here. * In the future, a flush daemon will write out the page. -- 1.8.3.1