/* 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);
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
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;
+
+
+ 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;
+ }
+
+ 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,
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);
-
-_
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);