1 /* Blue Sky: File Systems in the Cloud
3 * Copyright (C) 2009 The Regents of the University of California
4 * Written by Michael Vrable <mvrable@cs.ucsd.edu>
14 /* Core filesystem. Different proxies, such as the NFSv3 one, interface to
15 * this, but the core actually tracks the data which is stored. So far we just
16 * implement an in-memory filesystem, but eventually this will be state which
17 * is persisted to the cloud. */
19 /* Return the current time, in microseconds since the epoch. */
20 int64_t bluesky_get_current_time()
23 g_get_current_time(&t);
24 return t.tv_sec * 1000000 + t.tv_usec;
27 /* Allocate a fresh inode number which has not been used before within a
29 uint64_t bluesky_fs_alloc_inode(BlueSkyFS *fs)
33 g_mutex_lock(fs->lock);
36 g_mutex_unlock(fs->lock);
41 BlueSkyInode *bluesky_new_inode(uint64_t inum)
43 BlueSkyInode *i = g_new0(BlueSkyInode, 1);
45 i->lock = g_mutex_new();