Whamcloud - gitweb
LU-9555 quota: df should return projid-specific values
[fs/lustre-release.git] / lustre / include / lustre_net.h
index 7f5fd29..7dad281 100644 (file)
@@ -1974,7 +1974,37 @@ extern void server_bulk_callback(struct lnet_event *ev);
 struct ptlrpc_connection *ptlrpc_connection_get(struct lnet_process_id peer,
                                                 lnet_nid_t self,
                                                 struct obd_uuid *uuid);
-int ptlrpc_connection_put(struct ptlrpc_connection *c);
+
+static inline void  ptlrpc_connection_put(struct ptlrpc_connection *conn)
+{
+       if (!conn)
+               return;
+
+       LASSERT(atomic_read(&conn->c_refcount) > 0);
+
+       /*
+        * We do not remove connection from hashtable and
+        * do not free it even if last caller released ref,
+        * as we want to have it cached for the case it is
+        * needed again.
+        *
+        * Deallocating it and later creating new connection
+        * again would be wastful. This way we also avoid
+        * expensive locking to protect things from get/put
+        * race when found cached connection is freed by
+        * ptlrpc_connection_put().
+        *
+        * It will be freed later in module unload time,
+        * when ptlrpc_connection_fini()->lh_exit->conn_exit()
+        * path is called.
+        */
+       atomic_dec(&conn->c_refcount);
+
+       CDEBUG(D_INFO, "PUT conn=%p refcount %d to %s\n",
+              conn, atomic_read(&conn->c_refcount),
+              libcfs_nid2str(conn->c_peer.nid));
+}
+
 struct ptlrpc_connection *ptlrpc_connection_addref(struct ptlrpc_connection *);
 int ptlrpc_connection_init(void);
 void ptlrpc_connection_fini(void);
@@ -2348,7 +2378,7 @@ timeout_t lustre_msg_get_service_timeout(struct lustre_msg *msg);
 char *lustre_msg_get_jobid(struct lustre_msg *msg);
 __u32 lustre_msg_get_cksum(struct lustre_msg *msg);
 __u64 lustre_msg_get_mbits(struct lustre_msg *msg);
-__u32 lustre_msg_calc_cksum(struct lustre_msg *msg);
+__u32 lustre_msg_calc_cksum(struct lustre_msg *msg, __u32 buf);
 void lustre_msg_set_handle(struct lustre_msg *msg,struct lustre_handle *handle);
 void lustre_msg_set_type(struct lustre_msg *msg, __u32 type);
 void lustre_msg_set_opc(struct lustre_msg *msg, __u32 opc);
@@ -2616,6 +2646,10 @@ int client_connect_import(const struct lu_env *env,
 int client_disconnect_export(struct obd_export *exp);
 int client_import_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
                            int priority);
+int client_import_dyn_add_conn(struct obd_import *imp, struct obd_uuid *uuid,
+                              lnet_nid_t prim_nid, int priority);
+int client_import_add_nids_to_conn(struct obd_import *imp, lnet_nid_t *nids,
+                                  int nid_count, struct obd_uuid *uuid);
 int client_import_del_conn(struct obd_import *imp, struct obd_uuid *uuid);
 int client_import_find_conn(struct obd_import *imp, lnet_nid_t peer,
                             struct obd_uuid *uuid);
@@ -2639,11 +2673,6 @@ struct timeout_item;
 typedef int (*timeout_cb_t)(struct timeout_item *, void *);
 int ptlrpc_pinger_add_import(struct obd_import *imp);
 int ptlrpc_pinger_del_import(struct obd_import *imp);
-int ptlrpc_add_timeout_client(time64_t time, enum timeout_event event,
-                             timeout_cb_t cb, void *data,
-                             struct list_head *obd_list);
-int ptlrpc_del_timeout_client(struct list_head *obd_list,
-                              enum timeout_event event);
 struct ptlrpc_request * ptlrpc_prep_ping(struct obd_import *imp);
 int ptlrpc_obd_ping(struct obd_device *obd);
 void ping_evictor_start(void);