/* Can inodes be fetched asynchronously? (Inode object is initially
* created in a pending state, and not unlocked until the data is actually
* available.) */
- int async_inode_fetches;
+ int sync_inode_fetches;
} BlueSkyOptions;
extern BlueSkyOptions bluesky_options;
BlueSkyOptions bluesky_options;
+/* Environment variables that can be used to initialize settings. */
+static struct {
+ const char *env;
+ int *option;
+} option_table[] = {
+ {"BLUESKY_OPT_SYNC_STORES", &bluesky_options.synchronous_stores},
+ {"BLUESKY_OPT_WRITETHROUGH", &bluesky_options.writethrough_cache},
+ {"BLUESKY_OPT_SYNC_INODE_FETCH", &bluesky_options.sync_inode_fetches},
+ {NULL, NULL}
+};
+
/* BlueSky library initialization. */
void bluesky_store_init_s3(void);
g_thread_init(NULL);
bluesky_crypt_init();
- bluesky_options.synchronous_stores = 0;
- bluesky_options.writethrough_cache = 0;
- bluesky_options.async_inode_fetches = 0;
+ for (int i = 0; option_table[i].env != NULL; i++) {
+ const char *val = getenv(option_table[i].env);
+ if (val != NULL) {
+ int v = atoi(val);
+ g_print("Option %s set to %d\n", option_table[i].env, v);
+ *option_table[i].option = atoi(val);
+ }
+ }
bluesky_store_init();
bluesky_store_init_s3();
g_set_prgname("nfsd");
register_rpc();
- bluesky_options.async_inode_fetches = 1;
-
store = bluesky_store_new("s3");
fs = bluesky_init_fs("export", store);