From f0599d473b9f7da19902e89d2c83934157851fe0 Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 28 Nov 2003 08:12:49 +0000 Subject: [PATCH] merge b_devel into b_eq --- lustre/include/linux/lustre_log.h | 15 -------- .../patches/ext3-map_inode_page.patch | 45 +++++++++++++++------- lustre/obdfilter/filter_log.c | 4 +- lustre/ptlrpc/recov_thread.c | 8 +--- 4 files changed, 35 insertions(+), 37 deletions(-) diff --git a/lustre/include/linux/lustre_log.h b/lustre/include/linux/lustre_log.h index fdc2255..2060036 100644 --- a/lustre/include/linux/lustre_log.h +++ b/lustre/include/linux/lustre_log.h @@ -124,7 +124,6 @@ int llog_catlog_list(struct obd_device *obd, int count, /* llog_net.c */ int llog_initiator_connect(struct llog_ctxt *ctxt); int llog_receptor_accept(struct llog_ctxt *ctxt, struct obd_import *imp); -int llog_origin_handle_cancel(struct ptlrpc_request *req); int llog_origin_connect(struct llog_ctxt *ctxt, int count, struct llog_logid *logid, struct llog_ctxt_gen *gen); int llog_handle_connect(struct ptlrpc_request *req); @@ -381,18 +380,4 @@ static inline int llog_connect(struct llog_ctxt *ctxt, int count, RETURN(rc); } -static inline int cathandle_print_cb(struct llog_handle *llh, - struct llog_rec_hdr *rec, void *data) -{ - struct llog_logid_rec *lir = (struct llog_logid_rec *)rec; - - if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC) { - CERROR("invalid record in catalog\n"); - RETURN(-EINVAL); - } - - CDEBUG(D_HA, "seeing record at index %d in log "LPX64"\n", - le32_to_cpu(rec->lrh_index), lir->lid_id.lgl_oid); - RETURN(0); -} #endif diff --git a/lustre/kernel_patches/patches/ext3-map_inode_page.patch b/lustre/kernel_patches/patches/ext3-map_inode_page.patch index 3218a0e..675dc95 100644 --- a/lustre/kernel_patches/patches/ext3-map_inode_page.patch +++ b/lustre/kernel_patches/patches/ext3-map_inode_page.patch @@ -5,19 +5,34 @@ fs/ext3/inode.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) ---- linux-2.4.20-l18/fs/ext3/inode.c~ext3-map_inode_page Fri Jul 25 14:36:14 2003 -+++ linux-2.4.20-l18-phil/fs/ext3/inode.c Fri Jul 25 14:36:14 2003 -@@ -2979,3 +2979,58 @@ int ext3_prep_san_write(struct inode *in +Index: lum/fs/ext3/inode.c +=================================================================== +--- lum.orig/fs/ext3/inode.c Sat Nov 22 16:38:51 2003 ++++ lum/fs/ext3/inode.c Fri Nov 28 00:37:18 2003 +@@ -2979,3 +2979,75 @@ ret = ret2; return ret; } + ++/* copied from fs/buffer.c */ ++static void unmap_underlying_metadata(struct buffer_head * bh) ++{ ++ struct buffer_head *old_bh; ++ ++ old_bh = get_hash_table(bh->b_dev, bh->b_blocknr, bh->b_size); ++ if (old_bh) { ++ mark_buffer_clean(old_bh); ++ wait_on_buffer(old_bh); ++ clear_bit(BH_Req, &old_bh->b_state); ++ __brelse(old_bh); ++ } ++} ++ +int ext3_map_inode_page(struct inode *inode, struct page *page, + unsigned long *blocks, int *created, int create) +{ + unsigned int blocksize, blocks_per_page; + unsigned long iblock; -+ struct buffer_head dummy; + void *handle; + int i, rc = 0, failed = 0, needed_blocks; + @@ -47,16 +62,20 @@ + + iblock = page->index * blocks_per_page; + for (i = 0; i < blocks_per_page; i++, iblock++) { ++ struct buffer_head bh; ++ + if (blocks[i] != 0) + continue; + -+ rc = ext3_get_block_handle(handle, inode, iblock, &dummy, 1); ++ rc = ext3_get_block_handle(handle, inode, iblock, &bh, 1); + if (rc) { -+ printk(KERN_INFO "ext3_map_inode_page: error reading " -+ "block %ld\n", iblock); ++ printk(KERN_INFO "ext3_map_inode_page: error %d " ++ "allocating block %ld\n", rc, iblock); + goto out; + } -+ blocks[i] = dummy.b_blocknr; ++ if (buffer_new(&bh)) ++ unmap_underlying_metadata(&bh); ++ blocks[i] = bh.b_blocknr; + created[i] = 1; + } + @@ -66,8 +85,10 @@ + unlock_kernel(); + return rc; +} ---- linux-2.4.20-l18/fs/ext3/ext3-exports.c~ext3-map_inode_page Fri Jul 25 14:36:14 2003 -+++ linux-2.4.20-l18-phil/fs/ext3/ext3-exports.c Fri Jul 25 14:36:14 2003 +Index: lum/fs/ext3/ext3-exports.c +=================================================================== +--- lum.orig/fs/ext3/ext3-exports.c Sat Nov 22 16:38:51 2003 ++++ lum/fs/ext3/ext3-exports.c Sat Nov 22 16:38:51 2003 @@ -9,6 +9,8 @@ int ext3_prep_san_write(struct inode *inode, long *blocks, @@ -77,10 +98,8 @@ EXPORT_SYMBOL(ext3_force_commit); EXPORT_SYMBOL(ext3_bread); -@@ -18,3 +20,4 @@ EXPORT_SYMBOL(ext3_xattr_get); +@@ -18,3 +20,4 @@ EXPORT_SYMBOL(ext3_xattr_list); EXPORT_SYMBOL(ext3_xattr_set); EXPORT_SYMBOL(ext3_prep_san_write); +EXPORT_SYMBOL(ext3_map_inode_page); - -_ diff --git a/lustre/obdfilter/filter_log.c b/lustre/obdfilter/filter_log.c index 341ad6c..b63c4c2 100644 --- a/lustre/obdfilter/filter_log.c +++ b/lustre/obdfilter/filter_log.c @@ -147,13 +147,13 @@ int filter_recov_log_unlink_cb(struct llog_handle *llh, rc = obd_destroy(exp, oa, NULL, &oti); obdo_free(oa); if (rc == -ENOENT) { - CERROR("object already removed: send cookie\n"); + CWARN("object already removed: send cookie\n"); llog_cancel(ctxt, NULL, 1, &cookie, 0); RETURN(0); } if (rc == 0) - CERROR("object: "LPU64" in record destroyed successful\n", oid); + CWARN("object: "LPU64" in record is destroyed\n", oid); RETURN(rc); } diff --git a/lustre/ptlrpc/recov_thread.c b/lustre/ptlrpc/recov_thread.c index 4772481..5dd9d29 100644 --- a/lustre/ptlrpc/recov_thread.c +++ b/lustre/ptlrpc/recov_thread.c @@ -486,18 +486,12 @@ static int log_process_thread(void *args) GOTO(out, rc); } - rc = llog_process(llh, cathandle_print_cb, NULL); - if (rc) { - CERROR("llog_process with cathandle_print_cb failed %d\n", rc); - GOTO(out, rc); - } - if (cb) { rc = llog_cat_process(llh, (llog_cb_t)cb, NULL); if (rc) CERROR("llog_cat_process failed %d\n", rc); } else - CERROR("no cb func for recovery\n"); + CWARN("no callback function for recovery\n"); CDEBUG(D_HA, "send to llcd :%p forcibly\n", ctxt->loc_llcd); llog_cancel(ctxt, NULL, 0, NULL, OBD_LLOG_FL_SENDNOW); -- 1.8.3.1