Ejemplo n.º 1
0
 def blocks_create_old(self, anon_blk):
   ud = UserDirBlock(self.blkdev, anon_blk.blk_num)
   ud.set(anon_blk.data)
   if not ud.valid:
     raise FSError(INVALID_USER_DIR_BLOCK, block=anon_blk)
   self.set_block(ud)
   return ud
Ejemplo n.º 2
0
 def blocks_create_new(self, free_blks, name, hash_chain_blk, parent_blk, meta_info):
   blk_num = free_blks[0]
   blkdev = self.blkdev
   # create a UserDirBlock
   ud = UserDirBlock(blkdev, blk_num)
   ud.create(parent_blk, name.get_ami_str(), meta_info.get_protect(), meta_info.get_comment_ami_str(), meta_info.get_mod_ts(), hash_chain_blk)
   ud.write()    
   self.set_block(ud)
   self._init_name_hash()
   return blk_num