Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / include / lustre_lib.h
index 85cd2cf..98bcf81 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef _LUSTRE_LIB_H
 #define _LUSTRE_LIB_H
 
-#include <libcfs/kp30.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_idl.h>
 #include <lustre_ver.h>
 #include <lustre_cfg.h>
@@ -60,6 +60,7 @@ int target_handle_disconnect(struct ptlrpc_request *req);
 void target_destroy_export(struct obd_export *exp);
 int target_handle_reconnect(struct lustre_handle *conn, struct obd_export *exp,
                             struct obd_uuid *cluuid, int);
+int target_pack_pool_reply(struct ptlrpc_request *req);
 int target_handle_ping(struct ptlrpc_request *req);
 void target_committed_to_req(struct ptlrpc_request *req);
 
@@ -75,6 +76,7 @@ int target_handle_dqacq_callback(struct ptlrpc_request *req);
 void target_cancel_recovery_timer(struct obd_device *obd);
 
 #define OBD_RECOVERY_TIMEOUT (obd_timeout * 5 / 2) /* *waves hands* */
+#define OBD_RECOVERY_MAX_TIME (obd_timeout * 18) /* b13079 */
 void target_start_recovery_timer(struct obd_device *obd);
 int target_start_recovery_thread(struct obd_device *obd, 
                                   svc_handler_t handler);
@@ -250,12 +252,12 @@ static inline int obd_ioctl_pack(struct obd_ioctl_data *data, char **pbuf,
         data->ioc_version = OBD_IOCTL_VERSION;
 
         if (*pbuf && data->ioc_len > max)
-                return 1;
+                return -EINVAL;
         if (*pbuf == NULL) {
                 *pbuf = malloc(data->ioc_len);
         }
         if (!*pbuf)
-                return 1;
+                return -ENOMEM;
         overlay = (struct obd_ioctl_data *)*pbuf;
         memcpy(*pbuf, data, sizeof(*data));
 
@@ -269,7 +271,7 @@ static inline int obd_ioctl_pack(struct obd_ioctl_data *data, char **pbuf,
         if (data->ioc_inlbuf4)
                 LOGL(data->ioc_inlbuf4, data->ioc_inllen4, ptr);
         if (obd_ioctl_is_invalid(overlay))
-                return 1;
+                return -EINVAL;
 
         return 0;
 }
@@ -498,7 +500,7 @@ static inline void obd_ioctl_freedata(char *buf, int len)
 #define ECHO_IOC_CANCEL                _IOWR('f', 203, OBD_IOC_DATA_TYPE)
 
 /* XXX _IOWR('f', 250, long) has been defined in
- * lnet/include/libcfs/kp30.h for debug, don't use it
+ * libcfs/include/libcfs/libcfs_private.h for debug, don't use it
  */
 
 /* Until such time as we get_info the per-stripe maximum from the OST,
@@ -741,6 +743,7 @@ do {                                                                    \
 
 #endif /* __KERNEL__ */
 
+
 #define l_wait_event(wq, condition, info)                       \
 ({                                                              \
         int                 __ret;                              \
@@ -759,6 +762,12 @@ do {                                                                    \
         __ret;                                                  \
 })
 
+#define cfs_wait_event(wq, condition)                          \
+({                                                              \
+        struct l_wait_info lwi = { 0 };                         \
+        l_wait_event(wq, condition, &lwi);                      \
+})
+
 #ifdef __KERNEL__
 #define LIBLUSTRE_CLIENT (0)
 #else