Whamcloud - gitweb
add mount cache in sm_read_super
[fs/lustre-release.git] / lustre / ptlrpc / ptlrpc_internal.h
index 7100707..7ec654c 100644 (file)
 #ifndef PTLRPC_INTERNAL_H
 #define PTLRPC_INTERNAL_H
 
+#include "../ldlm/ldlm_internal.h"
+
 struct ldlm_namespace;
 struct obd_import;
 struct ldlm_res_id;
+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);
-extern int (*ptlrpc_ldlm_replay_locks)(struct obd_import *);
-
-int ptlrpc_get_ldlm_hooks(void);
 void ptlrpc_daemonize(void);
 
-int ptlrpc_request_handle_eviction(struct ptlrpc_request *);
-void lustre_assert_wire_constants (void);
+void ptlrpc_request_handle_notconn(struct ptlrpc_request *);
+void lustre_assert_wire_constants(void);
 
-void ptlrpc_lprocfs_register_service(struct obd_device *obddev,
+#ifdef __KERNEL__
+void ptlrpc_lprocfs_register_service(struct proc_dir_entry *proc_entry,
                                      struct ptlrpc_service *svc);
 void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc);
+void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req);
+void ptlrpc_lprocfs_do_request_stat (struct ptlrpc_request *req,
+                                     long q_usec, long work_usec);
+#else
+#define ptlrpc_lprocfs_register_service(params...) do{}while(0)
+#define ptlrpc_lprocfs_unregister_service(params...) do{}while(0)
+#define ptlrpc_lprocfs_rpc_sent(params...) do{}while(0)
+#define ptlrpc_lprocfs_do_request_stat(params...) do{}while(0)
+#endif /* __KERNEL__ */
 
+/* recovd_thread.c */
+int llog_init_commit_master(void);
+int llog_cleanup_commit_master(int force);
 
 static inline int opcode_offset(__u32 opc) {
         if (opc < OST_LAST_OPC) {
@@ -56,38 +65,46 @@ static inline int opcode_offset(__u32 opc) {
                         (OST_LAST_OPC - OST_FIRST_OPC));
         } else if (opc < LDLM_LAST_OPC) {
                 /* LDLM Opcode */
-                return (opc - LDLM_FIRST_OPC + 
-                        (MDS_LAST_OPC - MDS_FIRST_OPC) + 
+                return (opc - LDLM_FIRST_OPC +
+                        (MDS_LAST_OPC - MDS_FIRST_OPC) +
                         (OST_LAST_OPC - OST_FIRST_OPC));
         } else if (opc < PTLBD_LAST_OPC) {
                 /* Portals Block Device */
-                return (opc - PTLBD_FIRST_OPC + 
+                return (opc - PTLBD_FIRST_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) +
                         (OST_LAST_OPC - OST_FIRST_OPC));
-        } else { 
+        } else {
                 /* Unknown Opcode */
                 return -1;
         }
 }
 
-#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,
-        PTLRPC_SVCEQDEPTH_CNTR = 1,
-        PTLRPC_SVCIDLETIME_CNTR = 2,
-        PTLRPC_LAST_CNTR    = 3
+        PTLRPC_REQWAIT_CNTR     = 0,
+        PTLRPC_SVCIDLETIME_CNTR = 1,
+        //PTLRPC_SVCEQDEPTH_CNTR,
+        PTLRPC_LAST_CNTR
 };
 
+int ptlrpc_expire_one_request(struct ptlrpc_request *req);
+
+/* pinger.c */
+int ptlrpc_start_pinger(void);
+int ptlrpc_stop_pinger(void);
+void ptlrpc_pinger_sending_on_import(struct obd_import *imp);
+
 #endif /* PTLRPC_INTERNAL_H */