Whamcloud - gitweb
LU-6245 libcfs: remove typedefs in libcfs source code
[fs/lustre-release.git] / lustre / include / lustre_nrs_tbf.h
index f5f4f31..3d52f78 100644 (file)
@@ -6,22 +6,22 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 only,
  * as published by the Free Software Foundation.
-
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License version 2 for more details.  A copy is
- * included in the COPYING file that accompanied this code.
-
+ * GNU General Public License version 2 for more details.
+ *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
 /*
  * Copyright (C) 2013 DataDirect Networks, Inc.
  *
+ * Copyright (c) 2014, Intel Corporation.
  */
 /*
  *
@@ -31,7 +31,6 @@
 
 #ifndef _LUSTRE_NRS_TBF_H
 #define _LUSTRE_NRS_TBF_H
-#include <lustre_net.h>
 
 /* \name tbf
  *
@@ -59,7 +58,9 @@ struct nrs_tbf_client {
        char                             tc_jobid[LUSTRE_JOBID_SIZE];
        /** Reference number of the client. */
        atomic_t                         tc_ref;
-       /** Likage to rule. */
+       /** Lock to protect rule and linkage. */
+       spinlock_t                       tc_rule_lock;
+       /** Linkage to rule. */
        struct list_head                 tc_linkage;
        /** Pointer to rule. */
        struct nrs_tbf_rule             *tc_rule;
@@ -78,7 +79,7 @@ struct nrs_tbf_client {
        /** List of queued requests. */
        struct list_head                 tc_list;
        /** Node in binary heap. */
-       cfs_binheap_node_t               tc_node;
+       struct cfs_binheap_node          tc_node;
        /** Whether the client is in heap. */
        bool                             tc_in_heap;
        /** Sequence of the newest rule. */
@@ -116,6 +117,8 @@ struct nrs_tbf_rule {
        __u64                            tr_nsecs;
        /** Token bucket depth. */
        __u64                            tr_depth;
+       /** Lock to protect the list of clients. */
+       spinlock_t                       tr_rule_lock;
        /** List of client. */
        struct list_head                 tr_cli_list;
        /** Flags of the rule. */
@@ -197,11 +200,11 @@ struct nrs_tbf_head {
        /**
         * Heap of queues.
         */
-       cfs_binheap_t                   *th_binheap;
+       struct cfs_binheap              *th_binheap;
        /**
         * Hash of clients.
         */
-       cfs_hash_t                      *th_cli_hash;
+       struct cfs_hash                 *th_cli_hash;
        /**
         * Type of TBF policy.
         */