summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/throttle-tbf.h
diff options
context:
space:
mode:
authorGluster Ant <bugzilla-bot@gluster.org>2018-09-12 17:22:48 +0530
committerNigel Babu <nigelb@redhat.com>2018-09-12 17:22:48 +0530
commit45a71c0548b6fd2c757aa2e7b7671a1411948894 (patch)
tree2a5a9b73bae47ab53a41166fd041a06612587f48 /libglusterfs/src/throttle-tbf.h
parentbe77dbbda692792335a8e9e7c02e0c281f003c40 (diff)
downloadglusterfs-45a71c0548b6fd2c757aa2e7b7671a1411948894.tar.gz
glusterfs-45a71c0548b6fd2c757aa2e7b7671a1411948894.tar.xz
glusterfs-45a71c0548b6fd2c757aa2e7b7671a1411948894.zip
Land clang-format changes
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
Diffstat (limited to 'libglusterfs/src/throttle-tbf.h')
-rw-r--r--libglusterfs/src/throttle-tbf.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/libglusterfs/src/throttle-tbf.h b/libglusterfs/src/throttle-tbf.h
index b6e04962ca..b44a0f1fdd 100644
--- a/libglusterfs/src/throttle-tbf.h
+++ b/libglusterfs/src/throttle-tbf.h
@@ -16,59 +16,59 @@
#define THROTTLE_TBF_H__
typedef enum tbf_ops {
- TBF_OP_MIN = -1,
- TBF_OP_HASH = 0, /* checksum calculation */
- TBF_OP_READ = 1, /* inode read(s) */
- TBF_OP_READDIR = 2, /* dentry read(s) */
- TBF_OP_MAX = 3,
+ TBF_OP_MIN = -1,
+ TBF_OP_HASH = 0, /* checksum calculation */
+ TBF_OP_READ = 1, /* inode read(s) */
+ TBF_OP_READDIR = 2, /* dentry read(s) */
+ TBF_OP_MAX = 3,
} tbf_ops_t;
/**
* Operation rate specification
*/
typedef struct tbf_opspec {
- tbf_ops_t op;
+ tbf_ops_t op;
- unsigned long rate;
+ unsigned long rate;
- unsigned long maxlimit;
+ unsigned long maxlimit;
- unsigned long token_gen_interval;/* Token generation interval in usec */
+ unsigned long token_gen_interval; /* Token generation interval in usec */
} tbf_opspec_t;
/**
* Token bucket for each operation type
*/
typedef struct tbf_bucket {
- gf_lock_t lock;
+ gf_lock_t lock;
- pthread_t tokener; /* token generator thread */
+ pthread_t tokener; /* token generator thread */
- unsigned long tokenrate; /* token generation rate */
+ unsigned long tokenrate; /* token generation rate */
- unsigned long tokens; /* number of current tokens */
+ unsigned long tokens; /* number of current tokens */
- unsigned long maxtokens; /* maximum token in the bucket */
+ unsigned long maxtokens; /* maximum token in the bucket */
- struct list_head queued; /* list of non-conformant requests */
+ struct list_head queued; /* list of non-conformant requests */
- unsigned long token_gen_interval;/* Token generation interval in usec */
+ unsigned long token_gen_interval; /* Token generation interval in usec */
} tbf_bucket_t;
typedef struct tbf {
- tbf_bucket_t **bucket;
+ tbf_bucket_t **bucket;
} tbf_t;
tbf_t *
-tbf_init (tbf_opspec_t *, unsigned int);
+tbf_init(tbf_opspec_t *, unsigned int);
int
-tbf_mod (tbf_t *, tbf_opspec_t *);
+tbf_mod(tbf_t *, tbf_opspec_t *);
void
-tbf_throttle (tbf_t *, tbf_ops_t, unsigned long);
+tbf_throttle(tbf_t *, tbf_ops_t, unsigned long);
-#define TBF_THROTTLE_BEGIN(tbf, op, tokens) (tbf_throttle (tbf, op, tokens))
+#define TBF_THROTTLE_BEGIN(tbf, op, tokens) (tbf_throttle(tbf, op, tokens))
#define TBF_THROTTLE_END(tbf, op, tokens)
#endif /** THROTTLE_TBF_H__ */