X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fnfsd.c;h=e3862aa74abbb81983ab7ccd5b22303e45974197;hb=7ca401a44bfecb14b7e5ecf849aec31157382231;hp=f80b01a8acefca6c7431a0d78aa1ed793c0b72ad;hpb=c83d8b650786b8e7d6a9d41c9449c203929c7215;p=bluesky.git diff --git a/nfs3/nfsd.c b/nfs3/nfsd.c index f80b01a..e3862aa 100644 --- a/nfs3/nfsd.c +++ b/nfs3/nfsd.c @@ -30,8 +30,7 @@ static uint8_t filesystem_key[16]; int main(int argc, char *argv[]) { int i; - g_thread_init(NULL); - bluesky_crypt_init(); + bluesky_init(); register_rpc(); bluesky_crypt_random_bytes(filesystem_key, sizeof(filesystem_key)); @@ -41,23 +40,18 @@ int main(int argc, char *argv[]) } printf("\n"); - S3_initialize(NULL, S3_INIT_ALL); - fs = bluesky_new_fs("export"); fs->encryption_key = filesystem_key; BlueSkyInode *root; - root = bluesky_new_inode(BLUESKY_ROOT_INUM, fs, BLUESKY_DIRECTORY); - root->nlink = 1; - root->mode = 0755; - bluesky_insert_inode(fs, root); - - BlueSkyInode *file; - file = bluesky_new_inode(bluesky_fs_alloc_inode(fs), fs, BLUESKY_REGULAR); - file->nlink = 1; - file->mode = 0755; - bluesky_insert_inode(fs, file); - bluesky_directory_insert(root, "demo", file->inum); + root = bluesky_get_inode(fs, BLUESKY_ROOT_INUM); + if (root == NULL) { + printf("Initializing fresh root inode...\n"); + root = bluesky_new_inode(BLUESKY_ROOT_INUM, fs, BLUESKY_DIRECTORY); + root->nlink = 1; + root->mode = 0755; + bluesky_insert_inode(fs, root); + } svc_run(); fprintf(stderr, "%s", "svc_run returned");