Skip to content

Commit

Permalink
core: add some examples of site.h usage
Browse files Browse the repository at this point in the history
Change-Id: I6ce574a593eda8f3a6b2fc8969b5edf7c250b61c
Signed-off-by: Jeff Darcy <[email protected]>
  • Loading branch information
jdarcy authored and amarts committed Sep 11, 2018
1 parent cfb4067 commit d2a9c17
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
23 changes: 20 additions & 3 deletions site.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,25 @@
* what works.
*/

#define SITE_H_ENABLE_LEAST_PRIORITY "on"
#define SITE_H_MD_CACHE_TIMEOUT "1"
#define SITE_H_NFS_DISABLE "on"

/*
* This is just an example, and a way to check whether site.h is actually being
* included automatically.
* As an example of how to use this file, here's what the Facebook version looks
* like:

#define SITE_H_ENABLE_LEAST_PRIORITY "off"
#define SITE_H_MD_CACHE_TIMEOUT "180"
#define SITE_H_NFS_DISABLE "off"

* Each time we add a value here, we lessen the risk of values being
* inconsistent across production automation, test automation, and manual
* developer testing. We also save effort compared to updating values for each
* kind of external automation. To do the same thing with configure scripts or
* specfiles, we'd have to make much more complicated and less discoverable
* changes there.
*
* Other orgs are likely to have the same issues regarding their preferred
* settings, and likewise should add their favorites here as well.
*/
#define SITE_DOT_H_TEST 9987
2 changes: 1 addition & 1 deletion xlators/mgmt/glusterd/src/glusterd-volume-set.c
Original file line number Diff line number Diff line change
Expand Up @@ -2675,7 +2675,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
{ .key = NFS_DISABLE_MAP_KEY,
.voltype = "nfs/server",
.option = "!nfs-disable",
.value = "on",
.value = SITE_H_NFS_DISABLE,
.op_version = 1
},
{ .key = "nfs.nlm",
Expand Down
2 changes: 1 addition & 1 deletion xlators/performance/io-threads/src/io-threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ struct volume_options options[] = {
},
{ .key = {"enable-least-priority"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "on",
.default_value = SITE_H_ENABLE_LEAST_PRIORITY,
.op_version = {1},
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC,
.tags = {"io-threads"},
Expand Down
2 changes: 1 addition & 1 deletion xlators/performance/md-cache/src/md-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -3198,7 +3198,7 @@ struct volume_options options[] = {
.type = GF_OPTION_TYPE_INT,
.min = 0,
.max = 600,
.default_value = "1",
.default_value = SITE_H_MD_CACHE_TIMEOUT,
.description = "Time period after which cache has to be refreshed",
},
{ .key = {"force-readdirp"},
Expand Down

0 comments on commit d2a9c17

Please sign in to comment.