From 1d15a098e90fc9f586df55e2d1bbc07c190497b9 Mon Sep 17 00:00:00 2001 From: pschwan Date: Sat, 5 Jul 2003 22:47:43 +0000 Subject: [PATCH] land b_merge on b_devel. Includes b_mount and b_orphan, which includes: - orphans are moved into the PENDING directory for possible recovery - replayed opens now open by fid for orphan/rename safety (1042) - last close of an orphan inode generates a transno (683) - avoid CERROR in normal ll_setattr_raw() error case (1500) Added code which is currently disabled: - dentry pinning from b_mount for cwd and mountpoints (1020) - logging code for orphans (and many other things) --- lustre/liblustre/file.c | 2 +- lustre/liblustre/super.c | 4 ++-- lustre/ptlrpc/ptlrpc_internal.h | 20 ++++++++++++-------- lustre/ptlrpc/ptlrpc_module.c | 6 ++++-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lustre/liblustre/file.c b/lustre/liblustre/file.c index 8344af5..30bb6cc 100644 --- a/lustre/liblustre/file.c +++ b/lustre/liblustre/file.c @@ -477,7 +477,7 @@ static int llu_file_release(struct inode *inode) oa.o_id = lsm->lsm_object_id; oa.o_mode = S_IFREG; oa.o_valid = OBD_MD_FLTYPE | OBD_MD_FLID; - + memcpy(&oa.o_inline, &fd->fd_ost_och, FD_OSTDATA_SIZE); oa.o_valid |= OBD_MD_FLHANDLE; diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index 0e88933..0f4d722 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -765,9 +765,9 @@ out_inode: out_request: ptlrpc_req_finished(request); out_osc: - obd_disconnect(&sbi->ll_osc_conn); + obd_disconnect(&sbi->ll_osc_conn, 0); out_mdc: - obd_disconnect(&sbi->ll_mdc_conn); + obd_disconnect(&sbi->ll_mdc_conn, 0); out_free: OBD_FREE(sbi, sizeof(*sbi)); return err; diff --git a/lustre/ptlrpc/ptlrpc_internal.h b/lustre/ptlrpc/ptlrpc_internal.h index cb96c3c..7bc3b01 100644 --- a/lustre/ptlrpc/ptlrpc_internal.h +++ b/lustre/ptlrpc/ptlrpc_internal.h @@ -33,19 +33,22 @@ struct ptlrpc_request_set; /* ldlm hooks that we need, managed via inter_module_{get,put} */ extern int (*ptlrpc_ldlm_namespace_cleanup)(struct ldlm_namespace *, int); extern int (*ptlrpc_ldlm_cli_cancel_unused)(struct ldlm_namespace *, - struct ldlm_res_id *, int); + struct ldlm_res_id *, int); extern int (*ptlrpc_ldlm_replay_locks)(struct obd_import *); int ptlrpc_get_ldlm_hooks(void); void ptlrpc_daemonize(void); void ptlrpc_request_handle_eviction(struct ptlrpc_request *); -void lustre_assert_wire_constants (void); +void lustre_assert_wire_constants(void); void ptlrpc_lprocfs_register_service(struct obd_device *obddev, struct ptlrpc_service *svc); void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc); +/* recovd_thread.c */ +int llog_init_commit_master(void); +int llog_cleanup_commit_master(void); static inline int opcode_offset(__u32 opc) { if (opc < OST_LAST_OPC) { @@ -66,9 +69,9 @@ static inline int opcode_offset(__u32 opc) { (LDLM_LAST_OPC - LDLM_FIRST_OPC) + (MDS_LAST_OPC - MDS_FIRST_OPC) + (OST_LAST_OPC - OST_FIRST_OPC)); - } else if (opc == OBD_PING) { + } else if (opc < OBD_LAST_OPC) { /* OBD Ping */ - return (opc - OBD_PING + + return (opc - OBD_FIRST_OPC + (PTLBD_LAST_OPC - PTLBD_FIRST_OPC) + (LDLM_LAST_OPC - LDLM_FIRST_OPC) + (MDS_LAST_OPC - MDS_FIRST_OPC) + @@ -79,10 +82,11 @@ static inline int opcode_offset(__u32 opc) { } } -#define LUSTRE_MAX_OPCODES (1 + (PTLBD_LAST_OPC - PTLBD_FIRST_OPC) \ - + (LDLM_LAST_OPC - LDLM_FIRST_OPC) \ - + (MDS_LAST_OPC - MDS_FIRST_OPC) \ - + (OST_LAST_OPC - OST_FIRST_OPC)) +#define LUSTRE_MAX_OPCODES ((PTLBD_LAST_OPC - PTLBD_FIRST_OPC) + \ + (LDLM_LAST_OPC - LDLM_FIRST_OPC) + \ + (MDS_LAST_OPC - MDS_FIRST_OPC) + \ + (OST_LAST_OPC - OST_FIRST_OPC) + \ + (OBD_LAST_OPC - OBD_FIRST_OPC)) enum { PTLRPC_REQWAIT_CNTR = 0, diff --git a/lustre/ptlrpc/ptlrpc_module.c b/lustre/ptlrpc/ptlrpc_module.c index 57f3653..9c0944a 100644 --- a/lustre/ptlrpc/ptlrpc_module.c +++ b/lustre/ptlrpc/ptlrpc_module.c @@ -100,13 +100,14 @@ __init int ptlrpc_init(void) int rc; ENTRY; - lustre_assert_wire_constants (); - + lustre_assert_wire_constants(); + rc = ptlrpc_init_portals(); if (rc) RETURN(rc); ptlrpc_init_connection(); + llog_init_commit_master(); ptlrpc_put_connection_superhack = ptlrpc_put_connection; ptlrpc_abort_inflight_superhack = ptlrpc_abort_inflight; @@ -117,6 +118,7 @@ static void __exit ptlrpc_exit(void) { ptlrpc_exit_portals(); ptlrpc_cleanup_connection(); + llog_cleanup_commit_master(); } /* connection.c */ -- 1.8.3.1