示例#1
0
 def remove_id_from_list(self, existing_id):
     # KL TODO check that this only happens for DIR
     from core.filesystem.metadata import MetaStore
     logger.debug("Remove inode no {} from list of {}".format(
         new_id, self.id))
     MetaStore.load(self.fs_name).remove_inode_id_from_list(
         self.id, existing_id)
示例#2
0
 def __init__(self, name):
     """Init the class object"""
     self._name = name
     self._meta_store = MetaStore.load(name)
     self._max_inodes = self._wrap_with_delimiter(settings.SB_MAX_INODES)
     self._inode_counter = self._wrap_with_delimiter(
         settings.SB_INODE_COUNTER)
     self._block_size = self._wrap_with_delimiter(settings.SB_BLOCK_SIZE)
     self._free_inode_id = self._wrap_with_delimiter(
         settings.SB_FREE_INODE_ID)
     self._total_size = self._wrap_with_delimiter(settings.SB_TOTAL_SIZE)
     self._used_size = self._wrap_with_delimiter(settings.SB_USED_SIZE)
 def __init__(self, fs_name, cache_flag=True):
     """Setup the filesystem"""
     super(ObjectFsOperations, self).__init__()
     self._fs_name = fs_name
     # loading the meta-store
     self._meta_store = MetaStore.load(self.fs_name)
     # loading the superblock
     self._super_block = SuperBlock(self.fs_name)
     # loading the data-store aka object-store
     self._data_store = ObjectStore.load(self.fs_name)
     # loading the cache store
     self._cache_store = CacheStore.load(self.fs_name)
     # load the cache queue
     self._cache_queue = CacheQueue(self.fs_name)
     # cache flag
     self._cache_flag = cache_flag
示例#4
0
 def __init__(self, meta_store):
     self._meta_store = MetaStore.load('test_fs', meta_store)
     self.inode = Inode(4, stat.S_IFREG | 644, 'test_inode_name')
示例#5
0
 def update(self):
     """Save the changed object to memory store"""
     from objectfs.core.metadata.metastore import MetaStore
     MetaStore.load(self.fs_name).update_inode(self)
示例#6
0
 def add_id_to_list(self, new_id):
     # KL TODO check that this only happens for DIR
     from core.filesystem.metadata import MetaStore
     logger.debug("Add inode no {} to list of {}".format(new_id, self.id))
     MetaStore.load(self.fs_name).add_inode_id_to_list(self.id, new_id)
示例#7
0
 def length_inode_id_list(self):
     from objectfs.core.metadata.metastore import MetaStore
     return MetaStore.load(self.fs_name).length_inode_id_list(self.id)